qemu-char: Rename qemu_chr_generic_open to qemu_chr_be_generic_open
To better reflect that it is for handling a backend being opened.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-3-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Add fe_open tracking
Add tracking of the fe_open state to struct CharDriverState.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-4-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
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: Consolidate guest_close/guest_open into a set_fe_open callback
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-7-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.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>
compiler: fix warning with GCC 4.8.0
GCC 4.8.0 introduces a new warning:
block/qcow2-snapshot.c: In function 'qcow2_write_snapshots’: block/qcow2-snapshot.c:252:18: error: typedef 'qemu_build_bug_on__253' locally defined but not used [-Werror=unused-local-typedefs]...
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>...
roms: switch oldnoconfig to olddefconfig
When a new option is added that qemu does not knowabout, the prudent thing is to use the default notforce it to "no".
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: Teach PCI Bridges about VGA routing
Each PCI Bridge has a set of implied VGA regions that are enabled whenthe VGA bit is set in the bridge control register. This allows VGAdevices behind bridges. Unfortunately with VGA Enable, which weformerly allowed but didn't back, comes along some required VGA...
pci_bridge: factor out common code
Reuse common code in pcie_port, override the hardwired-to-0bits per PCI Express spec.No functional change but makes the code easier to follow.
pci_bridge: drop formatting from source
We use the same formatting for all files, itdoesn't make sense to have formatting directives onlyin pci bridge header.
pci: Fix INTx routing notifier recursion
For some reason we recurse to fire the INTx routing notifier for eachchild of a bus, for each possible device of a bus. That means that ifwe add a root port, the notifier gets called for that bridge 256times. If we add an upstream switch behind that root port, 256^2. But...
pci_bridge: Use a default map_irq function
The PCI bridge spec defines a default swizzle for translating INTxIRQs from secondary bus to primary. Use this by default for anybridge that doesn't set a function.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>...
pci_bridge: Remove duplicate IRQ swizzle function
pci_bridge_dev_map_irq_fn() is identical to pci_swizzle_map_irq_fn(),which is now the default for all PCI bridges. We can therefore removethis function and the pci_bridge_map_irq() call that used it.
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...
exec: assert that RAMBlock size is non-zero
find_ram_offset() does not handle size=0 gracefully. It hands out thesame RAMBlock offset multiple times, leading to obscure failures lateron.
Add an assert to warn early if something is incorrectly allocating a...
qmp: add path to device_deleted event
Add QOM path to device deleted event. It now becomes useful to reportit for devices which don't have an ID assigned.
virtio-net: remove layout assumptions for mq ctrl
Following commit 921ac5d0f3a0df869db5ce4edf752f51d8b1596a (virtio-net:remove layout assumptions for ctrl vq), this patch makes multiqueue ctrlhandling not rely on the layout of descriptors.
Signed-off-by: Jason Wang <jasowang@redhat.com>...
virtio-pci: guest notifier mask without non-irqfd
non-irqfd setups are currently broken with vhost:we start up masked and nothing unmasks the interrupts.Fix by using mask notifiers, same as the irqfd path.
Sharing irqchip/non irqchip code is always a good thing,...
pci: Add PCI VGA helpers
Allow devices to register VGA memory regions for handling PCI specdefined VGA I/O port and MMIO areas. PCI will attach these to thebus address spaces and enable them according to the device commandregister value.
qom: call class destructor before unparent
It seems more logical to have destruction flow start with the subclassand move up to the base class. This ensures object has a validcanonical path when destructor is called.
Merge remote-tracking branch 'quintela/migration.next' into staging
Merge remote-tracking branch 'cohuck/virtio-ccw-upstr' into staging
virtio-ccw: Queue sanity check for notify hypercall.
Verify that the virtio-ccw notify hypercall passed a reasonablevalue for queue.
Cc: qemu-stable@nongnu.orgReported-by: Alexander Graf <agraf@suse.de>Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
qtest: use synchronous I/O for char device
Peter reported that rtc-test would periodically hang. It turns outthis was due to an EAGAIN occurring on qemu_chr_fe_write.
Instead of heavily refactoring qtest, just use a synchronous versionof the write operation for qemu_chr_fe_write to address this problem....
char: introduce a blocking version of qemu_chr_fe_write
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: Detect attempts to add a property that already exists
Detect attempts to add a property to an object if one ofthat name already exists, and report them as errors.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
hw/qdev: Abort rather than ignoring errors adding device properties
Instead of ignoring any errors that occur when adding propertiesto a new device in device_initfn(), check for them and abort if anyoccur. The most likely cause is accidentally adding a duplicate...
hw/qdev-properties.c: Improve diagnostic for setting property after realize
Now we have error_setg() we can improve the error message emitted ifyou attempt to set a property of a device after the device is realized(the previous message was "permission denied" which was not very...
virtio-scsi: add the virtio-scsi device.
Create virtio-scsi 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-scsi-pci: switch to new API.
Here the virtio-scsi-pci is modified for the new API. The device virtio-scsi-pciextends virtio-pci. It creates and connects a virtio-scsi during the init.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>...
virtio-scsi-s390: switch to the new API.
Here the virtio-scsi-s390 is modified for the new API. The devicevirtio-scsi-s390 extends virtio-s390-device as before. It creates andconnects a virtio-scsi during the init. The properties are not modified.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>...
virtio-scsi-ccw: switch to new API
Here the virtio-scsi-ccw is modified for the new API. The devicevirtio-scsi-ccw extends virtio-ccw-device as before. It creates andconnects a virtio-scsi during the init. The properties are not modified.
virtio-scsi: cleanup: use QOM casts.
As the virtio-scsi-pci and virtio-scsi-s390 are switched to the new API,we can use QOM casts.
virtio-scsi: cleanup: init and exit functions.
This remove old init and exit function as they are no longer needed.
virtio-scsi: cleanup: remove qdev field.
The qdev field is no longer needed. Just drop it.
virtio-scsi: moving host_features from properties to transport properties.
host_features field is part of the transport device. So move all thehost_features related properties into transport device.
virtio-scsi: don't use pointer for configuration.
The configuration field must not be a pointer as it will be used for virtio-scsiproperties. So *conf is replaced by conf.
virtio-scsi: allocate cmd_vqs array separately.
Allocate/Free the cmd_vqs array separately to have a fixed size device.
Merge remote-tracking branch 'luiz/queue/qmp' into staging
migration: do not sent zero pages in bulk stage
during bulk stage of ram migration if a page is azero page do not send it at all.the memory at the destination reads as zero anyway.
even if there is an madvise with QEMU_MADV_DONTNEEDat the target upon receipt of a zero page I have observed...
migration: do not search dirty pages in bulk stage
avoid searching for dirty pages just increment thepage offset. all pages are dirty anyway.
Signed-off-by: Peter Lieven <pl@kamp.de>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>...
migration: use XBZRLE only after bulk stage
at the beginning of migration all pages are marked dirty andin the first round a bulk migration of all pages is performed.
currently all these pages are copied to the page cache regardlessof whether they are frequently updated or not. this doesn't make sense...
Add QemuFileWritevBuffer QemuFileOps
This will allow us to write an iovec
Signed-off-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
Add socket_writev_buffer function
Signed-off-by: Orit Wasserman <owasserm@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
Update bytes_xfer in qemu_put_byte
Store the data to send also in iovec
All data is still copied into the static buffer.Adjacent iovecs are coalesced so we send one big bufferinstead of many small buffers.
Use writev ops if available
Update qemu_fflush and stdio_close to use writev ops if they are availableUse the buffers stored in the iovec.
Add qemu_put_buffer_async
This allows us to add a buffer to the iovec to send without copying itinto the static buffer, the buffer will be sent later when qemu_fflush is called.
Use qemu_put_buffer_async for guest memory pages
This will remove an unneeded copy of guest memory pages.For the page header and device state we still copy the data to thestatic buffer the other option is to allocate the memory on demandwhich is more expensive....
buffer_is_zero: use vector optimizations if possible
performance gain on SSE2 is approx. 20-25%. altivecis not tested. performance for unsigned long arithmeticis unchanged.
Signed-off-by: Peter Lieven <pl@kamp.de>Reviewed-by: Eric Blake <eblake@redhat.com>...
bitops: unroll while loop in find_next_bit()
this patch adopts the loop unrolling idea of bitmap_is_zero() tospeed up the skipping of large areas with zeros in find_next_bit().
this routine is extensively used to find dirty pages inlive migration.
testing only the find_next_bit performance on a zeroed bitfield...
migration: search for zero instead of dup pages
virtually all dup pages are zero pages. removethe special is_dup_page() function and use theoptimized buffer_find_nonzero_offset() functioninstead.
here buffer_find_nonzero_offset() is used directlyto avoid the unnecssary additional checks in...
migration: add an indicator for bulk state of ram migration
the first round of ram transfer is special since all pagesare dirty and thus all memory pages are transferred tothe target. this patch adds a boolean variable to trackthis stage.
Signed-off-by: Peter Lieven <pl@kamp.de>...
cutils: add a function to find non-zero content in a buffer
this adds buffer_find_nonzero_offset() which is a SSE2/Altivecoptimized function that searches for non-zero content in abuffer.
the function starts full unrolling only after the first few chunks have...
savevm: Add VMSTATE_UINTTL_EQUAL helper
This adds an _EQUAL VMSTATE helper for target_ulongs, defined in terms ofVMSTATE_UINT32_EQUAL or VMSTATE_UINT64_EQUAL as appropriate.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>Signed-off-by: Juan Quintela <quintela@redhat.com>
savevm: Add VMSTATE_FLOAT64 helpers
The current savevm code includes VMSTATE helpers for a number of commonlyused data types, but not for the float64 type used by the internal floatingpoint emulation code. This patch fixes the deficiency.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
savevm: Add VMSTATE_STRUCT_VARRAY_POINTER_UINT32
Currently the savevm code contains a VMSTATE_STRUCT_VARRAY_POINTER_INT32helper (a variably sized array with the number of elements in an int32_t),but not VMSTATE_STRUCT_VARRAY_POINTER_UINT32 (... with the number of...
savevm: Fix bugs in the VMSTATE_VBUFFER_MULTIPLY definition
The VMSTATE_BUFFER_MULTIPLY macro is misnamed - it actually specifiesa variably sized buffer with VMS_VBUFFER, so should be namedVMSTATE_VBUFFER_MULTIPLY. This patch fixes this (the macro had no current...
move vector definitions to qemu-common.h
vector optimizations will now be used at various placesnot just in is_dup_page() in arch_init.c
Signed-off-by: Peter Lieven <pl@kamp.de>Signed-off-by: Juan Quintela <quintela@redhat.com>
savevm: Add VMSTATE_UINT64_EQUAL helpers
The savevm code already includes a number of *_EQUAL helpers which act assanity checks verifying that the configuration of the saved state matchesthat of the machine we're loading into to work. Variants already exist...
migration: Improve QMP documentation
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
QMP: Remove duplicate TPM type from query-tpm
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
QMP: TPM QMP and man page documentation updates
qmp: fix handling of boolean values in qmp-shell
qmp-shell converts only integer arguments and the restis assumed to be strings which are faithfully sent asquoted strings by json. But QEMU refuses to accept qmpcommand with boolean argument whose value is escaped...
New QMP command query-cpu-max and HMP command cpu_max
These commands return the maximum number of CPUs supported by thecurrently running emulator instance, as defined in its QEMUMachinestruct.
Signed-off-by: Michal Novotny <minovotn@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Merge remote-tracking branch 'stefanha/net' into staging
Merge remote-tracking branch 'stefanha/block' into staging
Merge remote-tracking branch 'kraxel/ipxe.3' into staging
gtk: Release modifier when graphic console loses keyboard focus
This solves, e.g., sticky ALT when selecting a GTK menu, switching to adifferent window or selecting a different virtual console.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Message-id: 514F417A.6010908@web.de...
glib: add a compatibility interface for g_timeout_add_seconds
net: increase buffer size to accommodate Jumbo frame pkts
Socket buffer sizes were hard-coded to 4K for VDE and socket netdevs. Bump thisup to 68K (ala tap netdev) to handle maximum GSO packet size (64k) plus plentyof room for the ethernet and virtio_net headers....
net: iovec checksum calculator
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>Signed-off-by: Yan Vugenfirer <yan@daynix.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Common definitions for VMWARE devices
Packet abstraction for VMWARE network devices
VMXNET3 device implementation
net: use socket_set_nodelay() for -netdev socket
Reduce -netdev socket latency by disabling the Nagle algorithm onSOCK_STREAM sockets in net/socket.c. Since we are tunelling Ethernetover TCP we shouldn't artificially delay outgoing packets, let the guest...
Checksum-related utility functions
net_checksum_add_cont()checksum calculation for scattered data with odd chunk sizes
net_raw_checksum()checksum calculation for a buffer
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>Signed-off-by: Yan Vugenfirer <yan@daynix.com>...
block: Add options QDict to bdrv_file_open() prototypes (fix MinGW build)
The new parameter is unused yet.
This part was missing in commit 787e4a8500020695eb391e2f1cc4767ee071d441.
Cc: Kevin Wolf <kwolf@redhat.com>Cc: Eric Blake <eblake@redhat.com>Signed-off-by: Stefan Weil <sw@weilnetz.de>...
rbd: fix compile error
Commit 787e4a85 [block: Add options QDict to bdrv_file_open() prototypes] didn'tupdate rbd.c accordingly.
Cc: Kevin Wolf <kwolf@redhat.com>Cc: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Liu Yuan <tailai.ly@taobao.com>Reviewed-by: Stefan Weil <sw@weilnetz.de>...
ipxe: update binaries
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ipxe: disable two second timeout
Remove device_tree.o from hw/moxie/Makefile.objs.
Here's a fix for the build problem identified by Aurelien Jarno here:http://lists.gnu.org/archive/html/qemu-devel/2013-03/msg04177.html
Signed-off-by: Anthony Green <green@moxielogic.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg-optimize: Fold sub r,0,x to neg r,x
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-i386: Don't modify env->eflags around cpu_dump_state
We can compute the value in cpu_dump_state anyway, and gratuitousmodifications to eflags creates heisenbugs.
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Richard Henderson <rth@twiddle.net>...
target-i386: Fix flags computation for ADOX
When starting from CC_OP_DYNAMIC, and issuing adox before adcx,a typo used the wrong value for the resulting CC_OP.
Cc: Blue Swirl <blauwirbel@gmail.com>Reported-by: Torbjorn Granlund <tg@gmplib.org>Signed-off-by: Richard Henderson <rth@twiddle.net>...
Add top level changes for moxie
Signed-off-by: Anthony Green <green@moxielogic.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add moxie target code
Add moxie disassembler
Add sample moxie system
Merge branch 'for-upstream' of git://github.com/mwalle/qemu