misc/pci-testdev: QOM parent field cleanup
Replace direct uses of PCITestDevState::dev with QOM casts and rename itto parent_obj.
Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
display/vmware_vga: QOM casting sweep
Define and use standard QOM cast macro. Remove usages of DO_UPCAST() anddirect -> style casting.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[AF: Renamed to TYPE_VMWARE_VGA and VMWARE_VGA()]Signed-off-by: Andreas Färber <afaerber@suse.de>
display/vmware_vga: QOM parent field cleanup
Replace direct uses of pci_vmsvga_state_s::card with QOM casts andrename it to parent_obj.
misc/ivshmem: QOM Upcast Sweep
Define and use standard QOM cast macro. Remove usages of DO_UPCAST()and direct -> style upcasting.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[AF: Simplified casts and converted two more DO_UPCAST()s]...
misc/ivshmem: QOM parent field cleanup
Replace direct uses of IVShmemState::dev with QOM casts and rename it toparent_obj.
xen/xen_platform: QOM casting sweep
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[AF: Dropped opaque casts]Signed-off-by: Andreas Färber <afaerber@suse.de>
xen/xen_platform: QOM parent field cleanup
Replace direct uses of PCIXenPlatformState::pci_dev field with QOM castsand rename it to parent_obj.
sysbus: Document SysBusDeviceClass::init and realize semantics
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Syntax and wording changes]Signed-off-by: Andreas Färber <afaerber@suse.de>
ohci: QOM'ify some more
Introduce type constant and avoid DO_UPCAST().
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Avoid remaining OHCIPCIState::pci_dev uses, rename parent fields]Signed-off-by: Andreas Färber <afaerber@suse.de>
ohci: Use QOM realize for OHCI
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
i440fx: Use type-safe cast instead of direct access of parent dev
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Converted remaining accesses and renamed to parent_obj]Signed-off-by: Andreas Färber <afaerber@suse.de>
i440fx-pcihost: Use QOM realize for i440fx-pcihost
q35: Use type-safe cast instead of direct access of parent dev
And remove variables if possible.
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Converted remaining access and renamed to parent_obj]Signed-off-by: Andreas Färber <afaerber@suse.de>
q35: Use QOM realize for q35 host bridge
And split off MemoryRegion initialization into instance_init.
fdc: QOM'ify some more
Introduce type constant and avoid DO_UPCAST(), container_of(),and use DEVICE to avoid accessing parent qdev directly.
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Renamed parent field and avoided repeated SYS_BUS_DEVICE() casts]...
pflash-cfi01: QOM'ify some more
Introduce type constant and replace FROM_SYSBUS().
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Renamed parent field]Signed-off-by: Andreas Färber <afaerber@suse.de>
pflash-cfi02: QOM'ify some more
net/e1000: QOM Upcast Sweep
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
net/e1000: QOM parent field cleanup
Replace direct uses of E1000State::dev field with QOM casts and renameit to parent_obj.
net/rtl8139: QOM Upcast Sweep
net/rtl8139: QOM parent field cleanup
Replace direct uses of RTL8139State::dev with QOM casts and rename it toparent_obj.
net/pcnet-pci: QOM Upcast Sweep
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[AF: Renamed parent field, renamed from PC_NET to PCNET]Signed-off-by: Andreas Färber <afaerber@suse.de>
usb/hcd-xhci: QOM Upcast Sweep
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[AF: Dropped usb_xhci_init() DeviceState argument and renamed variable]...
usb/hcd-xhci: QOM parent field cleanup
Replace direct uses of XHCIState::pci_dev with QOM casts and rename itto parent_obj.
scsi/lsi53c895a: QOM Upcast Sweep
scsi/lsi53c895a: QOM parent field cleanup
Replace direct uses of LSIState::dev with QOM casts and rename it toparent_obj.
scsi/megasas: QOM Upcast Sweep
scsi/megasas: QOM parent field cleanup
Replace direct uses of MegasasState::dev with QOM casts and rename it toparent_obj.
scsi/esp-pci: QOM Upcast Sweep
scsi/esp-pci: QOM parent field cleanup
Replace direct uses of PCIESPState::dev with QOM casts and rename it toparent_obj.
ide/ich: QOM Upcast Sweep
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[AF: Renamed to TYPE_ICH9_AHCI and used typedef in pci_ich9_reset()]...
ide/ich: QOM parent field cleanup
Replace direct uses of AHCIPCIState::card with QOM casts and rename itto parent_obj.
acpi/piix4: QOM Upcast Sweep
acpi/piix4: QOM parent field cleanup
Replace direct uses of PIIX4PMState::dev with QOM casts and rename it toparent_obj.
misc/pci-testdev: QOM Upcast Sweep
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[AF: Replaced another DO_UPCAST()]Signed-off-by: Andreas Färber <afaerber@suse.de>
hw: Avoid use of QOM type name macros in VMStateDescriptions
The name field in a VMStateDescription is part of the migration stateversioning, so changing it will break migration. It's therefore abad idea to use a QOM typename macro to initialize it, because in...
tests: Add test-bitops.c with some sextract tests
Add some simple test cases for the new sextract32and sextract64 functions.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Message-id: 1372419632-5521-3-git-send-email-peter.maydell@linaro.org...
bitops: Provide sextract32() and sextract64()
A common operation in instruction decoding is to take a fieldfrom an instruction that represents a signed integer in somearbitrary number of bits, and sign extend it into a C signedinteger type for manipulation. Provide new functions sextract32()...
memory: Fix zero-sized memory region print
if mr->size == 0, then
int128_get64(int128_sub(mr->size, int128_make64(1))) => assert(!a.hi)
Also, use int128_one().
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>...
configure: Remove ldscripts
Since 964c6fa16f50a607f9da5068d6bf15ccc93872c0, these files are unused.
Signed-off-by: Richard Henderson <rth@twiddle.net>Message-id: 1374449966-12926-1-git-send-email-rth@twiddle.netSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
gtk: Fix accelerator filtering
This is in fact very simply: When the input in grabbed, everythingshould be exclusively passed to the guest - except it has our magicCTRL-ALT modifier set. Then let GTK filter out those accels that are inuse. When checking the modifier state, we just need to filter out NUM...
Merge remote-tracking branch 'pmaydell/tags/pull-arm-devs-20130722' into staging
arm-devs queue
Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging
Merge remote-tracking branch 'mjt/trivial-patches' into staging
Merge remote-tracking branch 'stefanha/block' into staging
Merge remote-tracking branch 'rth/axp-next' into staging
Message-id: 1374161033-11449-1-git-send-email-rth@twiddle.net...
Merge remote-tracking branch 'stefanha/tracing' into staging
hw/arm: Use 'load_ramdisk()' for loading ramdisks w/ U-Boot header
The load_ramdisk function is used to load ramdisk featuring a U-Bootheader.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
hw/loader: Support ramdisk with u-boot header
Introduce 'load_ramdisk()' which can load "normal" ramdisks and ramdiskswith a u-boot header.To enable this and leverage synergies 'load_uimage()' is refactored toaccomodate this additional use case.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>...
virtio: Implement MMIO based virtio transport
Add support for the generic MMIO based virtio transport.
This patch includes some fixes for bugs spotted byYing-Shiuan Pan <yspan@itri.org.tw>.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>...
arm/boot: Allow boards to modify the FDT blob
Add a callback hook in arm_boot_info to allow board models tomodify the device tree blob if they need to. (The major expecteduse case is to add virtio-mmio nodes for virtio-mmio transportsthat exist in QEMU but not in the hardware.)...
vexpress: Make VEDBoardInfo extend arm_boot_info
Make the VEDBoardInfo struct extend arm_boot_info; this willallow us to get at the VEDBoardInfo information inside callbacksfrom arm/boot code.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1373977512-28932-8-git-send-email-peter.maydell@linaro.org
vexpress: Add virtio-mmio transports
Add some virtio-mmio transports to the vexpress board model,together with a modify_dtb hook which adds them to the devicetree so that the kernel will probe for them. We put themin a reserved area of the address map....
device_tree: Add qemu_devtree_setprop_sized_cells() utility functions
We already have a qemu_devtree_setprop_cells() which sets a dtbproperty to an array of cells whose values are specified by varargs.However for the fairly common case of setting a property to a list...
arm/boot: Use qemu_devtree_setprop_sized_cells()
Replace the opencoded assembly of the reg property array for the/memory node with a call to qemu_devtree_setprop_sized_cells().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
virtio: Add support for guest setting of queue size
The MMIO virtio transport spec allows the guest to tell the host howlarge the queue size is. Add virtio_queue_set_num() function whichimplements this in the QEMU common virtio support code.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
virtio: Support transports which can specify the vring alignment
Support virtio transports which can specify the vring alignment(ie where the guest communicates this to the host) by providinga new virtio_queue_set_align() function. (The default alignment...
linux-user: declare sys_futex to have 6 arguments
sys_futex has 6 arguments, and all of these need to be copied. Fix incorrectdeclaration in the mips_syscall_args array.
This change fixes the cases where the 5th and 6th arguments have non-zerovalue and have importance. An example is a Linux implementation of...
slirp: remove mbuf(m_hdr,m_dat) indirection
Fix command example in qemu.sasl
sasldblistusers2 doesn't have a '-a' option
Signed-off-by: Cole Robinson <crobinso@redhat.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
block/m25p80: Update Micron entries
- Split 32Mb and 256Mb parts into a11 and a13 variants.- Add the 4K sector flag to the 128Mb parts. (These entries were taken from the Linux kernel list, which is missing the flag.)- Fill out the table of sizes with entries for 64Mb parts....
doc: monitor multiplexing rewording
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
block/raw: add .bdrv_get_info
Signed-off-by: Peter Lieven <pl@kamp.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: fix bdrv_read_unthrottled()
Signed-off-by: Peter Lieven <pl@kamp.de>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
gluster: Use pkg-config to configure GlusterFS block driver
Use pkg-config to determine the version and library dependencyfor GlusterFS block driver.
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
gluster: Add discard support for GlusterFS block driver.
Implement bdrv_aio_discard for gluster.
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
dataplane: sync virtio.c and vring.c virtqueue state
Load the virtio.c state into vring.c when we start dataplane mode andvice versa when stopping dataplane mode. This patch makes it possibleto start and stop dataplane any time while the guest is running....
QEMUBH: make AioContext's bh re-entrant
BH will be used outside big lock, so introduce lock to protectbetween the writers, ie, bh's adders and deleter. The lock onlyaffects the writers and bh's callback does not take this extra lock.Note that for the same AioContext, aio_bh_poll() can not run in...
block: fix vvfat error path for enable_write_target
s->qcow and s->qcow_filename are allocated but not freed on error. Fix thepossible leaks, remove unnecessary check for bdrv_new(), propagate ret code ofbdrv_create() and also the one of enable_write_target()....
block: add bdrv_write_zeroes()
Signed-off-by: Peter Lieven <pl@kamp.de>Reviewed-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/raw: add bdrv_co_write_zeroes
block-migration: efficiently encode zero blocks
this patch adds a efficient encoding for zero blocks byadding a new flag indicating a block is completely zero.
additionally bdrv_write_zeros() is used at the destinationto efficiently write these zeroes. depending on the implementation...
cpus: Let vm_stop[_force_state]() always flush block devices
Even if the VM is already stopped, we cannot assume that all data hasalready been successfully flushed to disk. The flush during the previousvm_stop() could have failed.
Run bdrv_flush_all() unconditionally so that we get an error each time...
boot-order-test: Better separate target-specific and generic parts
The initial version did just PC. I didn't bother to separate outgeneric parts, because I don't like to abstract from a single case.
Now we have two cases, PC and PowerMac, and I'm about to add more....
boot-order-test: Code motion for better readability
Cc: Andreas Färber <afaerber@suse.de>Cc: Alexander Graf <agraf@suse.de>Cc: qemu-ppc@nongnu.orgSigned-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-9-git-send-email-armbru@redhat.com...
boot-order-test: Add tests for PowerPC PREP
Cc: Andreas Färber <afaerber@suse.de>Cc: Alexander Graf <agraf@suse.de>Cc: qemu-ppc@nongnu.orgSigned-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-10-git-send-email-armbru@redhat.com...
boot-order-test: Add tests for Sun4m
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-11-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
libqos: Generalize I/O-mapped fw_cfg
Provide a constructor that takes the base address in addition to thePC-specific one.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-12-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
boot-order-test: Add tests for Sun4u
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-13-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qtest: Don't reset on qtest chardev connect
libqtest's qtest_init() connecting to the qtest socket triggers reset.This was coded in the hope we could use the same QEMU process formultiple tests that way. Never used. Injects an extra reset evenwhen it's not used, and that can mess up tests such as the one of...
boot-order-test: New; covering just PC for now
Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-3-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
libqos: include dependencies
Otherwise rebuilds can fail when libqos is modified.
Reported-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-4-git-send-email-armbru@redhat.com...
libqos: Add support for memory-mapped fw_cfg
Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-5-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
boot-order-test: Add tests for PowerMacs
They set the boot device via fw_cfg, which is then translated to a bootpath of "hd" or "cd" in OpenBIOS.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Markus Armbruster <armbru@redhat.com>...
boot-order-test: Cover -boot once in ppc tests
Cc: Andreas Färber <afaerber@suse.de>Cc: Alexander Graf <agraf@suse.de>Cc: qemu-ppc@nongnu.orgSigned-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-7-git-send-email-armbru@redhat.com...
libqtest: New qtest_end() to go with qtest_start()
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1371711329-9144-3-git-send-email-armbru@redhat.com...
libqtest: Plug fd and memory leaks in qtest_quit()
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Message-id: 1371711329-9144-2-git-send-email-armbru@redhat.com...
monitor: maintain at most one G_IO_OUT watch
When monitor_flush() is invoked repeatedly outside the monitor_unblocked()callback, for example from tlb_info() -> ... -> print_pte(), severalwatches may be added for the same event.
This is no problem per se because the extra monitor_unblocked() callbacks...
char: io_channel_send: don't lose written bytes
The g_io_channel_write_chars() documentation states,
bytes_written: The number of bytes written. This can be nonzero even if the return value is not G_IO_STATUS_NORMAL. [...]
io_channel_send() could lose such bytes before....
configure: Provide more helpful message if libvte not present
If the system has GTK but not libvte, it's more helpful totell the user that libvte is missing than to simply say thatGTK is not present.
pc-bios: Update palcode-clipper
Update image to c87a92639b28ac42bc8f6c67443543b405dc479b,incorporating changes for vm_time.
Signed-off-by: Richard Henderson <rth@twiddle.net>
target-alpha: Move alarm to vm_clock
Basing the alarm off the rtc_clock was silly. It leads to horriblespinning in the guest after being suspended and resumed, as it triesto catch up with lost ticks.
This requires adding an accessor for reading the vm_clock too....
Merge remote-tracking branch 'awilliam/tags/vfio-for-qemu-1.6' into staging
vfio: enhanced VGA quirks + AER error containment
Merge remote-tracking branch 'luiz/queue/qmp' into staging
Message-id: 1374093679-29213-1-git-send-email-lcapitulino@redhat.com...
Merge remote-tracking branch 'bonzini/scsi-next' into staging
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci,net,pc enhancements
This includes some fixes and enhancements that accumulated in my tree:pci fixes by dkoch, virtio-net enhancements by akong and mst,and a fix for xen pc by mst.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
exec.c: Pass correct pointer type to qemu_ram_ptr_length
Commit e3127ae0 introduced a problem where we're passing ahwaddr* to qemu_ram_ptr_length() but it wants a ram_addr_t*;this will cause problems on 32 bit hosts and in any caseprovokes a clang warning on MacOSX:...
memory: actually set the owner
Brown paper bag for me. Originally commit 803c0816 came before commit2c9b15c. When the order was inverted, I left in the NULL initializationof mr->owner.
Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory: Return -1 again on reads from unsigned regions
This restore the behavior prior to b018ddf633 which accidentally changedthe return code to 0. Specifically guests probing for register existencewere affected by this.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
exec: fix incorrect assumptions in memory_access_size
access_size_min can be 1 because erroneous accesses must not crashQEMU, they should trigger exceptions in the guest or just returngarbage (depending on the CPU). I am not sure I understand thecomment: placing a 4-byte field at the last byte of a region...