hw: move more files to hw/xen/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw: move char devices to hw/char/, configure via default-configs/
hw: move ISA bridges and devices to hw/isa/, configure with default-configs/
hw: move timer devices to hw/timer/, configure with default-configs/
hw: move watchdogs to hw/watchdog, configure via default-configs/
hw: move MC146818RTC to hw/timer/, configure via default-configs/
hw: move NICs to hw/net/, configure via default-configs/
hw: move block devices to hw/block/, configure via default-configs/
hw: move audio devices to hw/audio/, configure via default-configs/
hw: move display devices to hw/display/, configure via default-configs/
hw: move I2C controllers to hw/i2c/, configure via default-configs/
hw: move SSI controllers to hw/ssi/, configure via default-configs/
hw: move SCSI controllers to hw/scsi/, configure via default-configs/
hw: move target-independent files to subdirectories
This patch tackles all files that are compiled once, movingthem to subdirectories of hw/.
hw: move virtio devices to hw/ subdirectories
hw: make all of hw/ide/ configurable via default-configs/
hw: make all of hw/usb/ configurable via default-configs/
hw: make all of hw/pci/ configurable via default-configs/
hw: make subdirectories for devices
Prepare the new directory structure.
moxie: configure with default-configs file
hw: move headers to include/
Many of these should be cleaned up with proper qdev-/QOM-ification.Right now there are many catch-all headers in include/hw/ARCH dependingon cpu.h, and this makes it necessary to compile these files per-target.However, fixing this does not belong in these patches....
Merge branch 'arm-devs.next' of git://git.linaro.org/people/pmaydell/qemu-arm
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'sstabellini/xen-2013-04-05' into staging
usb-storage: Forward serial number to scsi-disk
usb-storage takes care to fetch the USB serial number from -driveoptions, but it neglected to pass its own 'serial' property to thescsi-disk it creates. With this patch, the 'serial' qdev property andthe 'serial' option in -drive behave the same and correctly apply the...
hw/nand.c: Fix nand erase operation
Usually, nand erase operation has only 2 or 3 address cycles.We need to mask s->addr to zero unset stale high-order bytes in the nand addressbefore using it as the erase address.
This fixes the NAND erase operation in Linux....
cadence_uart: Flush queued characters on reset
Reset can be used to empty the rx-fifo. As the fifo full condition isused to return false from can_receive, queued rx data should be flushedon reset accordingly.
Cc: Wendy Liang <jliang@xilinx.com>Cc: Jason Wu <huanyu@xilinx.com>...
pl330: Don't inhibit ES bits on INTEN
This if-else logic inhibits setting of the event status (ES) bitswhen interrupts are enabled. This is incorrect. ES should be setregardless on INTEN state. INTEN only inhibits the signalling ofevents to PL330 threads, not setting of the ES register....
Allow xen guests to plug disks of 1 TiB or more
The current xen backend driver implementation uses int64_t variablesto store the size of the corresponding backend disk/file. It also usesan int64_t variable to store the block size of that image. When writing...
Xen PV backend: Disable use of O_DIRECT by default as it results in crashes.
Due to what is almost certainly a kernel bug, writes with O_DIRECT maycontinue to reference the page after the write has been marked ascompleted, particularly in the case of TCP retransmit. In other...
Xen PV backend: Move call to bdrv_new from blk_init to blk_connect
This commit delays the point at which bdrv_new (and hence blk_openon the underlying device) is called from blk_init to blk_connect.This ensures that in an inbound live migrate, the block device is...
Introduce 64 bit integer write interface to xenstore
The current implementation of xen_backend only provides 32 bit integerfunctions to write to xenstore. This patch adds two functions thatallow writing 64 bit integers (one generic function and another for...
hw/arm_gic_common: Use vmstate struct rather than save/load functions
Update the GIC save/restore to use vmstate rather than hand-rolledsave/load functions.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Igor Mitsyanko <i.mitsyanko@gmail.com>...
pflash_cfi01: Drop unused 'bypass' field
For pflash_cfi01 the 'bypass' field is set to zero and never changes,so remove it (it is a leftover from pflash_cfi02, where bypass isimplemented).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1363717469-30980-2-git-send-email-peter.maydell@linaro.org
pflash_cfi01: Implement migration support
Add a vmstate to pflash_cfi01, so that it can be live migrated.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1363717469-30980-3-git-send-email-peter.maydell@linaro.org
hw/sd.c: fix migration of dynamically allocated buffer "buf"
VMSTATE_BUFFER_UNSAFE should be used for buffers inlined in device state, notfor buffers allocated dynamically. Change to VMSTATE_BUFFER_POINTER_UNSAFE macro,which will do migration right.
Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com>...
hw/onenand.c: fix migration of dynamically allocated buffer "otp"
VMSTATE_BUFFER_UNSAFE should be used for buffers inlined in device state, notfor buffers allocated dynamically. Change to VMSTATE_BUFFER_POINTER_UNSAFE macro,which will do migration right....
arm_gic: Fix sizes of state fields in preparation for vmstate support
In preparation for switching to vmstate for migration support, fixthe sizes of various GIC state fields. In particular, we replace allthe bitfields (which VMState can't deal with) with straightforward...
hw/arm/nseries: don't print to stdout or stderr
Remove various bits of printing to stdout or stderr from thenseries code, replacing it with a qemu log message where there'san appropriate log category, and just dropping the output forsome of the more debug-like printing....
pl050: Don't send always-constant is_mouse field
The is_mouse field of the pl050 state structure is constant (it trackswhether this is a 'pl050_keyboard' or 'pl050_mouse'), so there'sno need to include it in the VMState structure.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
hw/arm_mptimer: Save the timer state
Add a missing VMSTATE_TIMER() entry to the arm_mptimer vmstatedescription; this omission meant that we would probably hang on reloadwhen the timer failed to fire.
petalogix_ml605_mmu: Cleanup ssi_create_slave()
With the recent m25p80 cleanup there is no need to usessi_create_slave_no_init() anymore. Just use ssi_create_slave().
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
xilinx_zynq: Cleanup ssi_create_slave
extract/unify the constant 0xfee00000 as APIC_DEFAULT_ADDRESS
A common dependency of the constant's current users:- hw/apic_common.c- hw/i386/kvmvapic.c- target-i386/cpu.cis "target-i386/cpu.h".
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
Introduce IO_APIC_DEFAULT_ADDRESS for 0xfec00000
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1363821803-3380-10-git-send-email-lersek@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc_acpi_init(): don't bail as soon as failing to find default DSDT
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1363821803-3380-11-git-send-email-lersek@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
change element type from "char" to "unsigned char" in ACPI table data
The data is binary, not textual.
Also, acpi_table_add() abuses the "char *f" pointer -- which normallypoints to file names to load -- to poke into the table. Introduce "charunsigned *table_start" for that purpose....
acpi_table_add(): report fatal errors through an internal Error object
The upcoming changes will need a cleanup section at the end of thefunction, plus OptsVisitor reports errors via Error. For now keepchanneling any Errors to stderr.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>...
acpi_table_add(): accept QemuOpts and parse it with OptsVisitor
As one consequence, strtok() -- which modifies its argument -- is replacedwith g_strsplit().
acpi_table_add(): extract and reimplement internals
The new function acpi_table_install() installs any blob the caller passesin. In the next patches this function will be promoted from helper role toextern.
Reimplementing the logic should make it easier to understand. It also...
like acpi_table_install(), acpi_table_add() should propagate Errors
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1363821803-3380-8-git-send-email-lersek@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
ipoctal232: Convert to use chardev properties directly
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Alberto Garcia <agarcia@igalia.com>Message-id: 1364412581-3672-4-git-send-email-hdegoede@redhat.com...
qemu-char: Add qemu_chr_fe_claim / _release helper functions
Add qemu_chr_fe_claim / _release helper functions for properly dealing withavail_connections.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364412581-3672-2-git-send-email-hdegoede@redhat.com...
qemu-char: Call fe_claim / fe_release when not using qdev chr properties
chardev-frontends need to explictly check, increase and decrement theavail_connections "property" of the chardev when they are not using aqdev-chardev-property for the chardev.
This fixes things like:...
xilinx_axienet: pump events as appropriate
When the conditions blocking receiving are cleared, check for buffered rxpackets.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
acpi: initialize s4_val used in s4 shutdown
While investigating why a 32 bit Windows 2003 guest wasn't able tosuccessfully perform a shutdown /h, it was discovered that commitafafe4bbe0cf7d3318e1ac7b40925561f86a6bd4 inadvertently dropped theinitialization of the s4_val used to handle s4 shutdown....
VMXNET3: initialize rx_ridx to eliminate compile warning
Gcc report "hw/vmxnet3.c:972: error: ‘rx_ridx’ may be useduninitialized in this function", so fix it.
Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>Message-id: 1364264646-27542-1-git-send-email-xiawenc@linux.vnet.ibm.com...
qdev: only send deleted event if device was realized
Reported-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1364402174-16580-1-git-send-email-aliguori@us.ibm.com
vfio: cleanup includes
Starting to get messy, put the back in alphabetical order.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
vfio: Add bootindex support
vfio-pci: Move devices to D0 on reset
Guests may leave devices in a low power state at reboot, but we expectdevices to be woken up for the next boot. Make this happen.
vfio-pci: Add extra debugging
Often when debugging it's useful to be able to disable bypass pathsso no interactions with the device are missed. Add some extra debugoptions to do this. Also add device info on read/write BAR accesses,which is useful when debugging more than one assigned device. A...
qemu vfio-pci: Graphics device quirks
Graphics cards have a number of different backdoors. Some of theseare alternative ways to get PCI BAR addresses, some of them arecomplete mirrors of PCI config space available through MMIO andI/O port access. These quirks cover a number of ATI Radeon and...
qemu vfio-pci: Add support for VGA MMIO and I/O port access
Most VGA cards need some kind of quirk to fully operate since theyhide backdoors to get to other registers outside of PCI config spacewithin the registers, but this provides the base infrastructure. If...
vfio-pci: Generalize PCI config mangling
Kernel-side vfio virtualizes all of config space, but some parts areunique to Qemu. For instance we may or may not expose the ROM BAR,Qemu manages MSI/MSIX, and Qemu manages the multi-function bit so thatsingle function devices can appear as multi-function and vica versa....
vfio-pci: Add PCIe capability mangling based on bus type
Windows seems to pay particular interest to the PCIe header type ofdevices and will fail to load drivers if we attach Endpoint devices orLegacy Endpoint devices to the Root Complex. We can usepci_bus_is_express and pci_bus_is_root to determine the bus type and...
sysbus: make SysBusDeviceClass::init optional
Make the SysBusDeviceClass::init optional, for devices whichgenuinely don't need to do anything here. In particular, simpledevices which can do all their initialization in theirinstance_init method don't need either a DeviceClass::realize...
musicpal: qdevify musicpal-misc
Make musicpal-misc into its own (trivial) qdev device, so wecan get rid of the abuse of sysbus_add_memory().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
milkymist-minimac2: Just expose buffers as a sysbus mmio region
Just expose the register buffers memory as a standard sysbus mmioregion which the creator of the device can map, rather thanproviding a qdev property which the creator has to set to thebase address and then doing the mapping in the device's own...
milkymist-softusb: Don't map RAM memory regions in the device itself
Don't map the pmem and dmem RAM memory regions in the milkymist-softusbdevice itself. Instead just expose them as sysbus mmio regions whichthe device creator can map appropriately. This allows us to drop the...
hw/milkymist-softusb: set buffer in softusb_read_{dmem, pmem} error path
Make sure we set the buffer to something in the softusb_read_{dmem,pmem}error paths, since the caller will use the buffer unconditionally.(Newer gcc is smart enough to spot this and complain about 'may be...
sysbus: Remove sysbus_add_memory and sysbus_del_memory
Remove the sysbus_add_memory and sysbus_del_memory functions. Theseare trivial wrappers for mapping a memory region into the systemmemory space, and have no users now. Sysbus devices should never map...
piix_pci: Use DEVICE and ISA_BUS()
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Tested-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Message-id: 1361580039-4459-3-git-send-email-dwmw2@infradead.org...
piix_pci: Fix C99 comments
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Tested-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Message-id: 1361580039-4459-4-git-send-email-dwmw2@infradead.org...
piix_pci: Clean up i440FX object handling
Define and use I440FX_PCI_DEVICE() instead of using DO_UPCAST().
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Tested-by: Laszlo Ersek <lersek@redhat.com>...
virtio-balloon: add the virtio-balloon device.
Create virtio-balloon which extends virtio-device, so it can be connected onvirtio-bus.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
virtio-balloon-pci: switch to the new API.
Here the virtio-balloon-pci is modified for the new API. The devicevirtio-balloon-pci extends virtio-pci. It creates and connects avirtio-balloon during the init. The properties are not changed.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>...
virtio-balloon-ccw: switch to the new API.
Here the virtio-balloon-ccw is modified for the new API. The devicevirtio-balloon-ccw extends virtio-ccw-device as before. It creates andconnects a virtio-balloon during the init. The properties are not modified....
virtio-balloon: cleanup: init and exit function.
This remove old init and exit function as they are no longer needed.
virtio-balloon: cleanup: QOM casts.
As the virtio-balloon-pci is switched to the new API, we can use QOMcasts.
virtio-balloon: cleanup: remove qdev field.
The qdev field is no longer needed, just drop it.
hw/tcx: Remove unused 'addr' field and the property that sets it
Remove the 'addr' field from TCXState (since it is completely unused),also the qdev property which sets it. This seems to be a relic frommany years past; devices don't need to know where they are mapped....
hw/i386/pc: format load_linux function
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
virtio-serial: Consolidate guest_open/guest_close into set_guest_connected
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-10-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-serial: propagate guest_connected to the port on post_load
When migrating a host with with a spice agent running the mouse becomesnon operational after the migration due to the agent state beinginconsistent between the guest and the client.
After migration the spicevmc backend on the destination has never been notified...
qemu-char: Automatically do fe_open / fe_close on qemu_chr_add_handlers
Most frontends can't really determine if the guest actually has the frontendside open. So lets automatically generate fe_open / fe_close as soon as afrontend becomes ready (as signalled by calling qemu_chr_add_handlers) /...
qemu-char: Cleanup: consolidate fe_open/fe_close into fe_set_open
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-6-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Move incrementing of avail_connections to qdev-properties-system
The decrement of avail_connections is done in qdev-properties-system movethe increment there too for proper balancing of the calls.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
qemu-char: Rename opened to be_open
Rename the opened variable to be_open to reflect that it contains theopened state of the backend.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-2-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
virtio,pci,qom
Work by Alex to support VGA assignment,pci and virtio fixes by Stefan, Jason and myself, and anew qmp event for hotplug support by myself.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
pcie: Add endpoint capability initialization wrapper
Fix the awkward API of mangling the caller specified PCIe type andjust provide an interface to initialize an endpoint device. Thiswill pick either a regular endpoint or integrated endpoint based onthe bus and return pcie_cap_init to doing exactly what is asked....
pci: Create and register a new PCI Express TypeInfo
This will allow us to differentiate Express and Legacy buses.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: Move PCI and PCIE type defines
Move these so that we can reference them from a more common headerinstead of including pci_bus.h everywhere.
pci: Allow PCI bus creation interfaces to specify the type of bus
No change to any types.
pci: Q35, Root Ports, and Switches create PCI Express buses
Convert q35, ioh3420, xio3130_upstream, and xio3130_downstream touse the new TYPE_PCIE_BUS.
pci: Create pci_bus_is_express helper
For testing the bus type.
pci: Create and use API to determine root buses
pcie: Mangle types to match topology
Windows will fail to start drivers for devices with an Endpoint typePCIe capability attached to a Root Complex (code 10 - Device cannotstart). The proper type for such a device is Root Complex IntegratedEndpoint. Devices don't care which they are, so do this conversion...
pci: refuse empty ROM files
A zero size ROM file is invalid and should produce a warning.Attempting to use a zero size file ends up hitting an assertionqemu_ram_set_idstr() because RAMBlocks with duplicate addresses areallocated - due to zero size the allocator doesn't increment the next...