disentangle tcg and deadline calculation
Just tell main_loop_wait whether to be blocking or nonblocking, so thatthere is no need to call qemu_cpus_have_work from the timer subsystem.Instead, tcg_cpu_exec can say "we want the main loop not to block because...
balloon: Do not save VM state wrt asynchronous virtio operations
When working with the VM state (for loadvm/savevm and migration), it is notvalid to load and store pointers since the validity of those pointers cannot beassured in the new qemu address space. Therefore, virtio_balloon_save() and...
block: add logical_block_size property
Add a logical block size attribute as various guest side tools onlyincrease the filesystem sector size based on it, not the advisoryphysical block size.
For scsi we already have support for a different logical block size...
Avoid crash on '-usbdevice <device>' without parameters
Many usbdevice_init implementors assume params is non-NULL.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote branch 'markus/qerror' into staging
Merge remote branch 'mst/pci' into staging
Large page TLB flush
QEMU uses a fixed page size for the CPU TLB. If the guest uses largepages then we effectively split these into multiple smaller pages, andpopulate the corresponding TLB entries on demand.
When the guest invalidates the TLB by virtual address we must invalidate...
monitor: Use argument type 'O' for device_add
While there, improve the params help text.
monitor: convert do_device_add() to QObject
qdev: Relax parsing of bus option
Treat multiple successive slashes as a one slash. Ignore trailingslashes. This is how POSIX pathnames work.
qdev: Convert qbus_find() to QError
Revert "qdev: Use QError for 'device not found' error"
This reverts commit 3ced9f7a36189aed94d8bf86f3f5087a53012455.
The next commit will convert all of qdev_device_add() to QError, andit'll be clearer with this partial conversion reverted.
error: Convert do_device_add() to QError
Conversion to QObject is still missing.
qemu-option: Move the implied first name into QemuOptsList
We sometimes permit omitting the first option name, for example-device foo is short for -device driver=foo. The name to use("driver" in the example) is passed as argument to qemu_opts_parse()....
qdev: convert setting device properties to QError
qdev: Hide "ptr" properties from users
Users can't set them, so qdev_device_help() shouldn't list them. Fixthat. Also make qdev_prop_parse() hide them instead of printing ameaningless "has no parser" error message.
Their value means nothing to users, so qdev_print_props() shouldn't...
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
error: Rename qemu_error_new() to qerror_report()
qdev: Fix -device and device_add to handle unsuitable bus gracefully
"device_add isa-serial,bus=pci.0" kills QEMU. Not good.
qdev: Factor qdev_create_from_info() out of qdev_create()
To make it obvious that -device and device_add can't die inhw_error().
qdev: Hide "no_user" devices from users
Users can't create them, so qdev_device_help() shouldn't list them.Fix that.
Also make qdev_device_add() pretend they don't exist. Before, itrejected them with a "can't be added via command line" message, which...
error: Don't abuse qemu_error() for non-error in scsi_hot_add()
Commit 30d335d6 converted an informational message frommonitor_printf() to qemu_error(), probably because the latter doesn'tneed a mon argument. A later commit will make qemu_error() print...
pc: Fix error reporting for -boot once
Commit 0ecdffbb created pc_boot_set() for use from monitor command"boot_set", via qemu_boot_set(). pc_boot_set() reports errors tocur_mon, which works fine for monitor code.
Commit e0f084bf reused the function int reset handler...
pc: Factor common code out of pc_boot_set() and cmos_init()
Code duplicated in commit 0ecdffbb. The two versions are similar, butnot identical:
block: Simplify usb_msd_initfn() test for "can read bdrv key"
The old test assumes that "hotplugged" implies "we have a currentmonitor for reading the key". This is in fact true, but it's notobviously true.
Aside: if it were false, we could pass a null pointer to...
error: Move qemu_error & friends into their own header
error: Don't abuse qemu_error() for non-error in qdev_device_help()
qdev_device_help() prints device information with qemu_error(). Alater commit will make qemu_error() print additional stuff that isonly appropriate for proper errors, and then this will break. Use...
error: Don't abuse qemu_error() for non-error in qbus_find()
qbus_find() adds an informational line to error messages, and printsboth lines with one qemu_error(). Use error_printf() for theinformational line instead.
While there, simplify: instead of printing buffers filled by...
load_elf: replace the address addend by a translation function
A few machines need to translate the ELF header addresses into physicaladdresses. Currently the only possibility is to add a value to theaddresses.
This patch replaces the addend argument by and a translation function...
pcnet: make subsystem vendor id match hardware
Real pcnet device (AT2450) apparently has subsystemdevice and vendor id set to 0, this is out of spec(which requires that vendor id is obtained from PCI SIG)but windows xp driver seems to need this in order...
eepro100: address pci todo's, use pci_set_xx
eepro100 uses macros which rely on a specificlocal variable name (pci_conf) which is scary.Some of the uses are wrong or unnecessary,remove them. The rest are small in number, open-codethem using pci_set_xx functions....
mips: add header to mips_int.c and mips_timer.c
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
spelling typo (compatibilty) in hw/fw_cfg.c
here's a trivial patch to fix the spelling of "compatibility":
Signed-off-by: Vagrant Cascadian <vagrant@freegeek.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fdc: fix drive property handling.
Fix the floppy controller init wrappers to set the drive propertiesonly in case the DriveInfo pointers passed in are non NULL. This allowsto set the properties using -global.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
QMP: Introduce WATCHDOG event
It's emitted whenever the watchdog device's timer expires. The actiontaken is provided in the 'data' member.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: Catch attempt to attach more than one device to a netdev
Guest device and host netdev are peers, i.e. it's a 1:1 relation.However, we fail to enforce that:
$ qemu -nodefaults --nographic -netdev user,id=net0 -device e1000,netdev=net0 -device virtio-net-pci,netdev=net0 -monitor stdio...
scsi: Make device scsi-disk reject /dev/sg*
You're supposed to use scsi-generic for that. Which rejects anythingbut /dev/sg*.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kbd leds: ps/2 kbd
Add led status notification support to the ps/2 kbd driver.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kbd leds: usb kbd
Add led status notification support to the usb kbd driver.
qdev: Improve diagnostics for bad property values
Property "vlan" reports "failed to parse" even when the value parsesjust fine, but the result doesn't name an existing VLAN.
Similarly, properties "drive", "chr" and "netdev" misleadingly report"failed to parse" when the value doesn't name an existing host device....
QMP: Introduce RTC_CHANGE event
Emitted whenever the RTC time changes.
adding helper pci functions
Signed-off-by: Izik Eidus <ieidus@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pcnet APROMWE bit location (retry)
According to AMD document 21485D pp.141, APROMWE is bit 8 of BCR2.
Signed-off-by: Christopher Kilgour <techie@whiterocker.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: Add a DEV_NVECTORS_UNSPECIFIED enum for unspecified nr of MSI vectors
net.c used a constant to signify no MSI vectors were specified. Extendthat to all qdev devices.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Reported-by: "Michael S. Tsirkin" <mst@redhat.com>...
virtio-pci: Use DEV_NVECTORS_UNSPECIFIED instead of -1 for virtio-serial
Use the named constant instead of -1.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Reported-by: "Michael S. Tsirkin" <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block: Emit BLOCK_IO_ERROR before vm_stop() call
The next commit will move the STOP event into do_vm_stop(), tohave the expected event sequence we need to emit the I/O errorevent before calling vm_stop().
The expected sequence is:
{ "event": "BLOCK_IO_ERROR" [...] }...
ppc: don't define bamboo-0.13 as the default machine
It has been broken by commit 977b6b91cee1132f8c7b12d22f4b273091598e44.
Update to a hopefully more future proof FSF address
See also 8167ee883931cb20c6264fc19d040ce2dc6ceaaa,530e7615ce3c01882e582c84dc6304ab98a3d5c5 andfad6cb1a565bb73f83fc0e2654489457b489e436.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
scsi: update comment on the standards revision
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
ppc440_bamboo: Disable new virtio-serial features for 0.12 machine type
Disable the MULTIPORT feature and MSI vectors for the 0.12 machinetypes; those features are added only for 0.13 onwards.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
ppc440_bamboo: Add 0.12 and 0.13 machine types for backward compat
Add a 0.12 machine type for compatibility with older versions. Mark thedefault one as 0.13.
s390-virtio: Fix compile error for virtio-block init
Commit 428c149b0be790b440e1cbee185b152cdb22feec modified the argumentthat virtio_blk_init takes. Update the s390 bus code that calls thisfunction.
Signed-off-by: Amit Shah <amit.shah@redhat.com>CC: Christoph Hellwig <hch@lst.de>...
hw/serial.c: fix THRE interrupt clearing
UART_IIR_THRI is not a mask, but a possible value for the IIR ID.Use UART_IIR_ID to extract this value.
Broken by commit 71e605f80313a632cc6714cde7bd240042dbdd95.
hw/serial.c: fix indentation
Merge remote branch 'qemu-kvm/uq/master' into pulls
x86: Extend validity of bsp_to_cpu
As we hard-wire the BSP to CPU 0 anyway and cpuid_apic_id equalscpu_index, bsp_to_cpu can also be based on the latter directly. Thiswill help an early user of it: KVM while initializing mp_state.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
KVM: Rework VCPU state writeback API
This grand cleanup drops all reset and vmsave/load relatedsynchronization points in favor of four(!) generic hooks:
- cpu_synchronize_all_states in qemu_savevm_state_complete (initial sync from kernel before vmsave)...
Allocate memory below 4GB as one chunk
Instead of allocating a separate chunk for the first 640KB and anotherfor 1MB+, allocate one large chunk. This plays well in terms of alignmentand size with large pages.
Signed-off-by: Avi Kivity <avi@redhat.com>...
eepro100: Keep includes sorted
I always try to keep standard includes sortedand add a comment why they are there (so theycan be removed when they are no longer needed).
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eepro100: Remove C++ comments
C++ comments are unwanted, so this is fixed here.
eepro100: Add diagnose command
Real hardware would run an internal self-test.The emulation just returns a passed status.
Original patch was from Reimar Döffinger, thanks.
eepro100: New function for reading command block
Move code which reads the command block to thenew function read_cb. The patch also fixes someendianess issues related to the command blockand moves declarations of local variables tothe beginning of the block....
eepro100: Use tx.status
There is no need for a local variable "status".Using tx.status makes it clearer which statusis addressed.
eepro100: Prettify code (no functional changes)
eepro100: Fix CU Start command
CU Start is allowed when the CU is in the idle or suspended state.
eepro100: Support RNR interrupt
The RNR interrupt is triggered under these conditions:
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
eepro100: Replace variable name to fix a compiler warning
When compiling with -Wshadow, gcc gives a warningwhich is fixed by renaming stat -> status.
eepro100: Use symbolic names for bits in EEPROM id
V2 - Use UPPER_CASE for enum values
eepro100: Remove old unused code
This code is no longer needed.
eepro100: Use symbolic names and BIT macros in binary operations
Instead of magic numbers like 0x8000, symbolic names are usedfor the SCB command and status bits.
There are too many configuration bits to use symbolic namesthere, too. Using the BIT macro is a little help when comparing...
eepro100: Add device descriptions
Add descriptions for all devices.These descriptions are shown when users call qemu -device ?
eepro100: Update copyright notice
eepro100: Add TODO list
eepro100: Support gpxe boot for all eepro100 devices
Only two boot ROM files are needed for all devices.
eepro100: Fix PXE boot
The phy handling was wrong for PXE, GPXE boot:GPXE's eepro100 driver did not detect a valid link.
This is fixed here.
eepro100: Add missing SCB register names
Some system control block registers were addressedusing their offset value. Use symbolic names nowand clean the documentation.
eepro100: Fix compiler errors from debug messages
When debug output was enabled (by defining DEBUG_EEPRO100),some debug messages resulted in a compiler error.
Move ioport.h out of cpu-all.h
Only include ioport.h where it is actually needed.
Signed-off-by: Paul Brook <paul@codesourcery.com>
alpha-linux-user: Implement signals.
Move userland PALcode handling into linux-user main loop so thatwe can send signals from there. This also makes alpha_palcode.csystem-level only, so don't build it for userland. Add definesfor GENTRAP PALcall mapping to signals....
powerpc/e500: adjust fdt and ramdisk loading addr
Since kernel uimage is getting bigger,old fixed loading bases will result in regions overlap.
Add pad for fdt and ramdisk, so that they won't overlap with uimage.
Signed-off-by: Liu Yu <yu.liu@freescale.com>...
powerpc: fix compilation with CONFIG_FDT undefined
powerpc/booke: move fdt loading to rom infrastructure
It's convinent to use rom to checking overlap, to reset etc.And uImage and ramdisk loading has already moved to it.
Also, after we add fdt to rom, free it.
target-ppc: add synchronize register for booke init
So that the following registers init could be flushed back to kvm.
Signed-off-by: Liu Yu <yu.liu@freescale.com>Acked-by: Hollis Blanchard <hollis@penguinppc.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix -usbdevice crash
If -usbdevice is used on a machine with no USB busses, usb_createwill fail and return NULL. Patch below handles this failure gracefullyrather than crashing when we try to init the device.
rewrote timer implementation for rtl8139.
Add a QEMU timer only when needed (timeout status not set, timeoutirq wanted and timer set).
This patch is required for Darwin. Patch has been tested underFreeBSD, Darwin and Linux.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>...
Fix lost serial TX interrupts. Report receive overruns.
o Implement receive overrun status. The FreeBSD uart driver relies on this status in it's probe routine to determine the size of the FIFO supported. o As per the 16550 spec, do not overwrite the RX FIFO on an RX overrun....
apc_pci: simplify using rwhandler
Use rwhandler to simplify apb_pci.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
apb_pci: minor cleanup
pci_data_write ignores high 8 bit in address,so there seems to be no need to set themin apb_pci.
Fix arm-softmmu compile
cc1: warnings being treated as errors/src/qemu/hw/pl181.c: In function 'pl181_fifo_run':/src/qemu/hw/pl181.c:185: error: 'value' may be used uninitialized in this function
PL181 write fix
The PL181 data transfer loop incorrectly terminates after the last FIFOword is popped, discarding the last 3 bytes of data on a write transfer.
Fix warning on mingw32
/src/qemu/hw/ide/core.c: In function 'ide_drive_pre_save':/src/qemu/hw/ide/core.c:2740: warning: comparison is always false due to limited range of data type
QEMU e820 reservation patch
Hi,
Kevin and I have agreed on the approach for this one now. So here isthe latest version of the patch for QEMU, submitting e820 reservationentries via fw_cfg.
Cheers,Jes
Use qemu-cfg to provide the BIOS with an optional table of e820 entries....
qdev: Free opts on failed do_device_add
If the device can't be created, don't leak the QemuOpts and release the id ofthe device that should have been added by the failed device_add.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide save/restore pio/atapi cmd transfer fields and io buffer
Save/restore information necessary to continue in progress PIO/ATAPI CMDtransfers.
This includes the IO buffer.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
USB HID does not support Set_Idle
I found that the QEMU USB keyboard support does not work properly withthe Set_Idle command. Once a non-zero value is given to Set_Idle,then the keyboard reports an event on every poll - not based on thetime issued in the Set_Idle command....
pc: Bump up pc version to 0.13 and add a 0.12 compat version
The version 0.13 will be the new default and compatibility options willbe added to the 0.12 version.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: Add backward compatibility options for virtio-serial
virtio-serial-pci can support multiple ports in the current developmentversion that will become 0.13. Add compatibility options for the 0.12and 0.11 pc machine types.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
virtio-serial: don't set MULTIPORT for 1 port dev
Since commit 98b19252cf1bd97c54bc4613f3537c5ec0aae263, allserial devices declare MULTIPORT feature.To allow 0.12 compatibility, we should clear this whenmax_nr_ports is 1.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
virtio-serial: pci: Allow MSI to be disabled
Michael noted we don't allow disabling of MSI for the virtio-serial-pcidevice. Fix that.
Signed-off-by: Amit Shah <amit.shah@redhat.com>CC: "Michael S. Tsirkin" <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Monitor: Convert pci_device_hot_remove() to cmd_new_ret()