summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* util/mmap-alloc: fix hugetlb support on ppc64Michael S. Tsirkin2015-12-023-23/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 8561c9244ddf1122d "exec: allocate PROT_NONE pages on top of RAM", it is no longer possible to back guest RAM with hugepages on ppc64 hosts: mmap(NULL, 285212672, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3fff57000000 mmap(0x3fff57000000, 268435456, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 19, 0) = -1 EBUSY (Device or resource busy) This is because on ppc64, Linux fixes a page size for a virtual address at mmap time, so we can't switch a range of memory from anonymous small pages to hugetlbs with MAP_FIXED. See commit d0f13e3c20b6fb73ccb467bdca97fa7cf5a574cd ("[POWERPC] Introduce address space "slices"") in Linux history for the details. Detect this and create the PROT_NONE mapping using the same fd. Naturally, this makes the guard page bigger with hugetlbfs. Based on patch by Greg Kurz. Acked-by: Rik van Riel <riel@redhat.com> Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Tested-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio-pci: Set the QEMU_PCI_CAP_EXPRESS capability early in its DeviceClass ↵Shmulik Ladkani2015-12-022-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | realize method In 1811e64 'hw/virtio: Add PCIe capability to virtio devices', the QEMU_PCI_CAP_EXPRESS capability was added to virtio's pci_dev, within 'virtio_pci_realize' - the pci device object realization method. This occurs to late, as 'pci_qdev_realize' (DeviceClass.realize of TYPE_PCI_DEVICE) has already been called, without knowing that the device instance is indeed an "express" instance, thus allocating insufficient pci config space. As a result, device may crash upon attempt to write to the PCIE config space. Fix, by arming the QEMU_PCI_CAP_EXPRESS capability early in virtio-pci's own DeviceClass realize method. This also makes code cleaner, as 'virtio_pci_realize' may now access the 'pci_is_express' predicate when needed. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Tested-by: Marcel Apfelbaum <marcel@redhat.com>
* virtio: handle non-virtio-1-capable backend for ccwCornelia Huck2015-12-023-0/+20
| | | | | | | | | | | | | | | | | | | If you run a qemu advertising VERSION_1 with an old kernel where vhost did not yet support VERSION_1, you'll end up with a device that is {modern pci|ccw revision 1} but does not advertise VERSION_1. This is not a sensible configuration and is rejected by the Linux guest drivers. To fix this, add a ->post_plugged() callback invoked after features have been queried that can handle the VERSION_1 bit being withdrawn and change ccw to fall back to revision 0 if VERSION_1 is gone. Note that pci is _not_ fixed; we'll need to rethink the approach for the next release but at least for pci it's not a regression. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* tests/vhost-user-bridge.c: fix fd leakageVictor Kaplansky2015-12-021-5/+29
| | | | | | | | | | | This fixes file descriptor leakage in vhost-user-bridge application. Whenever a new callfd or kickfd is set, the previous one should be explicitly closed. File descriptors used to map guest's memory are closed immediately after mmap call. Signed-off-by: Victor Kaplansky <victork@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* vhost: drop dead codeMichael S. Tsirkin2015-12-021-1/+0
| | | | | | | | | commit 1e7398a1 ("vhost: enable vhost without without MSI-X"_ dropped the implementation of vhost_dev_query, drop it from the header file as well. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
* vhost-user: verify that number of queues is non-zeroVictor Kaplansky2015-12-021-0/+5
| | | | | | | | | | Fix QEMU crash when -netdev type=vhost-user,queues=n is passed with zero number of queues. Signed-off-by: Victor Kaplansky <victork@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
* vhost-user-test: fix crash with glib < 2.36Marc-André Lureau2015-12-021-4/+15
| | | | | | | | | | | The prepare callback needs to be implemented with glib < 2.36, quoting glib documentation: "Since 2.36 this may be NULL, in which case the effect is as if the function always returns FALSE with a timeout of -1." Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* vhost-user-test: use unix port for migrationMarc-André Lureau2015-12-021-1/+7
| | | | | | | | | TCP port 1234 may be used by another process concurrently. Instead use a temporary unix socket. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* vhost-user-test: fix chardriver raceMarc-André Lureau2015-12-021-5/+21
| | | | | | | | | | | | | | | vhost-user-tests uses a helper thread to dispatch the vhost-user servers sources. However the CharDriverState is not thread-safe. Therefore, when it's given to the thread, it shouldn't be manipulated concurrently. We dispatch cleaning the server in an idle source. By the end of the test, we ensure not to leave anything behind by joining the thread and finishing the sources dispatch. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20151201' into stagingPeter Maydell2015-12-021-1/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Last minute fix # gpg: Signature made Tue 01 Dec 2015 22:37:25 GMT using RSA key ID 4DD0279B # gpg: Good signature from "Richard Henderson <rth7680@gmail.com>" # gpg: aka "Richard Henderson <rth@redhat.com>" # gpg: aka "Richard Henderson <rth@twiddle.net>" * remotes/rth/tags/pull-tcg-20151201: tcg: Increase the highwater reservation Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * tcg: Increase the highwater reservationRichard Henderson2015-12-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | If there are a lot of guest memory ops in the TB, the amount of code generated by tcg_out_tb_finalize could be well more than 1k. In the short term, increase the reservation larger than any TB seen in practice. Reported-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Tested-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
* | ui/cocoa.m: Prevent activation clicks from going to guestPeter Maydell2015-12-011-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QEMU is brought to the foreground, the click event that activates QEMU should not go to the guest. Accidents happen when they do go to the guest without giving the user a chance to handle them. In particular, if the guest input device is not an absolute-position one then the location of the guest cursor (and thus the click) will likely not be the location of the host cursor when it is clicked, and could be completely obscured below another window. Don't send mouse clicks to QEMU unless the window either has focus or has grabbed mouse events. Reported-by: John Arbuckle <programmingkidx@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: John Arbuckle <programmingkidx@gmail.com> Message-id: 1448551168-13196-1-git-send-email-peter.maydell@linaro.org
* | Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20151201' into stagingPeter Maydell2015-12-016-9/+37
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Last round of s390x fixes for 2.5: - The bios should be built for the first z machine, so that newer instructions don't creep in. - Silence annoying message when running make check. - Fix a problem with the pci iommu exposed by recent changes. # gpg: Signature made Tue 01 Dec 2015 08:59:42 GMT using RSA key ID C6F02FAF # gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" * remotes/cohuck/tags/s390x-20151201: s390x/pci: fix up IOMMU size s390x: no deprecation warning while testing pc-bios/s390-ccw: rebuild image pc-bios/s390-ccw: build for z900 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | s390x/pci: fix up IOMMU sizeYi Min Zhao2015-12-013-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Present code uses @size==UINT64_MAX to initialize IOMMU. It infers that it can map any 64-bit IOVA whatsoever. But in fact, the largest DMA range for each PCI Device on s390x is from ZPCI_SDMA_ADDR to ZPCI_EDMA_ADDR. The largest value is returned from hardware, which is to indicate the largest range hardware can support. But the real IOMMU size for specific PCI Device is obtained once qemu intercepts mpcifc instruction that guest is requesting a DMA range for that PCI Device. Therefore, before intercepting mpcifc instruction, qemu cannot be aware of the size of IOMMU region that guest will use. Moreover, iommu replay during device initialization for the whole region in 4k steps takes a very long time. In conclusion, this patch intializes IOMMU region for each PCI Device when intercept mpcifc instruction which is to register DMA range for the PCI Device. And then, destroy IOMMU region when guest wants to deregister IOAT. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
| * | s390x: no deprecation warning while testingCornelia Huck2015-12-011-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'make check' tries to start all available machines; the deprecation message for the s390-virtio machine is both useless and annoying there. Silence it while testing. Reported-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
| * | pc-bios/s390-ccw: rebuild imageCornelia Huck2015-12-011-0/+0
| | | | | | | | | | | | | | | | | | | | | Contains: - pc-bios/s390-ccw: build for z900 Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
| * | pc-bios/s390-ccw: build for z900Christian Borntraeger2015-12-011-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Newer distributions have an architecture level set to z9, z196 or similar - also as default option for the compiler. We should build the bios for z900 to allow it to run with all 64bit CPUs. This will become more important as soon as QEMU/KVM does support CPU models. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-By: Sascha Silbe <silbe@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
* | Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into stagingPeter Maydell2015-11-304-78/+25
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two fixes for virtfs/9p from Paolo. # gpg: Signature made Mon 30 Nov 2015 14:10:47 GMT using DSA key ID 0101DBC2 # gpg: Good signature from "Greg Kurz <gkurz@fr.ibm.com>" # gpg: aka "Greg Kurz <groug@free.fr>" # gpg: aka "Greg Kurz <gkurz@linux.vnet.ibm.com>" # gpg: aka "Gregory Kurz (Groug) <groug@free.fr>" # gpg: aka "Gregory Kurz (Cimai Technology) <gkurz@cimai.com>" # gpg: aka "Gregory Kurz (Meiosys Technology) <gkurz@meiosys.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 2BD4 3B44 535E C0A7 9894 DBA2 02FC 3AEB 0101 DBC2 * remotes/gkurz/tags/for-upstream: virtio-9p: use QEMU thread pool fsdev-proxy-helper: avoid TOC/TOU race Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * virtio-9p: use QEMU thread poolPaolo Bonzini2015-11-303-68/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The QEMU thread pool already has a mechanism to invoke callbacks in the main thread. It does not need an EventNotifier and it is more efficient too. Use it instead of GAsyncQueue + GThreadPool + glue. As a side effect, it silences Coverity's complaint about an unchecked return value for event_notifier_init. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com> (removed no more needed #include <glib.h> from virtio-9p-coth.h) Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
| * fsdev-proxy-helper: avoid TOC/TOU racePaolo Bonzini2015-11-301-10/+10
| | | | | | | | | | | | | | | | | | There is a minor time of check/time of use race between statfs and chroot. It can be fixed easily by stat-ing the root after it has been changed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
* | Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.5-20151130' ↵Peter Maydell2015-11-306-79/+41
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging ppc patch queue for qemu-2.5 20151130 target-ppc and related bugfix patches for qemu-2.5 I don't have the facilities to test the Macintosh and BookE related patches. I've sanity checked them (inspection + make check), but I'm otherwise relying on the submitters. # gpg: Signature made Mon 30 Nov 2015 08:42:01 GMT using RSA key ID 20D9B392 # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" # gpg: aka "David Gibson (Red Hat) <dgibson@redhat.com>" # gpg: aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392 * remotes/dgibson/tags/ppc-for-2.5-20151130: target-ppc/fpu_helper: fix FPSCR_FX bit shift operation target-ppc: Move the FPSCR bit update macros to cpu.h hw/ppc/ppc405_boards: Fix infinite recursion by converting taihu_cpld from old_mmio hw/ppc/spapr: Remove duplicated "pseries" alias mac_dbdma: always initialize channel field in DBDMA_channel Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | target-ppc/fpu_helper: fix FPSCR_FX bit shift operationMadhavan Srinivasan2015-11-301-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently in TCG mode, updating floating exception summary bit (FPSCR_FX) in fpscr also updates the upper 32bits of fpscr with all 1s. Modify the bit shift operation statement to use 1ULL instead. Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
| * | target-ppc: Move the FPSCR bit update macros to cpu.hMadhavan Srinivasan2015-11-302-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | Move the FPSCR bit update macros defined in dfp_helper to cpu.h. This way, fpu_helper functions can also use them Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
| * | hw/ppc/ppc405_boards: Fix infinite recursion by converting taihu_cpld from ↵Peter Maydell2015-11-301-44/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | old_mmio The taihu_cpld_writel() function had an obvious typo that meant that if it was ever called it would go into an infinite recursion. Newer versions of clang will detect and warn about this: hw/ppc/ppc405_boards.c:481:1: warning: all paths through this function will call itself [-Winfinite-recursion] Fix this by converting taihu_cpld from the legacy old_mmio accessors to new-style ones, with an impl {} declaration to cause the core memory code to do the splitting of 16 bit and 32 bit accesses into multiple 8-bit accesses. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
| * | hw/ppc/spapr: Remove duplicated "pseries" aliasThomas Huth2015-11-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "pseries" alias is currently set twice, one time for the pseries-2.4 machine and one time for the "pseries-2.5" machine. To avoid confusion with the alias, let's remove the one from the older machine class. And while we're at it, also remove the "is_default = 0" there since the is_default variable should be set to zero by default already. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
| * | mac_dbdma: always initialize channel field in DBDMA_channelHervé Poussineau2015-11-301-1/+1
| |/ | | | | | | | | | | | | | | | | | | dbdma_from_ch() uses channel field to return the right DBDMA object. Previous code was working if guest OS was only using registered DMA channels. However, it lead to QEMU crashes if guest OS was using unregistered DMA channels. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* | Merge remote-tracking branch 'remotes/weil/tags/pull-wxx-20151130' into stagingPeter Maydell2015-11-304-3/+6
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wxx patch queue # gpg: Signature made Mon 30 Nov 2015 05:48:33 GMT using RSA key ID 677450AD # gpg: Good signature from "Stefan Weil <sw@weilnetz.de>" # gpg: aka "Stefan Weil <stefan.weil@weilnetz.de>" # gpg: aka "Stefan Weil <stefan.weil@bib.uni-mannheim.de>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 4923 6FEA 75C9 5D69 8EC2 B78A E08C 21D5 6774 50AD * remotes/weil/tags/pull-wxx-20151130: w32: Use gcc option -mthreads oslib-win32: Change return type of function getpagesize trace/simple: Fix warning and wrong trace file name for MinGW Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * w32: Use gcc option -mthreadsStefan Weil2015-11-301-0/+2
| | | | | | | | | | | | | | QEMU uses threads / coroutines, therefore support for thread local storage and thread safe libraries (-D_MT) must be enabled by using -mthreads. Signed-off-by: Stefan Weil <sw@weilnetz.de>
| * oslib-win32: Change return type of function getpagesizeStefan Weil2015-11-302-2/+2
| | | | | | | | | | | | | | | | | | | | getpagesize on Linux returns an int. Fix QEMU's implementation for Windows to return an int (instead of size_t), too. This fixes a compiler warning which was introduced recently (commit 093e3c42). Signed-off-by: Stefan Weil <sw@weilnetz.de>
| * trace/simple: Fix warning and wrong trace file name for MinGWStefan Weil2015-11-301-1/+2
|/ | | | | | | | | | | | | | | On Windows, getpid() always returns an int value, but pid_t (which is expected by the format string) is either a 32 bit or a 64 bit value. Without a type cast (or a modified format string), the compiler prints a warning when building for 64 bit Windows and the resulting trace_file_name will include a wrong pid: trace/simple.c:332:9: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘int’ [-Wformat=] Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into ↵Peter Maydell2015-11-272-11/+54
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging # gpg: Signature made Fri 27 Nov 2015 02:42:02 GMT using RSA key ID 398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * remotes/jasowang/tags/net-pull-request: tap-win32: disable broken async write path tap-win32: skip unexpected nodes during registry enumeration eepro100: Prevent two endless loops Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * tap-win32: disable broken async write pathAndrew Baumann2015-11-271-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code under the TUN_ASYNCHRONOUS_WRITES path makes two incorrect assumptions about the behaviour of the WriteFile API for overlapped file handles. First, WriteFile does not update the lpNumberOfBytesWritten parameter when the write completes asynchronously (the number of bytes written is known only when the operation completes). Second, the buffer shouldn't be touched (or freed) until the operation completes. This led to at least one bug where tap_win32_write returned zero bytes written, which in turn caused further writes ("receives") to be disabled for that device. This change disables the asynchronous write path, while keeping most of the code around in case someone sees value in resurrecting it. It also adds some conditional debug output, similar to the read path. Signed-off-by: Andrew Baumann <Andrew.Baumann@microsoft.com> Acked-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jason Wang <jasowang@redhat.com>
| * tap-win32: skip unexpected nodes during registry enumerationAndrew Baumann2015-11-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to find a named tap device, get_device_guid() enumerates children of HKLM\SYSTEM\CCS\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318} (aka NETWORK_CONNECTIONS_KEY). For each child, it then looks for a "Connection" subkey, but if this key doesn't exist, it aborts the entire search. This was observed to fail on at least one Windows 10 machine, where there is an additional child of NETWORK_CONNECTIONS_KEY (named "Descriptions"). Since registry enumeration doesn't guarantee any particular sort order, we should continue to search for matching children rather than aborting the search. Signed-off-by: Andrew Baumann <Andrew.Baumann@microsoft.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jason Wang <jasowang@redhat.com>
| * eepro100: Prevent two endless loopsStefan Weil2015-11-271-0/+16
|/ | | | | | | | | | | | | http://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg04592.html shows an example how an endless loop in function action_command can be achieved. During my code review, I noticed a 2nd case which can result in an endless loop. Reported-by: Qinghao Tang <luodalongde@gmail.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jason Wang <jasowang@redhat.com>
* Update version for v2.5.0-rc2 releasePeter Maydell2015-11-261-1/+1
| | | | Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell2015-11-2612-41/+155
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vhost, pc: fixes for 2.5 Minor vhost fixes. HW version tweak for PC. Documentation and test updates. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 26 Nov 2015 16:40:25 GMT using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: vhost-user-test: fix migration overlap test Fix memory leak on error Revert "vhost: send SET_VRING_ENABLE at start/stop" tests/vhost-user-bridge: read command line arguments tests/vhost-user-bridge: propose GUEST_ANNOUNCE feature vhost-user: clarify start and enable vhost-user: set link down when the char device is closed pc: Don't set hw_version on pc-*-2.5 osdep: Change default value of qemu_hw_version() to "2.5+" Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * vhost-user-test: fix migration overlap testMichael S. Tsirkin2015-11-261-5/+8
| | | | | | | | | | | | | | | | During migration, source does GET_BASE, destination does SET_BASE. Use that as opposed to fds being configured to detect vhost user running on both source and destination. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * Fix memory leak on errorStefano Dong (董兴水)2015-11-262-0/+2
| | | | | | | | | | | | | | | | | | hw/ppc/spapr.c: Fix memory leak on error, it was introduced in bc09e0611 hw/acpi/memory_hotplug.c: Fix memory leak on error, it was introduced in 34f2af3d Signed-off-by: Stefano Dong (董兴水) <opensource.dxs@aliyun.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * Revert "vhost: send SET_VRING_ENABLE at start/stop"Michael S. Tsirkin2015-11-261-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3a12f32229a046f4d4ab0a3a52fb01d2d5a1ab76. In case of live migration several queues can be enabled and not only the first one. So informing backend that only the first queue is enabled is wrong. Reported-by: Thibaut Collet <thibaut.collet@6wind.com> Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
| * tests/vhost-user-bridge: read command line argumentsVictor Kaplansky2015-11-251-18/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now some vhost-user-bridge parameters can be passed from the command line: Usage: prog [-u ud_socket_path] [-l lhost:lport] [-r rhost:rport] -u path to unix doman socket. default: /tmp/vubr.sock -l local host and port. default: 127.0.0.1:4444 -r remote host and port. default: 127.0.0.1:5555 Signed-off-by: Victor Kaplansky <victork@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * tests/vhost-user-bridge: propose GUEST_ANNOUNCE featureVictor Kaplansky2015-11-251-0/+1
| | | | | | | | | | | | | | | | | | | | The backend has to know whether VIRTIO_NET_F_GUEST_ANNOUNCE was negotiated, so, as a hack we propose the feature by vhost-user-bridge during the feature negotiation. Signed-off-by: Victor Kaplansky <victork@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost-user: clarify start and enableMichael S. Tsirkin2015-11-251-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems that we currently have some duplication between started and enabled states. The actual reason is that enable is not documented correctly: what it does is connecting ring to the backend. This is important for MQ, because a Linux guest expects TX packets to be completed even if it disables some queues temporarily. Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com> Cc: Victor Kaplansky <victork@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost-user: set link down when the char device is closedWen Congyang2015-11-251-1/+1
| | | | | | | | | | | | | | Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
| * pc: Don't set hw_version on pc-*-2.5Eduardo Habkost2015-11-252-2/+0
| | | | | | | | | | | | | | | | | | | | | | Now that qemu_hw_version() returns a fixed "2.5+" string instead of QEMU_VERSION, we don't need to set hw_version on pc-*-2.5 explicitly. Suggested-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * osdep: Change default value of qemu_hw_version() to "2.5+"Eduardo Habkost2015-11-253-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two issues with qemu_hw_version() today: 1) If a machine has hw_version set, the value returned by it is not very useful, because it is not the actual QEMU version. 2) If a machine does't set hw_version, the return value of qemu_hw_version() is broken, because it will change when upgrading QEMU. For those reasons, using qemu_hw_version() is strongly discouraged, and should be used only in code that used QEMU_VERSION in the past and needs to keep compatibility. To fix (2), instead of making every machine broken by default unless they set hw_version, make qemu_hw_version() simply return "2.5+" if qemu_set_hw_version() is not called. Suggested-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-11-26' ↵Peter Maydell2015-11-2611-314/+225
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging QMP and QObject patches # gpg: Signature made Thu 26 Nov 2015 09:07:18 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-monitor-2015-11-26: qjson: Limit number of tokens in addition to total size qjson: surprise, allocating 6 QObjects per token is expensive qjson: store tokens in a GQueue qjson: Convert to parser to recursive descent qjson: replace QString in JSONLexer with GString qjson: Inline token_is_escape() and simplify qjson: Inline token_is_keyword() and simplify qjson: Give each of the six structural chars its own token type qjson: Spell out some silent assumptions check-qjson: Add test for JSON nesting depth limit qjson: Don't crash when input exceeds nesting limit qjson: Apply nesting limit more sanely monitor: Plug memory leak on QMP error Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | qjson: Limit number of tokens in addition to total sizeMarkus Armbruster2015-11-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 29c75dd "json-streamer: limit the maximum recursion depth and maximum token count" attempts to guard against excessive heap usage by limiting total token size (it says "token count", but that's a lie). Total token size is a rather imprecise predictor of heap usage: many small tokens use more space than few large tokens with the same input size, because there's a constant per-token overhead: 37 bytes on my system. Tighten this up: limit the token count to 2Mi. Chosen to roughly match the 64MiB total token size limit. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1448486613-17634-13-git-send-email-armbru@redhat.com>
| * | qjson: surprise, allocating 6 QObjects per token is expensivePaolo Bonzini2015-11-263-78/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the contents of the tokens GQueue with a simple struct. This cuts the amount of memory allocated by tests/check-qjson from ~500MB to ~20MB, and the execution time from 600ms to 80ms on my laptop. Still a lot (some could be saved by using an intrusive list, such as QSIMPLEQ, instead of the GQueue), but the savings are already massive and the right thing to do would probably be to get rid of json-streamer completely. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1448300659-23559-5-git-send-email-pbonzini@redhat.com> [Straightforwardly rebased on my patches] Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
| * | qjson: store tokens in a GQueuePaolo Bonzini2015-11-268-65/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though we still have the "streamer" concept, the tokens can now be deleted as they are read. While doing so convert from QList to GQueue, since the next step will make tokens not a QObject and we will have to do the conversion anyway. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1448300659-23559-4-git-send-email-pbonzini@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
| * | qjson: Convert to parser to recursive descentMarkus Armbruster2015-11-261-118/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We backtrack in parse_value(), even though JSON is LL(1) and thus can be parsed by straightforward recursive descent. Do exactly that. Based on an almost-correct patch from Paolo Bonzini. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1448486613-17634-10-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
OpenPOWER on IntegriCloud