aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2013-11-25Update version for v1.7.0-rc2 releaseHEADmasterAnthony Liguori1-1/+1
2013-11-25curses: fixup SIGWINCH handler messGerd Hoffmann1-16/+28
Don't run code in the signal handler, only set a flag. Use sigaction(2) to avoid non-portable signal(2) semantics. Make #ifdefs less messy. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-id: 1385130903-20531-1-git-send-email-kraxel@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25qga: Fix two format strings for MinGWStefan Weil1-2/+2
Both code locations cause a compiler warning. Using "%s" instead of "%lu" would result in a program crash if the wrong code were executed. Signed-off-by: Stefan Weil <sw@weilnetz.de> Message-id: 1385409257-2522-1-git-send-email-sw@weilnetz.de Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25PPC: BookE: Make FIT/WDT timers at best millisecond grainedAlexander Graf1-0/+6
The default granularity for the FIT timer on 440 is on every 0x1000th transition of TB from 0 to 1. Translated that means 48828 times a second. Since interrupts are quite expensive for 440 and we don't really care about the accuracy of the FIT to that significance, let's force FIT and WDT to at best millisecond granularity. This basically restores behavior as it was in QEMU 1.6, where timers could only deal with millisecond granularities at all. This patch greatly improves performance with the 440 target and restores roughly the same performance level that QEMU 1.6 had for me. Signed-off-by: Alexander Graf <agraf@suse.de> Message-id: 1385416015-22775-3-git-send-email-agraf@suse.de Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25PPC: Make BookE FIT/WDT timers more lazyAlexander Graf1-5/+38
Today we fire FIT and WDT timer events every time the respective bit position in TB flips from 0 -> 1. However, there is no need to do this if the end result would be that we're changing a TSR bit that is set to 1 to 1 again. No guest visible change would have occured. So whenever we see that the TSR bit to our timer is already set, don't even bother to update the timer that would potentially fire it off. However, we do need to make sure that we update our timer that notifies us of the TB flip when the respective TSR bit gets unset. In that case we do care about the flip and need to notify the guest again. So add a callback into our timer handlers when TSR bits get unset. This improves performance for me when the guest is busy processing things. Signed-off-by: Alexander Graf <agraf@suse.de> Message-id: 1385416015-22775-2-git-send-email-agraf@suse.de Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25acpi-build: fix support for glib < 2.22Michael S. Tsirkin1-4/+2
glib < 2.22 does not have g_array_get_element_size, limit it's use (to check all elements are 1 byte in size) to newer glib. This fixes build on RHEL 5.3. Reported-by: Richard Henderson <rth@redhat.com> Reported-by: Erik Rull <erik.rull@rdsoftware.de> Tested-by: Richard Henderson <rth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 20131125220039.GA16386@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori4-4/+15
pc very last minute fixes for 1.7 This has a fix for a crasher bug with pci bridges, boot failure fix for s390 on 32 bit hosts, and fixes build for hosts with old glib. There's also a fix for --iasl configure flag - it can be used to work around broken iasl on some systems either by using a non-standard iasl or by disabling it. I've also reverted a e1000/rtl mac programming change that seems slightly wrong and too risky for 1.8. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 25 Nov 2013 03:40:07 AM PST using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Michael S. Tsirkin (5) and Bandan Das (1) # Via Michael S. Tsirkin * mst/tags/for_anthony: configure: make --iasl option actually work Revert "e1000/rtl8139: update HMP NIC when every bit is written" acpi-build: fix build on glib < 2.14 acpi-build: fix build on glib < 2.22 pci: unregister vmstate_pcibus on unplug s390x: fix flat file load on 32 bit systems Message-id: 1385379990-32093-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25Merge remote-tracking branch 'bonzini/tags/for-anthony' into stagingAnthony Liguori13-36/+60
Here are a bunch of 1.7-tagged patches that I was afraid were getting forgotten or that did not have a clear maintainer responsible for making a pull request. # gpg: Signature made Thu 21 Nov 2013 08:40:59 AM PST using RSA key ID 9B4D86F2 # gpg: Can't check signature: public key not found # By Peter Maydell (3) and others # Via Paolo Bonzini * bonzini/tags/for-anthony: qga: Fix compiler warnings (missing format attribute, wrong format strings) mips jazz: do not raise data bus exception when accessing invalid addresses target-i386: yield to another VCPU on PAUSE rng-egd: offset the point when repeatedly read from the buffer rng-egd: remove redundant free target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid() vfio-pci: Fix multifunction=on atomic.h: Fix build with clang pc: get rid of builtin pvpanic for "-M pc-1.5" configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0 sun4m: Add FCode ROM for TCX framebuffer Message-id: 1385052578-32352-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25Merge remote-tracking branch 'mdroth/qga-pull-2013-11-22' into stagingAnthony Liguori1-6/+10
# By Tomoki Sekiyama # Via Michael Roth * mdroth/qga-pull-2013-11-22: qemu-ga: vss-win32: Install VSS provider COM+ application service Message-id: 1385154505-15145-1-git-send-email-mdroth@linux.vnet.ibm.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25Merge remote-tracking branch 'stefanha/net' into stagingAnthony Liguori1-0/+9
# By Vlad Yasevich # Via Stefan Hajnoczi * stefanha/net: qdev-properties-system.c: Allow vlan or netdev for -device, not both Message-id: 1385118544-28482-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-24configure: make --iasl option actually workMichael S. Tsirkin1-2/+2
--iasl option was added to CC option parsing section by mistake, it's not effective there and attempts to use cause an 'unknown option' error. Fix this up. Tested-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-22qemu-ga: vss-win32: Install VSS provider COM+ application serviceTomoki Sekiyama1-6/+10
Currently, qemu-ga for Windows fails to execute guset-fsfreeze-freeze when no user is logging in to Windows, with an error message: {"error":{"class":"GenericError", "desc":"failed to add C:\\ to snapshotset: (error: 8004230f)"}} To enable guest-fsfreeze-freeze/thaw without logging in users, this installs a service to execute qemu-ga VSS provider COM+ application that has full access privileges to the local system. The service will automatically be removed when the COM+ application is deregistered. This patch replaces ICOMAdminCatalog interface with ICOMAdminCatalog2 interface that contains CreateServiceForApplication() method in addition. Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com> Reviewed-by: Gal Hammer <ghammer@redhat.com> Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com> Tested-by: Yan Vugenfirer <yvugenfi@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-11-22qdev-properties-system.c: Allow vlan or netdev for -device, not bothVlad Yasevich1-0/+9
It is currently possible to specify things like: -device e1000,netdev=foo,vlan=1 With this usage, whichever argument was specified last (vlan or netdev) overwrites what was previousely set and results in a non-working configuration. Even worse, when used with multiqueue devices, it causes a segmentation fault on exit in qemu_free_net_client. That patch treates the above command line options as invalid and generates an error at start-up. Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-21qga: Fix compiler warnings (missing format attribute, wrong format strings)Stefan Weil2-5/+5
gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra): CC qga/commands.o qga/commands.c: In function ‘slog’: qga/commands.c:28:5: error: function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] g_logv("syslog", G_LOG_LEVEL_INFO, fmt, ap); ^ gcc 4.8.2 reports this warning when slog is declared with the gnu_printf format attribute: qga/commands-posix.c: In function ‘qmp_guest_file_open’: qga/commands-posix.c:404:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int64_t’ [-Wformat=] slog("guest-file-open, handle: %d", handle); ^ On 32 bit hosts there are three more warnings which are also fixed here. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21mips jazz: do not raise data bus exception when accessing invalid addressesHervé Poussineau1-0/+24
MIPS Jazz chipset doesn't seem to raise data bus exceptions on invalid accesses. However, there is no easy way to prevent them. Creating a big memory region for the whole address space doesn't prevent memory core to directly call unassigned_mem_read/write which in turn call cpu->do_unassigned_access, which (for MIPS CPU) raise an data bus exception. This fixes a MIPS Jazz regression introduced in c658b94f6e8c206c59d02aa6fbac285b86b53d2c. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21target-i386: yield to another VCPU on PAUSEPaolo Bonzini3-3/+25
After commit b1bbfe7 (aio / timers: On timer modification, qemu_notify or aio_notify, 2013-08-21) FreeBSD guests report a huge slowdown. The problem shows up as soon as FreeBSD turns out its periodic (~1 ms) tick, but the timers are only the trigger for a pre-existing problem. Before the offending patch, setting a timer did a timer_settime system call. After, setting the timer exits the event loop (which uses poll) and reenters it with a new deadline. This does not cause any slowdown; the difference is between one system call (timer_settime and a signal delivery (SIGALRM) before the patch, and two system calls afterwards (write to a pipe or eventfd + calling poll again when re-entering the event loop). Unfortunately, the exit/enter causes the main loop to grab the iothread lock, which in turns kicks the VCPU thread out of execution. This causes TCG to execute the next VCPU in its round-robin scheduling of VCPUS. When the second VCPU is mostly unused, FreeBSD runs a "pause" instruction in its idle loop which only burns cycles without any progress. As soon as the timer tick expires, the first VCPU runs the interrupt handler but very soon it sets it again---and QEMU then goes back doing nothing in the second VCPU. The fix is to make the pause instruction do "cpu_loop_exit". Reported-by: Luigi Rizzo <rizzo@iet.unipi.it> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21rng-egd: offset the point when repeatedly read from the bufferAmos Kong1-1/+3
The buffer content might be read out more than once, currently we just repeatedly read the first data block, buffer offset is missing. Cc: qemu-stable@nongnu.org Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21rng-egd: remove redundant freeAmos Kong1-1/+0
We didn't set default chr_name, the free is redundant. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()Peter Maydell1-0/+12
Fix build failures with clang when KVM is not enabled by providing a stub version of kvm_arch_get_supported_cpuid(). We retain the compile time check that this function isn't called when CONFIG_KVM is not set by guarding the stub with ifndef __OPTIMIZE__ (we assume that an optimizing build will do sufficient constant folding and dead code elimination to remove the calls before linking). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21vfio-pci: Fix multifunction=onAlex Williamson1-0/+7
When an assigned device is initialized it copies the device config space into the emulated config space. Unfortunately multifunction is setup prior to the device initfn and gets clobbered. We need to restore it just like pci-assign does. Cc: qemu-stable@nongnu.org Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21atomic.h: Fix build with clangPeter Maydell1-3/+3
clang defines __ATOMIC_SEQ_CST but its implementation of the __atomic_exchange() builtin differs from that of gcc. Move the __clang__ branch of the ifdef ladder to the top and fix its implementation (there is no such builtin as __sync_exchange), so we can compile with clang again. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21pc: get rid of builtin pvpanic for "-M pc-1.5"Paolo Bonzini4-20/+0
This causes two slight backwards-incompatibilities between "-M pc-1.5" and 1.5's "-M pc": (1) a fw_cfg file is removed with this patch. This is only a problem if migration stops the virtual machine exactly during fw_cfg enumeration. (2) after migration, a VM created without an explicit "-device pvpanic" will stop reporting panics to management. The first problem only occurs if migration is done at a very, very early point (and I'm not sure it can happen in practice for reasonable-size VMs, since it will likely take more time to send the RAM to destination, than it will take for BIOS to scan fw_cfg). The second problem only occurs if the guest panics _and_ has a guest driver _and_ management knows to look at the crash event, so it is mostly theoretical at this point in time. Thus keep the code simple, and pretend it was never broken. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0Peter Maydell1-0/+5
Our rules.mak adds '-rR' to MAKEFLAGS to indicate that we will be explicitly specifying everything and not relying on any default variables or rules. However we were accidentally relying on the default ARFLAGS ("rv"). This went unnoticed because of a bug in GNU Make 3.82 and earlier which meant that adding -rR to MAKEFLAGS only affected submakes, not the currently running instance. Explicitly set ARFLAGS in config-host.mak, in the same way we handle CFLAGS and LDFLAGS; this will allow us to work with Make 4.0. Thanks to Paul Smith for analyzing this bug for us. Cc: qemu-stable@nongnu.org Reported-by: Ken Moffat <zarniwhoop@ntlworld.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21sun4m: Add FCode ROM for TCX framebufferMark Cave-Ayland5-11/+38
Upstream OpenBIOS now implements SBus probing in order to determine the contents of a physical bus slot, which is required to allow OpenBIOS to identify the framebuffer without help from the fw_cfg interface. SBus probing works by detecting the presence of an FCode program (effectively tokenised Forth) at the base address of each slot, and if present executes it so that it creates its own device node in the OpenBIOS device tree. The FCode ROM is generated as part of the OpenBIOS build and should generally be updated at the same time. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> CC: Blue Swirl <blauwirbel@gmail.com> CC: Bob Breuer <breuerr@mc.net> CC: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21Update version for 1.7.0-rc1 releaseAnthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21vfio-pci: Fix multifunction=onAlex Williamson1-0/+7
When an assigned device is initialized it copies the device config space into the emulated config space. Unfortunately multifunction is setup prior to the device initfn and gets clobbered. We need to restore it just like pci-assign does. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Reviewed-by: Bandan Das <bsd@redhat.com> Message-id: 20131112185059.7262.33780.stgit@bling.home Cc: qemu-stable@nongnu.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21target-i386: Fix addr32 prefix in gen_lea_modrmRichard Henderson1-45/+47
Fix the following run-test-x86_64 testsuite failures: -lea (%%eax) = 0000000000000001 -lea (%%ebx) = 0000000000000002 -lea (%%ecx) = 0000000000000004 -lea (%%edx) = 0000000000000008 -lea (%%esi) = 0000000000000010 -lea (%%edi) = 0000000000000020 +lea (%%eax) = 0000abcc00000001 +lea (%%ebx) = 0000abcf00000002 +lea (%%ecx) = 0000abc900000004 +lea (%%edx) = 0000abc500000008 +lea (%%esi) = 0000abdd00000010 +lea (%%edi) = 0000abed00000020 In addition, reduce ifdeffery and minimize the number of TCG ops produced during address computation. Signed-off-by: Richard Henderson <rth@twiddle.net> Message-id: 1384219016-5170-1-git-send-email-rth@twiddle.net Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21atomic.h: Fix build with clangPeter Maydell1-3/+3
clang defines __ATOMIC_SEQ_CST but its implementation of the __atomic_exchange() builtin differs from that of gcc. Move the __clang__ branch of the ifdef ladder to the top and fix its implementation (there is no such builtin as __sync_exchange), so we can compile with clang again. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1382435921-18438-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21target-i386: do not override nr_cores for -cpu hostPaolo Bonzini1-6/+8
Commit 787aaf5 (target-i386: forward CPUID cache leaves when -cpu host is used, 2013-09-02) brings bits 31..26 of CPUID leaf 04h out of sync with the APIC IDs that QEMU reserves for each package. This number must come from "-smp" options rather than from the host CPUID. It also turns out that this unsyncing makes Windows Server 2012R2 fail to boot. Tested-by: Peter Lieven <pl@kamp.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Message-id: 1384879786-6721-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21mips jazz: do not raise data bus exception when accessing invalid addressesHervé Poussineau1-0/+24
MIPS Jazz chipset doesn't seem to raise data bus exceptions on invalid accesses. However, there is no easy way to prevent them. Creating a big memory region for the whole address space doesn't prevent memory core to directly call unassigned_mem_read/write which in turn call cpu->do_unassigned_access, which (for MIPS CPU) raise an data bus exception. This fixes a MIPS Jazz regression introduced in c658b94f6e8c206c59d02aa6fbac285b86b53d2c. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Message-id: 1383603977-7003-1-git-send-email-hpoussin@reactos.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21target-i386: yield to another VCPU on PAUSEPaolo Bonzini3-3/+25
After commit b1bbfe7 (aio / timers: On timer modification, qemu_notify or aio_notify, 2013-08-21) FreeBSD guests report a huge slowdown. The problem shows up as soon as FreeBSD turns out its periodic (~1 ms) tick, but the timers are only the trigger for a pre-existing problem. Before the offending patch, setting a timer did a timer_settime system call. After, setting the timer exits the event loop (which uses poll) and reenters it with a new deadline. This does not cause any slowdown; the difference is between one system call (timer_settime and a signal delivery (SIGALRM) before the patch, and two system calls afterwards (write to a pipe or eventfd + calling poll again when re-entering the event loop). Unfortunately, the exit/enter causes the main loop to grab the iothread lock, which in turns kicks the VCPU thread out of execution. This causes TCG to execute the next VCPU in its round-robin scheduling of VCPUS. When the second VCPU is mostly unused, FreeBSD runs a "pause" instruction in its idle loop which only burns cycles without any progress. As soon as the timer tick expires, the first VCPU runs the interrupt handler but very soon it sets it again---and QEMU then goes back doing nothing in the second VCPU. The fix is to make the pause instruction do "cpu_loop_exit". Cc: Richard Henderson <rth@twiddle.net> Reported-by: Luigi Rizzo <rizzo@iet.unipi.it> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Message-id: 1384948442-24217-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21rng-egd: offset the point when repeatedly read from the bufferAmos Kong1-1/+3
The buffer content might be read out more than once, currently we just repeatedly read the first data block, buffer offset is missing. Cc: qemu-stable@nongnu.org Signed-off-by: Amos Kong <akong@redhat.com> Message-id: 1385023371-8198-3-git-send-email-akong@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21rng-egd: remove redundant freeAmos Kong1-1/+0
We didn't set default chr_name, the free is redundant. Signed-off-by: Amos Kong <akong@redhat.com> Message-id: 1385023371-8198-2-git-send-email-akong@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21virtio-rng: add check of periodAmos Kong1-0/+6
If period is assigned to 0, limit timer will expire immediately. It causes a qemu warning: "main-loop: WARNING: I/O thread spun for 1000 iterations" This limit is meaningless. This patch forbids to assign 0 to period. Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Message-id: 1385031203-23790-1-git-send-email-akong@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21s390x: fix flat file load on 32 bit systemsMichael S. Tsirkin1-8/+9
pc-bios/s390-zipl.rom is a flat image so it's expected that loading it as elf will fail. It should fall back on loading a flat file, but doesn't on 32 bit systems, instead it fails printing: qemu: hardware error: could not load bootloader 's390-zipl.rom' The result is boot failure. The reason is that a 64 bit unsigned interger which is set to -1 on error is compared to -1UL which on a 32 bit system with gcc is a 32 bit unsigned interger. Since both are unsigned, no sign extension takes place and comparison evaluates to non-equal. There's no reason to do clever tricks: all functions we call actually return int so just use int. And then we can use == -1 everywhere, consistently. Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 20131121133426.GA30827@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21acpi-build: fix build on glib < 2.14Michael S. Tsirkin2-5/+8
g_array_get_element_size was only added in glib 2.14. Fortunately we don't use it for any arrays where element size is > 1, so just add an assert. Reported-by: Richard Henderson <rth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1385036128-8753-2-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21acpi-build: fix build on glib < 2.22Michael S. Tsirkin1-5/+6
g_string_vprintf was only introduced in 2.24 so switch to vsnprintf instead. A bit uglier but name size is fixed at 4 bytes here so it's easy. Reported-by: Richard Henderson <rth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1385036128-8753-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori2-55/+14
# By Jan Kiszka (1) and others # Via Gleb Natapov * qemu-kvm/uq/master: kvm: Fix uninitialized cpuid_data pci-assign: Remove dead code for direct I/O region access from userspace KVM: x86: fix typo in KVM_GET_XCRS Message-id: cover.1385040432.git.gleb@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21Merge remote-tracking branch 'jliu/or32' into stagingAnthony Liguori8-107/+119
# By Sebastian Macke # Via Jia Liu * jliu/or32: target-openrisc: Correct carry flag check of l.addc and l.addic test cases target-openrisc: Correct memory bounds checking for the tlb buffers openrisc-timer: Reduce overhead, Separate clock update functions target-openrisc: Correct wrong epcr register in interrupt handler target-openrisc: Remove executable flag for every page target-openrisc: Remove unnecessary code generated by jump instructions target-openrisc: Speed up move instruction Message-id: 1384958318-9145-1-git-send-email-proljc@gmail.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21Merge remote-tracking branch 'quintela/migration.next' into stagingAnthony Liguori1-1/+1
# By Wangting (Kathy) # Via Juan Quintela * quintela/migration.next: The calculation of bytes_xfer in qemu_put_buffer() is wrong Message-id: 1384946787-8190-1-git-send-email-quintela@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21Revert "e1000/rtl8139: update HMP NIC when every bit is written"Michael S. Tsirkin2-2/+5
This reverts commit cd5be5829c1ce87aa6b3a7806524fac07ac9a757. Digging into hardware specs shows this does not actually make QEMU behave more like hardware: There are valid arguments backed by the spec to indicate why the version of e1000 prior to cd5be582 was more correct: the high byte actually includes a valid bit, this is why all guests write it last. For rtl8139 there's actually a separate undocumented valid bit, but we don't implement it yet. To summarize all the drivers we know about behave in one way that allows us to make an assumption about write order and avoid spurious, incorrect mac address updates to the monitor. Let's stick to the tried heuristic for 1.7 and possibly revisit for 1.8. Reported-by: Vlad Yasevich <vyasevic@redhat.com> Reviewed-by: Vlad Yasevich <vyasevic@redhat.com> Cc: Amos Kong <akong@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-21acpi-build: fix build on glib < 2.14Michael S. Tsirkin2-5/+8
g_array_get_element_size was only added in glib 2.14, there's no way to find element size in with an older glib. Fortunately we only use a single table (linker) where element size > 1. Switch element size to 1 everywhere, then we can just look at len field to get table size in bytes. Add an assert to make sure we catch any violations of this rule. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reported-by: Richard Henderson <rth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-21acpi-build: fix build on glib < 2.22Michael S. Tsirkin1-5/+6
g_string_vprintf was only introduced in 2.24 so switch to vsnprintf instead. A bit uglier but name size is fixed at 4 bytes here so it's easy. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reported-by: Richard Henderson <rth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-21pci: unregister vmstate_pcibus on unplugBandan Das1-0/+8
PCIBus registers a vmstate during init. Unregister it upon removal/unplug. Signed-off-by: Bandan Das <bsd@redhat.com> Cc: qemu-stable@nongnu.org Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-21s390x: fix flat file load on 32 bit systemsMichael S. Tsirkin1-8/+9
pc-bios/s390-zipl.rom is a flat image so it's expected that loading it as elf will fail. It should fall back on loading a flat file, but doesn't on 32 bit systems, instead it fails printing: qemu: hardware error: could not load bootloader 's390-zipl.rom' The result is boot failure. The reason is that a 64 bit unsigned interger which is set to -1 on error is compared to -1UL which on a 32 bit system with gcc is a 32 bit unsigned interger. Since both are unsigned, no sign extension takes place and comparison evaluates to non-equal. There's no reason to do clever tricks: all functions we call actually return int so just use int. And then we can use == -1 everywhere, consistently. Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-20target-openrisc: Correct carry flag check of l.addc and l.addic test casesSebastian Macke2-7/+11
The test cases did not correctly test for the carry flag. Signed-off-by: Sebastian Macke <sebastian@macke.de> Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Jia Liu <proljc@gmail.com>
2013-11-20target-openrisc: Correct memory bounds checking for the tlb buffersSebastian Macke1-8/+8
The mtspr and mfspr routines didn't check for the correct memory boundaries. This fixes a segmentation fault while booting Linux. Signed-off-by: Sebastian Macke <sebastian@macke.de> Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Jia Liu <proljc@gmail.com>
2013-11-20openrisc-timer: Reduce overhead, Separate clock update functionsSebastian Macke3-30/+38
The clock value is only evaluated when really necessary reducing the overhead of the timer handling. This also solves a problem in the way the Linux kernel handles the timer and the expected accuracy. The old version could lead to inaccurate timings. Signed-off-by: Sebastian Macke <sebastian@macke.de> Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Jia Liu <proljc@gmail.com>
2013-11-20target-openrisc: Correct wrong epcr register in interrupt handlerSebastian Macke1-18/+7
This patch corrects several misbehaviors during an interrupt process. Most of the time the pc is already correct and therefore no special treatment of the exceptions is necessary. Tested by checking crashing programs which otherwise work in or1ksim. Signed-off-by: Sebastian Macke <sebastian@macke.de> Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Jia Liu <proljc@gmail.com>
2013-11-20target-openrisc: Remove executable flag for every pageSebastian Macke1-2/+2
Pages should be flagged executable only if the tlb executable flag is set or the mmu is off. Signed-off-by: Sebastian Macke <sebastian@macke.de> Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Jia Liu <proljc@gmail.com>
2013-11-20target-openrisc: Remove unnecessary code generated by jump instructionsSebastian Macke1-19/+26
The sr_f variable is only used for the l.bf and l.bnf instructions. For clarity the code is also rewritten using a switch statement instead of if chaining. Signed-off-by: Sebastian Macke <sebastian@macke.de> Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Jia Liu <proljc@gmail.com>
2013-11-20target-openrisc: Speed up move instructionSebastian Macke1-23/+27
The OpenRISC architecture does not have its own move register instruction. Instead it uses either "l.addi rd, r0, x" or "l.ori rd, rs, 0" or "l.or rd, rx, r0" The l.ori instruction is automatically optimized but not the l.addi instruction. This patch optimizes for this special case. Signed-off-by: Sebastian Macke <sebastian@macke.de> Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Jia Liu <proljc@gmail.com>
2013-11-20The calculation of bytes_xfer in qemu_put_buffer() is wrongWangting (Kathy)1-1/+1
In qemu_put_buffer(), bytes_xfer += size is wrong, it will be more than expected, and should be bytes_xfer += l. Signed-off-by: zhangmin <zhangmin6@huawei.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-11-19Merge remote-tracking branch 'quintela/migration.next' into stagingAnthony Liguori1-8/+0
# By Peter Lieven # Via Juan Quintela * quintela/migration.next: migration: drop MADVISE_DONT_NEED for incoming zero pages Message-id: 1384878412-23521-1-git-send-email-quintela@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-19Merge remote-tracking branch 'stefanha/block' into stagingAnthony Liguori10-12/+12
# By Andreas Färber # Via Stefan Hajnoczi * stefanha/block: qtest: Use -display none by default
2013-11-19Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into ↵Anthony Liguori1-2/+3
staging QOM infrastructure fixes for 1.7 * QOM memory leak fix # gpg: Signature made Tue 19 Nov 2013 01:58:58 AM PST using RSA key ID 3E7E013F # gpg: Can't check signature: public key not found # By Vlad Yasevich # Via Andreas Färber * afaerber/tags/qom-devices-for-anthony: qom: Fix memory leak in object_property_set_link()
2013-11-19Merge remote-tracking branch 'rth/tcg-ia64-17' into stagingAnthony Liguori2-362/+397
# By Richard Henderson # Via Richard Henderson * rth/tcg-ia64-17: tcg-ia64: Introduce tcg_opc_bswap64_i tcg-ia64: Introduce tcg_opc_ext_i tcg-ia64: Introduce tcg_opc_movi_a tcg-ia64: Introduce tcg_opc_mov_a tcg-ia64: Use A3 form of logical operations tcg-ia64: Use SUB_A3 and ADDS_A4 for subtraction tcg-ia64: Use ADDS for small addition tcg-ia64: Avoid unnecessary stop bit in tcg_out_alu tcg-ia64: Move AREG0 to R32 tcg-ia64: Simplify brcond tcg-ia64: Handle constant calls tcg-ia64: Use shortcuts for nop insns tcg-ia64: Use TCGMemOp within qemu_ldst routines Message-id: 1384811395-7097-1-git-send-email-rth@twiddle.net Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-19Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori3-5/+5
pc last minute fixes for 1.8 This has a patch that drops an unused FW CFG entry. I think it's best to include it before 1.7 to avoid the need to maintain it in compat machine types. There's also a doc bugfix by Amos: I'm guessing doc fixes are still fair game even at this late stage. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 18 Nov 2013 03:48:14 AM PST using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Amos Kong (1) and Igor Mammedov (1) # Via Michael S. Tsirkin * mst/tags/for_anthony: doc: fix hardcoded helper path pc: disable pci-info Message-id: 1384775449-6693-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-19Merge remote-tracking branch 'mjt/trivial-patches' into stagingAnthony Liguori13-58/+573
# By Jan Krupa (4) and others # Via Michael Tokarev * mjt/trivial-patches: hw/i386/Makefile.obj: use $(PYTHON) to run .py scripts consistently configure: Use -B switch only for Python versions which support it qga: Fix shutdown command of guest agent to work with SysV console: Remove unused debug code qga: Fix compilation for old versions of MinGW .travis.yml: basic compile and check recipes pci-assign: Fix error_report of pci-stub message qapi: Fix comment for create-type to match code. vl: fix build when configured with no graphic support usb: drop unused USBNetState.inpkt field qemu-char: add missing characters used in keymaps qemu-char: add support for U-prefixed symbols qemu-char: add Czech keymap file qemu-char: add Czech characters to VNC keysyms Message-id: 1384684850-6777-1-git-send-email-mjt@msgid.tls.msk.ru Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-19Merge remote-tracking branch 'kwolf/tags/for-anthony' into stagingAnthony Liguori22-16/+531
Block fixes for 1.7.0 # gpg: Signature made Fri 15 Nov 2013 09:51:25 AM PST using RSA key ID C88F2FD6 # gpg: Can't check signature: public key not found # By Max Reitz (3) and others # Via Kevin Wolf * kwolf/tags/for-anthony: block: Fail if requested driver is not available MAINTAINERS: add block driver sub-maintainers qemu-img: Fix overwriting 'ret' before using qemu-iotests: Test qcow2 count_contiguous_clusters() qcow2: fix possible corruption when reading multiple clusters qmp: access the local QemuOptsLists for drive option MAINTAINERS: add block tree repo URLs qemu-iotests: Extend 041 for unbacked mirroring block/drive-mirror: Check for NULL backing_hd qapi-schema: Update description for NewImageMode block: Print its file name if backing file opening failed Message-id: 1384537999-5972-1-git-send-email-kwolf@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-19Merge remote-tracking branch 'stefanha/net' into stagingAnthony Liguori2-4/+5
# By Amos Kong (1) and Sebastian Huber (1) # Via Stefan Hajnoczi * stefanha/net: virtio-net: fix the memory leak in rxfilter_notify() smc91c111: Fix receive starvation Message-id: 1384532032-19057-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-19Merge remote-tracking branch 'agraf/tags/signed-ppc-for-upstream-1.7' into ↵Anthony Liguori7-1/+5
staging Patch queue for ppc - 2013-11-08 These are two patches that will hopefully make it into 1.7. The SLOF update fixes -append kernel command line argument passing into the guest kernel. The other patch makes VIO devices appear when using -device '?'. # gpg: Signature made Thu 07 Nov 2013 07:34:54 PM PST using RSA key ID 03FEDC60 # gpg: Can't check signature: public key not found # By Alexey Kardashevskiy # Via Alexander Graf * agraf/tags/signed-ppc-for-upstream-1.7: pseries: Update SLOF firmware image spapr: add vio-bus devices to categories Message-id: 1383881766-13958-1-git-send-email-agraf@suse.de Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-19migration: drop MADVISE_DONT_NEED for incoming zero pagesPeter Lieven1-8/+0
The madvise for zeroed out pages was introduced when every transferred zero page was memset to zero and thus allocated. Since commit 211ea740 we check for zeroness of a target page before we memset it to zero. Additionally we memmap target memory so it is essentially zero initialized (except for e.g. option roms and bios which are loaded into target memory although they shouldn't). It was reported recently that this madvise causes a performance degradation in some situations. As the madvise should only be called rarely and if it's called it is likely on a busy page (it was non-zero and changed to zero during migration) drop it completely. Reported-By: Zhang Haoyu <haoyu.zhang@huawei.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-11-19qom: Fix memory leak in object_property_set_link()Vlad Yasevich1-2/+3
Save the result of the call to object_get_canonical_path() so we can free it. Cc: qemu-stable@nongnu.org Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-11-19qtest: Use -display none by defaultAndreas Färber10-12/+12
This avoids each test needing to add it to suppress windows popping up. [Commit 7ceeedd016facf8d58e14a0d1417fa7225d71072 ("blockdev-test: add test case for drive_add duplicate IDs") and commit 43cd209803d6cffb1e1a028c9ff2fd0ff4fce954 ("qdev-monitor-test: add device_add leak test cases") added qtest tests without specifying -display none. As a result, "make check" now tries to use graphics (GTK or SDL). Since graphics are not used by the test and inappropriate for headless "make check" runs, add the missing -display none. This fixes "make check" in the QEMU buildbot. -- Stefan] Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-19virtio-net: fix the memory leak in rxfilter_notify()Amos Kong1-4/+4
object_get_canonical_path() returns a gchar*, it should be freed by the caller. Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Vlad Yasevich <vyasevic@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-18doc: fix hardcoded helper pathAmos Kong1-3/+3
The install directory of qemu-bridge-helper is configurable, but we use a fixed path in the documentation. DEFAULT_BRIDGE_HELPER macro isn't available in texi mode, we should always use "/path/to/" prefix for dynamic paths (e.g.: /path/to/image, /path/to/linux, etc). Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-18tcg-ia64: Introduce tcg_opc_bswap64_iRichard Henderson1-35/+28
Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Introduce tcg_opc_ext_iRichard Henderson1-30/+24
Being able to "extend" from 64-bits (with a mov) simplifies a few places where the conditional breaks the train of thought. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Introduce tcg_opc_movi_aRichard Henderson1-16/+16
Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Introduce tcg_opc_mov_aRichard Henderson1-19/+16
Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Use A3 form of logical operationsRichard Henderson1-30/+34
We can and/or/xor/andcm small constants, saving one cycle. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Use SUB_A3 and ADDS_A4 for subtractionRichard Henderson1-2/+23
We can subtract from more small constants that just 0 with one insn, and we can add the negative for most small constants. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Use ADDS for small additionRichard Henderson1-4/+16
Avoids a wasted cycle loading up small constants. Simplify the code assuming the tcg optimizer is going to work and don't expect the first operand of the add to be constant. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Avoid unnecessary stop bit in tcg_out_aluRichard Henderson1-11/+6
When performing an operation with two input registers, we'd leave the stop bit (and thus an extra cycle) that's only needed when one or the other input is a constant. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Move AREG0 to R32Richard Henderson2-9/+8
Since the move away from the global areg0, we're no longer globally reserving areg0. Which means our use of R7 clobbers a call-saved register. Shift areg0 into the windowed registers. Indeed, choose the incoming parameter register that it comes to us by. This requires moving the register holding the return address elsewhere. Choose R33 for tidiness. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Simplify brcondRichard Henderson1-34/+10
There was a misconception that a stop bit is required between a compare and the branch that uses the predicate set by the compare. This lead to the usage of an extra bundle in which to perform the compare. The extra bundle left room for constants to be loaded for use with the compare insn. If we pack the compare and the branch together in the same bundle, then there's no longer any room for non-zero constants. At which point we can eliminate half the function by not handling them. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Handle constant callsRichard Henderson1-3/+35
Using only indirect calls results in 3 bundles (one to load the descriptor address), and 4 stop bits. By looking through the descriptor to the constants, we can perform the call with 2 bundles and only 1 stop bit. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Use shortcuts for nop insnsRichard Henderson1-124/+127
There's no need to go through the full opcode-to-insn function call to generate nops. This makes the source a bit more readable. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-18tcg-ia64: Use TCGMemOp within qemu_ldst routinesRichard Henderson1-82/+91
Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-11-17hw/i386/Makefile.obj: use $(PYTHON) to run .py scripts consistentlyMichael Tokarev1-1/+1
$(PYTHON) is a Make variable which is set by configure. In all other places over the tree, .py files are run from Makefiles using this variable, except of a single leftover in hw/i386/Makefile.obj (and a nearby place in there uses $(PYTHON) correctly). Fix this leftover too. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Cc: Luigi Rizzo <rizzo@iet.unipi.it> Reviewed-by:: Stefan Weil <sw@weilnetz.de>
2013-11-17configure: Use -B switch only for Python versions which support itStefan Weil1-1/+8
Commit 1d984a67a95d88f3e708b077dab8adeb47c38c93 added the -B switch unconditionally. This breaks Python versions before 2.6 which don't support that switch. Now configure adds -B only if it is accepted by the Python interpreter. This modification introduces a small incompatibility because -B might now also be added when configure was called with --python=PYTHON_INTERPRETER. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-16qga: Fix shutdown command of guest agent to work with SysVwhitearchey1-1/+1
For now guest agent uses following command to shutdown system: shutdown -P +0 "blabla" but this syntax works only with shutdown command from systemd or upstart, because SysV shutdown requires -h switch. Following patch changes the command so it works with systemd, upstart and SysV With upstart/systemd qga use one of thee commands, depending on 'mode' parameter: shutdown -P +0 "..." shutdown -H +0 "..." shutdown -r +0 "..." SysV equivalents for these are: shutdown -h -P +0 "..." shutdown -h -H +0 "..." shutdown -h -r +0 "..." and these retain their meaning with upstart/systemd. According to FreeBSD manpages, shutdown does not accept -P and -H options. Commands should be: shutdown -p +0 "..." shutdown -h +0 "..." shutdown -r +0 "..." shutdown in Solaris does not accept any of -hHpPr and does not accept time in "+0" format Signed-off-by: Michael Avdienko <whitearchey@gmail.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-15block: Fail if requested driver is not availableKevin Wolf3-0/+21
If an explicit driver option is present, but doesn't specify a valid driver, then bdrv_open() should fail instead of probing the format. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-15MAINTAINERS: add block driver sub-maintainersStefan Hajnoczi1-0/+40
There are a number of contributors who maintain block drivers (image formats and protocols). They should be listed in the MAINTAINERS file so that get_maintainer.pl lists them. Note that commits are still merged through Kevin or Stefan's block tree but the block driver sub-maintainers are usually the ones to review patches. Acked-by: Kevin Wolf <kwolf@redhat.com> Acked-by: Richard W.M. Jones <rjones@redhat.com> Acked-by: Stefan Weil <sw@weilnetz.de> Acked-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Jeff Cody <jcody@redhat.com> Acked-by: Anthony Liguori <aliguori@amazon.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-15qemu-img: Fix overwriting 'ret' before usingFam Zheng3-4/+63
This patch moves ret assignment after reporting original error. We were lucky to pass qemu-iotests 048 (qemu-img compare case) but when I tried to run with TEST_DIR=/tmp (tmpfs), it fails with a "wrong" mismatch offset. This fixes two bugs. In the first if branch, setting ret to 1 before using it makes dead code in the next line: pnum is never added to mismatch offset even if ret was 0. In the other if branch, currently the output error is always -4: strerror(-4) -> Unknown error -4 Added regression test in case 048. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com>
2013-11-15qemu-iotests: Test qcow2 count_contiguous_clusters()Kevin Wolf3-0/+285
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-15smc91c111: Fix receive starvationSebastian Huber1-0/+1
In case the smc91c111 interface signals that it cannot receive more packets the packets are queued and further reception will be disabled. In case the interface is again ready to receive packets notify the upper layer. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-14qcow2: fix possible corruption when reading multiple clustersPeter Lieven1-1/+1
if multiple sectors spanning multiple clusters are read the function count_contiguous_clusters should ensure that the cluster type should not change between the clusters. Especially the for-loop should break when we have one or more normal clusters followed by a compressed cluster. Unfortunately the wrong macro was used in the mask to compare the flags. This was discovered while debugging a data corruption issue when converting a compressed qcow2 image to raw. qemu-img reads 2MB chunks which span multiple clusters. CC: qemu-stable@nongnu.org Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-14qmp: access the local QemuOptsLists for drive optionAmos Kong5-2/+82
Currently we have three QemuOptsList (qemu_common_drive_opts, qemu_legacy_drive_opts, and qemu_drive_opts), only qemu_drive_opts is added to vm_config_groups[]. This patch changes query-command-line-options to access three local QemuOptsLists for drive option, and merge the description items together. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-14MAINTAINERS: add block tree repo URLsStefan Hajnoczi1-0/+2
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-14qemu-iotests: Extend 041 for unbacked mirroringMax Reitz2-2/+27
Add a new test case in file 041 for mirroring unbacked images in "absolute-paths" mode. This should work, if possible, but most importantly, qemu should never crash. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-14block/drive-mirror: Check for NULL backing_hdMax Reitz1-1/+3
It should be possible to execute the QMP "drive-mirror" command in "none" sync mode and "absolute-paths" mode even for block devices lacking a backing file. "absolute-paths" does in fact not require a backing file to be present, as can be seen from the "top" sync mode code path. "top" basically states that the device should indeed have a backing file - however, the current code catches the case if it doesn't and then simply treats it as "full" sync mode, creating a target image without a backing file (in "absolute-paths" mode). Thus, "absolute-paths" does not imply the target file must indeed have a backing file. Therefore, the target file may be left unbacked in case of "none" sync mode as well, if the specified device is not backed either. Currently, qemu will crash trying to dereference the backing file pointer since it assumes that it will always be non-NULL in that case ("none" with "absolute-paths"). Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-14qapi-schema: Update description for NewImageModeMax Reitz1-1/+2
If the NewImageMode is "absolute-paths" but no backing file is available (e.g., when mirroring a device with an unbacked image), the target image will not be backed either. This patch updates the documentation in qapi-schema.json accordingly. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-14block: Print its file name if backing file opening failedFam Zheng5-5/+5
If backing file doesn't exist, the error message is confusing and misleading: $ qemu /tmp/a.qcow2 qemu: could not open disk image /tmp/a.qcow2: Could not open file: No such file or directory But... $ ls /tmp/a.qcow2 /tmp/a.qcow2 $ qemu-img info /tmp/a.qcow2 image: /tmp/a.qcow2 file format: qcow2 virtual size: 8.0G (8589934592 bytes) disk size: 196K cluster_size: 65536 backing file: /tmp/b.qcow2 Because... $ ls /tmp/b.qcow2 ls: cannot access /tmp/b.qcow2: No such file or directory This is not intuitive. It's better to have the missing file's name in the error message. With this patch: $ qemu-io -c 'read 0 512' /tmp/a.qcow2 qemu-io: can't open device /tmp/a.qcow2: Could not open backing file: Could not open '/stor/vm/arch.raw': No such file or directory no file open, try 'help open' Which is a little bit better. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-14pc: disable pci-infoIgor Mammedov2-2/+2
The BIOS that we ship in 1.7 does not use pci info from host and so far isn't going to use it. Taking in account problems it caused see 9604f70fdf and to avoid future incompatibility issues, it's safest to disable that interface by default for all machine types including 1.7 as it was never exposed/used by guest. And properly remove/cleanup it during 1.8 development cycle. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-13Merge remote-tracking branch 'luiz/queue/qmp' into stagingAnthony Liguori2-3/+18
# By Luiz Capitulino (1) and Richard Henderson (1) # Via Luiz Capitulino * luiz/queue/qmp: MAINTAINERS: add git tree info for HMP, QMP and QAPI Adjust qapi-visit for python-2.4.3 Message-id: 1384281985-11100-1-git-send-email-lcapitulino@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori10-38/+42
pci, pc, virtio bug fixes This reverts PCI master abort support - we'll want it eventually but it exposes too many core bugs to be safe for 1.7. This also reverts a recent exec.c change that was an attempt to work-around some of these core bugs. Also included are small fixes in pc and virtio, and a core loader fix for PPC bamboo. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Sun 10 Nov 2013 05:13:22 AM PST using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Michael S. Tsirkin (3) and others # Via Michael S. Tsirkin * mst/tags/for_anthony: Revert "exec: limit system memory size" Revert "hw/pci: partially handle pci master abort" loader: drop return value for rom_add_blob_fixed acpi-build: disable with -no-acpi virtio-net: only delete bh that existed Fix pc migration from qemu <= 1.5 Message-id: 1384159176-31662-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13Merge remote-tracking branch 'stefanha/net' into stagingAnthony Liguori3-5/+11
# By Dmitry Fleytman (1) and others # Via Stefan Hajnoczi * stefanha/net: virtio-net: broken RX filtering logic fixed net: fix qemu_flush_queued_packets() in presence of a hub net: disallow to specify multicast MAC address Message-id: 1383928804-28866-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13Merge remote-tracking branch 'stefanha/block' into stagingAnthony Liguori35-262/+2897
# By Jeff Cody (26) and others # Via Stefan Hajnoczi * stefanha/block: (37 commits) block: Round up total_sectors block: vhdx qemu-iotest - log replay of data sector block: qemu-iotests for vhdx, add write test support block: vhdx - update _make_test_img() to filter out vhdx options block: vhdx - add .bdrv_create() support block: vhdx - fix comment typos in header, fix incorrect struct fields block: vhdx - break out code operations to functions block: vhdx - move more endian translations to vhdx-endian.c block: vhdx - remove BAT file offset bit shifting block: vhdx write support block: vhdx - add log write support block: vhdx - add region overlap detection for image files block: vhdx - log parsing, replay, and flush support block: vhdx code movement - move vhdx_close() above vhdx_open() block: vhdx - update log guid in header, and first write tracker block: vhdx - break endian translation functions out block: vhdx - log support struct and defines block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header. block: vhdx - add header update capability. block: vhdx - minor comments and typo correction. ... Message-id: 1383905551-16411-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13Merge remote-tracking branch 'filippov/tags/20131108-xtensa' into stagingAnthony Liguori2-2/+5
Two small fixes for 1.7: - add missing debug feature to dc233c xtensa core; - fix qemu abort caused by gdb attempt to invalidate a breakpoint by virtual address for which there's no mapping. # gpg: Signature made Thu 07 Nov 2013 09:32:19 PM PST using RSA key ID F83FA044 # gpg: Can't check signature: public key not found # By Max Filippov # Via Max Filippov * filippov/tags/20131108-xtensa: target-xtensa: add missing DEBUG section to dc233c config exec: fix breakpoint_invalidate when pc may not be translated Message-id: 1383889643-21621-1-git-send-email-jcmvbkbc@gmail.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13Merge remote-tracking branch 'kraxel/audio.3' into stagingAnthony Liguori1-1/+5
# By Gerd Hoffmann # Via Gerd Hoffmann * kraxel/audio.3: ossaudio: check for oss support in oss_audio_init Revert "ossaudio: do not enable by default" Message-id: 1383823947-5132-1-git-send-email-kraxel@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13Merge remote-tracking branch 'sweil/mingw' into stagingAnthony Liguori5-7/+43
# By Stefan Weil # Via Stefan Weil * sweil/mingw: linux-user: Fix stat64 syscall for SPARC64 configure: Add config.status to recreate the current configuration nsis: Improved support for parallel installation of 32 and 64 bit code Message-id: 1383804909-376-1-git-send-email-sw@weilnetz.de Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13console: Remove unused debug codeStefan Weil1-33/+0
The local function console_print_text_attributes is no longer used since commit 7d6ba01c3741bc32ae252bf64a5fd3f930c2df4f. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13qga: Fix compilation for old versions of MinGWStefan Weil1-0/+1
While MinGW-w64 can compile the qga code, MinGW from Debian lenny (gcc-mingw32 4.4.2-3) shows these errors: In file included from qga/vss-win32.c:17: qga/vss-win32/requester.h:31: error: expected »=«, »,«, »;«, »asm« or »__attribute__« before »requester_init« qga/vss-win32/requester.h:32: error: expected »=«, »,«, »;«, »asm« or »__attribute__« before »requester_deinit« The macro STDAPI is unknown, so add the missing include file which defines it. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13.travis.yml: basic compile and check recipesAlex Bennée1-0/+71
This adds a build matrix definition for travis-ci.org continuous integration service. It is usable on any public repository hosted on GitHub. Once you have created an account signed into Travis you can enable it on selected projects via travis-ci.org/profile. Alternatively you can configure the service hooks on GitHub via the repository Settings tab,then Service Hooks and selecting Travis. Once setup Travis will automatically test every push as well as any pull requests submitted to that repository. The build matrix is currently split by target architecture (see TARGETS environment variable) because a full build of QEMU can take some time. This way you get quick feedback for any obvious errors. The additional environment variables exist to allow additional builds to tweak the environment. These are: EXTRA_CONFIG - extra terms passed to configure EXTRA_PKGS - extra dev packages to install TEST_CMD - default "make check", can be overridden I've confined the additional stuff to x86/x86_64 for convenience. As Travis supports clang the main builds are done twice (once for gcc and once for clang). However clang is disabled for the debug/trace builds for the purposes of brevity. Other wrinkles: * The lttng user-space tracing back-end is disabled (it is currently horribly broken) * The ftrace back-end doesn't run "make check" (it requires a mounted debugfs to work) * There are two debug enabled build (with and without TCG interpreter) Signed-off-by: Alex Bennée <alex@bennee.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13pci-assign: Fix error_report of pci-stub messageCole Robinson1-20/+16
Using multiple calls to error_report here means every line is prefaced with the (potentially long) pci-assign command line arguments. Use a single error_printf to preserve the intended formatting. Since this code path is always preceded by an error_report call, we don't lose the command line reporting. Signed-off-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13qapi: Fix comment for create-type to match code.Fam Zheng1-1/+1
Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13vl: fix build when configured with no graphic supportAntony Pavlov1-0/+1
The following error occurs when building with no graphic output support: vl.c: In function ‘main’: vl.c:2829:19: error: variable ‘ds’ set but not used [-Werror=unused-but-set-variable] DisplayState *ds; ^ cc1: all warnings being treated as errors To reproduce this issue, just run: $ ./configure \ --disable-curses \ --disable-sdl \ --disable-cocoa \ --disable-gtk \ --disable-vnc \ --enable-werror $ make vl.o Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13usb: drop unused USBNetState.inpkt fieldStefan Hajnoczi1-1/+0
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13qemu-char: add missing characters used in keymapsJan Krupa1-0/+365
This patch adds all missing characters used in regional keymap files which already exist in QEMU. I checked for the missing characters by going through all of the keymaps and matching that with records in vnc_keysym.h. If the key wasn't found I looked it up in libxkbcommon library [1]. If I understood it correctly this is also the same place where most of the keymaps were exported from according to the comment on the first line in those files. I was able to find all symbols except "quotebl" used in Netherland keymap. I tested this update with Czech keyboard by myself. I also asked Matej Serc to test Slovenian keyboard layout - he reported problems with it few days ago on this mailing list. Both layouts seems to work fine. I wasn't able to test the remaining layouts but since this change doesn't modify any existing symbols, just adds new ones, I don't expect any sideeffects. [1] http://cgit.freedesktop.org/xorg/lib/libxkbcommon Signed-off-by: Jan Krupa <jkrupa@suse.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13qemu-char: add support for U-prefixed symbolsJan Krupa1-0/+6
This patch adds support for Unicode symbols in keymap files. This feature was already used in some keyboard layouts in QEMU generated from XKB (e.g. Arabic) but it wasn't implemented in QEMU source code. There is no need for check of validity of the hex string after U character because strtol returns 0 in case the conversion was unsuccessful. Signed-off-by: Jan Krupa <jkrupa@suse.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13qemu-char: add Czech keymap fileJan Krupa2-1/+95
This patch adds Czech keyboard layout to available keymap files and Makefile. Signed-off-by: Jan Krupa <jkrupa@suse.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13qemu-char: add Czech characters to VNC keysymsJan Krupa1-0/+8
This patch adds missing Czech characters to the VNC keysym table. Signed-off-by: Jan Krupa <jkrupa@suse.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-11MAINTAINERS: add git tree info for HMP, QMP and QAPILuiz Capitulino1-0/+4
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-11-11Adjust qapi-visit for python-2.4.3Richard Henderson1-3/+14
We say we support python 2.4, but python 2.4.3 does not support the "expr if test else expr" syntax used here. This allows QEMU to compile on RHEL 5.3, the last release for ia64. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-11-10Revert "exec: limit system memory size"Michael S. Tsirkin1-6/+1
This reverts commit 818f86b88394b7b2b59d313e51043fe15a8004db. This was a work-around for bugs elsewhere in the system, exposed by commit a53ae8e934cd54686875b5bcfc2f434244ee55d6: "hw/pci: partially handle pci master abort" since that's reverted now, the work-around is not required for 1.7 anymore. The proper fix is supporting full 64 bit addresses in the radix tree. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Marcel Apfelbaum <marcel.a@redhat.com>
2013-11-10Revert "hw/pci: partially handle pci master abort"Marcel Apfelbaum2-27/+0
This reverts commit a53ae8e934cd54686875b5bcfc2f434244ee55d6. The patch being reverted introduced a low-priority memory region covering all 64 bit pci address space. This exposed the following bugs elsewhere in the code: 1. Some memory regions have INT64_MAX size, where the intent was all 64 bit address space. This results in a sub-page region, should be UINT64_MAX. 2. page table rendering in exec.c ignores physical address bits above TARGET_PHYS_ADDR_SPACE_BITS. Access outside this range (e.g. from device DMA, or gdb stub) ends up with a wrong region. Registering a region outside this range leads to page table corruption. 3. Some regions overlap PCI hole and have same priority. This only works as long as no device uses the overlapping address. It doesn't look like we can resolve all issues in time for 1.7. Let's fix the bugs first and apply afterwards for 1.8. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-10loader: drop return value for rom_add_blob_fixedMichael S. Tsirkin2-2/+3
rom_add_blob never fails, and neither does rom_add_blob_fixed, so there's no need to return value from it. In fact, rom_add_blob_fixed was erroneously returning -1 unconditionally which made the only system that checked the return value -M bamboo fail to start. Drop the return value and drop checks from ppc440_bamboo to fix this failure. Reported-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-10acpi-build: disable with -no-acpiMichael S. Tsirkin1-0/+5
QEMU will currently crash if started with -no-acpi flag since acpi build code probes the PM device which isn't present in this configuration. To fix, don't expose ACPI tables to guest when acpi has been disabled from command line. Fixes LP# 1248854 https://bugs.launchpad.net/qemu/+bug/1248854 Reported-by: chao zhou <chao.zhou@intel.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2013-11-10virtio-net: only delete bh that existedJason Wang1-1/+1
We delete without check whether it existed during exit. This will lead NULL pointer deference since it was created conditionally depends on guest driver status and features. So add a check of existence before trying to delete it. Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-10Fix pc migration from qemu <= 1.5Cole Robinson4-3/+33
The following commit introduced a migration incompatibility: commit 568f0690fd9aa4d39d84b04c1a5dbb53a915c3fe Author: David Gibson <david@gibson.dropbear.id.au> Date: Thu Jun 6 18:48:49 2013 +1000 pci: Replace pci_find_domain() with more general pci_root_bus_path() The issue is that i440fx savevm idstr went from 0000:00:00.0/I440FX to 0000:00.0/I440FX. Unfortunately we are stuck with the breakage for 1.6 machine types. Add a compat property to maintain the busted idstr for the 1.6 machine types, but revert to the old style format for 1.7+, and <= 1.5. Tested with migration from qemu 1.5, qemu 1.6, and qemu.git. Cc: qemu-stable@nongnu.org Signed-off-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-08virtio-net: broken RX filtering logic fixedDmitry Fleytman1-1/+2
Upon processing of VIRTIO_NET_CTRL_MAC_TABLE_SET command multicast list overwrites unicast list in mac_table. This leads to broken logic for both unicast and multicast RX filtering. Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-08net: fix qemu_flush_queued_packets() in presence of a hubSergey Fedorov1-1/+0
Do not return after net_hub_flush(). Always flush callee network client incoming queue. Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-08net: disallow to specify multicast MAC addressDmitry Krivenok2-3/+9
[Assigning a multicast MAC address to a NIC leads to confusing behavior. Reject multicast MAC addresses so users are alerted to their error straight away. The "net/eth.h" in6_addr rename prevents a name collision with <netinet/in.h> on Linux. -- Stefan] Signed-off-by: Dmitry V. Krivenok <krivenok.dmitry@gmail.com> Reviewed-by: Amos Kong <kongjianjun@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-08block: Round up total_sectorsFam Zheng1-1/+1
Since b94a2610, bdrv_getlength() is omitted when probing image. VMDK monolithicFlat is broken by that because a file < 512 bytes can't be read with its total_sectors truncated to 0. This patch round up the size to BDRV_SECTOR_SIZE, when a image size is not sector aligned. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-08target-xtensa: add missing DEBUG section to dc233c configMax Filippov1-0/+1
This fixes missing debug feature opcodes of dc233c core variant. Cc: qemu-stable@nongnu.org Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2013-11-08exec: fix breakpoint_invalidate when pc may not be translatedMax Filippov1-2/+4
This fixes qemu abort with the following message: include/qemu/int128.h:22: int128_get64: Assertion `!a.hi' failed. which happens due to attempt to invalidate breakpoint by virtual address for which get_phys_page_debug couldn't find mapping. For more details see http://lists.nongnu.org/archive/html/qemu-devel/2013-09/msg04582.html Cc: qemu-stable@nongnu.org Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-08pseries: Update SLOF firmware imageAlexey Kardashevskiy3-1/+1
SLOF git commit is e2e8ac901e617573ea383f9cffd136146d0675a4 The main changes are: * fixed bug with not passing arguments from -append * client-architecture-support hypercall * netboot * USB stack fixes The full list of changes: > client-architecture-support: fix wrong version read > client-architecture-support: fix redundant stack drop > Update device tree returned by CAS hypercall > fdt: introduce fdt-init > Add ibm,client-architecture-support method > Kernel parameter passed from qemu commandline ignored > Allow more than one client to open net devices simultaneously > ci: add missing close in else condition > Add GPT support > pci: fix interrupt-map for bridges > usb-ohci: preserve the toggleCarry bit in ED > usb-ohci: done_head processing fixes > usb-ohci: update init and rationalize timings > usb-msc: handle stall and other fixes > scsi: make probe more error resilient > usb-core: Add CLEAR FEATURE api > Implement range allocator > Remove bcm57xx network driver as module > Remove e1000 network driver as module > Remove virtio-net network driver as module > Remove veth network driver as module > Add missing close-dev in ping > Remove lodable network driver modules and related functions > Add bcm57xx network driver in libbcm > Add e1000 network driver in libe1k > Add virtio-net driver in libvirtio > Add veth driver in libveth > Get MAC address for client interface module > Add SLOF usleep wrapper > Add SLOF pci wrapper functions > Fix 'canon' client interface Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-11-08spapr: add vio-bus devices to categoriesAlexey Kardashevskiy4-0/+4
In order to get devices appear in output of "./qemu-system-ppc64 -device ?", they must be assigned to one of DEVICE_CATEGORY_XXXX. This puts VIO devices classes to corresponding categories. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-11-07block: vhdx qemu-iotest - log replay of data sectorJeff Cody4-0/+76
This tests the replay of a data sector in a VHDX image file. The image file is a 10G dynamic image, with 4MB block size. The image was created with qemu-img, and the log left unplayed by modification of the vhdx image format driver. It was verified under both QEMU and Hyper-V that the image file, post log replay, matched. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests for vhdx, add write test supportJeff Cody3-1/+25
This removes the IMGFMT_GENERIC blocker for read-only, so existing iotests run read/write tests for vhdx images created by qemu-img (e.g. tests 001, 002, 003). In addition, this updates the sample image test for the Hyper-V created image, to verify we can write it as well. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - update _make_test_img() to filter out vhdx optionsJeff Cody1-1/+4
The non-global option output is suppresed in _make_test_img() for output verification in the 0?? tests. This adds suppression for the vhdx-unique options as well. This allows check -vhdx to run successfully. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - add .bdrv_create() supportJeff Cody2-1/+572
This adds support for VHDX image creation, for images of type "Fixed" and "Dynamic". "Differencing" types (i.e., VHDX images with backing files) are currently not supported. Options for image creation include: * log size: The size of the journaling log for VHDX. Minimum is 1MB, and it must be a multiple of 1MB. Invalid log sizes will be silently fixed by rounding up to the nearest MB. Default is 1MB. * block size: This is the size of a payload block. The range is 1MB to 256MB, inclusive, and must be a multiple of 1MB as well. Invalid sizes and multiples will be silently fixed. If '0' is passed, then a sane size is chosen (depending on virtual image size). Default is 0 (Auto-select). * subformat: - "dynamic" An image without data pre-allocated. - "fixed" An image with data pre-allocated. Default is "dynamic" When creating the image file, the lettered sections are created: -----------------------------------------------------------------. | (A) | (B) | (C) | (D) | (E) | File ID | Header1 | Header 2 | Region Tbl 1 | Region Tbl 2 | | | | | .-----------------------------------------------------------------. 0 64KB 128KB 192KB 256KB 320KB .---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------. | (F) | (G) | (H) | | Journal Log | BAT / Bitmap | Metadata | .... data ...... | | | | .---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------. 1MB (var.) (var.) (var.) Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - fix comment typos in header, fix incorrect struct fieldsJeff Cody1-5/+5
VHDXPage83Data and VHDXParentLocatorHeader both incorrectly had their MSGUID fields set as arrays of 16. This is incorrect (it stems from an early version where those fields were uint_8 arrays). Those fields were, up to this patch, unused. Also, there were a couple of typos and incorrect wording in comments, and those have been fixed up as well. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - break out code operations to functionsJeff Cody1-41/+80
This is preperation for vhdx_create(). The ability to write headers, and calculate the number of BAT entries will be needed within the create() functions, so move this relevant code into helper functions. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - move more endian translations to vhdx-endian.cJeff Cody3-17/+87
In preparation for vhdx_create(), move more endian translation functions out to vhdx-endian.c. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - remove BAT file offset bit shiftingJeff Cody2-5/+2
Bit shifting can be fun, but in this case it was unnecessary. The upper 44 bits of the 64-bit BAT entry is specifies the File Offset, so we shifted the bits to get access to the value. However, per the spec the value is in MB. So we dutifully shifted back to the left by 20 bits, to convert to a true uint64_t file offset. This replaces those steps with just a bit mask, to get rid of the lower 20 bits instead. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx write supportJeff Cody2-5/+209
This adds support for writing to VHDX image files, using coroutines. Writes into the BAT table goes through the VHDX log. Currently, BAT table writes occur when expanding a dynamic VHDX file, and allocating a new BAT entry. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - add log write supportJeff Cody2-0/+285
This adds support for writing to the VHDX log. For spec details, see VHDX Specification Format v1.00: https://www.microsoft.com/en-us/download/details.aspx?id=34750 There are a few limitations to this log support: 1.) There is no caching yet 2.) The log is flushed after each entry The primary write interface, vhdx_log_write_and_flush(), performs a log write followed by an immediate flush of the log. As each log entry sector is a minimum of 4KB, partial sector writes are filled in with data from the disk write destination. If the current file log GUID is 0, a new GUID is generated and updated in the header. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - add region overlap detection for image filesJeff Cody2-0/+91
Regions in the image file cannot overlap - the log, region tables, and metdata must all be unique and non-overlapping. This adds region checking by means of a QLIST; there can be a variable number of regions and metadata (there may be metadata or region tables that we do not recognize / know about, but are not required). This adds the capability to register a region for later checking, and to check against registered regions for any overlap. Also, if neither the BAT or Metadata region tables are found, return error. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - log parsing, replay, and flush supportJeff Cody4-53/+749
This adds support for VHDX v0 logs, as specified in Microsoft's VHDX Specification Format v1.00: https://www.microsoft.com/en-us/download/details.aspx?id=34750 The following support is added: * Log parsing, and validation - validate that an existing log is correct. * Log search - search through an existing log, to find any valid sequence of entries. * Log replay and flush - replay an existing log, and flush/clear the log when complete. The VHDX log is a circular buffer, with elements (sectors) of 4KB. A log entry is a variably-length number of sectors, that is comprised of a header and 'descriptors', that describe each sector. A log may contain multiple entries, know as a log sequence. In a log sequence, each log entry immediately follows the previous entry, with an incrementing sequence number. There can only ever be one active and valid sequence in the log. Each log entry must match the file log GUID in order to be valid (along with other criteria). Once we have flushed all valid log entries, we marked the file log GUID to be zero, which indicates a buffer with no valid entries. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx code movement - move vhdx_close() above vhdx_open()Jeff Cody1-11/+11
Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - update log guid in header, and first write trackerJeff Cody2-6/+30
Allow tracking of first file write in the VHDX image, as well as the ability to update the GUID in the header. This is in preparation for log support. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - break endian translation functions outJeff Cody4-44/+150
This moves the endian translation functions out from the vhdx.c source, into a separate source file. In addition to the previously defined endian functions, new endian translation functions for log support are added as well. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - log support struct and definesJeff Cody1-16/+30
This adds some magic number defines, and internal structure definitions for VHDX log replay support. The struct VHDXLogEntries does not reflect an on-disk data structure, and thus does not need to be packed. Some minor code style fixes are applied as well. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header.Jeff Cody2-52/+48
In preparation for VHDX log support, move these structures to the header. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - add header update capability.Jeff Cody4-5/+196
This adds the ability to update the headers in a VHDX image, including generating a new MS-compatible GUID. As VHDX depends on uuid.h, VHDX is now a configurable build option. If VHDX support is enabled, that will also enable uuid as well. The default is to have VHDX enabled. To enable/disable VHDX: --enable-vhdx, --disable-vhdx Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - minor comments and typo correction.Jeff Cody2-5/+7
Just a couple of minor comments to help note where allocated buffers are freed, and a typo fix. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block/vpc: fix virtual size for images created with disk2vhdPeter Lieven1-0/+9
Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: Save errno before error_setg_errnoMax Reitz1-1/+1
error_setg_errno() may overwrite errno; therefore, its value should be read before calling that function and not afterwards. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07qdev-monitor-test: add device_add leak test casesStefan Hajnoczi2-0/+83
Ensure that the device_add error code path deletes device objects. Failure to do so not only leaks the objects but can also keep other objects (like drive or netdev) alive due to qdev properties holding references. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-11-07blockdev-test: add test case for drive_add duplicate IDsStefan Hajnoczi2-0/+61
The following should work: (qemu) drive_add if=none,id=drive0 (qemu) drive_del drive0 (qemu) drive_add if=none,id=drive0 Previous versions of QEMU produced a duplicate ID error because drive_add leaked the options. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-11-07libqtest: add qmp(fmt, ...) -> QDict* functionStefan Hajnoczi2-14/+89
Add a qtest qmp() function that returns the response object. This allows test cases to verify the result or to check for error responses. It also allows waiting for QMP events. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de>
2013-11-07libqtest: rename qmp() to qmp_discard_response()Stefan Hajnoczi5-27/+32
Existing qmp() callers do not expect a response object. In order to implement real QMP test cases it will be necessary to inspect the response object. Rename qmp() to qmp_discard_response(). Later patches will introduce a qmp() function that returns the response object and tests that use it. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de>
2013-11-07blockdev: fix drive_init() opts and bs_opts leaksStefan Hajnoczi1-12/+15
These memory leaks also make drive_add if=none,id=drive0 without a file= option leak the options list. This keeps ID "drive0" around forever. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-11-07block: qemu-iotests, add quotes to $TEST_IMG usage in 061Jeff Cody1-3/+3
When creating images with backing files in the test, the backing file argument was not quoted properly. This caused the test to fail when run from a pathname with a space. Pass the backing argument in with the -b option to _make_test_img, so it can be properly quoted. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests, add quotes to $TEST_IMG usage for 051Jeff Cody1-4/+4
There were still a couple of instances of unquoted usage of $TEST_IMG and $TEST_IMG.orig. Quoted these so they will not fail on pathnames with spaces in them. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests, removes duplicate double quotes in 039Jeff Cody1-1/+1
Test 039 had $TEST_IMG with duplicate double quotes - remove duplicate. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests, add quotes to $TEST_IMG usage in 019Jeff Cody1-3/+3
There were still instances of $TEST_IMG not being properly quoted. This was in the usage of a string built up for a 'for' loop; modify the loop so we can quote $TEST_IMG properly. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017Jeff Cody1-1/+1
$TEST_IMG.base is used unquoted. Add quotes so that pathnames with spaces are supported. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests, fix _make_test_img() to work with spaced pathnamesJeff Cody1-2/+11
_make_test_img() currently works with spaced pathnames only when not specifying a backing file. This fixes it so that the backing file argument is properly quoted. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests, add quotes to $TEST_IMG usage io pattern testsJeff Cody1-6/+6
The usage of $TEST_IMG was not properly quoted everywhere in common.pattern. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block/raw-posix: fix FreeBSD compilationAndreas Tobler1-1/+2
The below patch is needed to compile qemu trunk on FreeBSD with gcc48, clang will fail.... ;). Host x84_64-freebsd. Signed-off-by: Andreas Tobler <andreast@FreeBSD.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07qemu-iotests: Filter out actual image size in 067Max Reitz2-6/+6
The actual size of the image file may differ depending on the Linux kernel currently running on the host. Filtering out this value makes this test pass in such cases. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07qapi: Fix comment for create-type to match code.Fam Zheng1-1/+1
Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07ossaudio: check for oss support in oss_audio_initGerd Hoffmann1-0/+4
Check whenever the device path (/dev/dsp by default) exists and qemu is allowed to access it. Return NULL if it isn't, so ossaudio will not be used on systems wihtout oss support (increasinly common on modern linux systems). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-11-07Revert "ossaudio: do not enable by default"Gerd Hoffmann1-1/+1
This reverts commit c905c5012ac0c6fde3b8094d2206a3139deddba2. There is a better fix for the issue at hand. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-11-07kvm: Fix uninitialized cpuid_dataStefan Weil1-7/+2
This error was reported by valgrind when running qemu-system-x86_64 with kvm: ==975== Conditional jump or move depends on uninitialised value(s) ==975== at 0x521C38: cpuid_find_entry (kvm.c:176) ==975== by 0x5235BA: kvm_arch_init_vcpu (kvm.c:686) ==975== by 0x4D5175: kvm_init_vcpu (kvm-all.c:267) ==975== by 0x45035B: qemu_kvm_cpu_thread_fn (cpus.c:858) ==975== by 0xD361E0D: start_thread (pthread_create.c:311) ==975== by 0xD65E9EC: clone (clone.S:113) ==975== Uninitialised value was created by a stack allocation ==975== at 0x5226E4: kvm_arch_init_vcpu (kvm.c:446) Instead of adding more memset calls for parts of cpuid_data, the existing calls were removed and cpuid_data is now initialized completely in one call. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-11-07pci-assign: Remove dead code for direct I/O region access from userspaceJan Kiszka1-46/+10
This feature was already deprecated back then in qemu-kvm, ie. before pci-assign went upstream. assigned_dev_ioport_rw will never be invoked with resource_fd < 0. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-11-07linux-user: Fix stat64 syscall for SPARC64Stefan Weil2-3/+17
Some targets use a stat64 structure for the stat64 syscall while others use a stat structure. SPARC64 used the wrong kind. Instead of extending the conditional compilation in syscall.c, now a macro TARGET_HAS_STRUCT_STAT64 is defined whenever a target has a target_stat64. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-11-07configure: Add config.status to recreate the current configurationStefan Weil2-3/+21
The latest configure invocation was saved in config-host.mak and could be extracted from that file to recreate the configuration. Now it is saved in a new file config.status which can be directly executed to recreate the configuration. The file name and the comments were copied from GNU autoconf. Makefile now uses config.status, but also includes transitional code for the old mechanism. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Fam Zheng <famz@redhat.com>
2013-11-07nsis: Improved support for parallel installation of 32 and 64 bit codeStefan Weil1-1/+5
32 and 64 bit variants of QEMU already had different default installation directories, but used a common registry key for saving the choosen directory. This is confusing for users who want to install both variants, so fix it by using different registry keys. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2013-11-06Update version for 1.7.0-rc0 releaseAnthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-06sdl: Reverse support for video mode settingLei Li1-4/+19
Currently, If the setting of video mode failed, qemu will exit. It should go back to the previous setting if the new screen resolution failed. This patch fixes LP#1216368, add support to revert to existing surface for the failure of video mode setting. Reported-by: Sascha Krissler <sascha@srlabs.de> Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1378285636-7091-1-git-send-email-lilei@linux.vnet.ibm.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-06timers: fix stop/cont with -icountPaolo Bonzini1-20/+22
Stop/cont commands are broken with -icount due to a deadlock. The real problem is that the computation of timers_state.cpu_ticks_offset makes no sense with -icount enabled: we set it to an icount clock value in cpu_disable_ticks, and subtract a TSC (or similar, whatever cpu_get_real_ticks happens to return) value in cpu_enable_ticks. The fix is simple. timers_state.cpu_ticks_offset is only used together with cpu_get_real_ticks, so we can use cpu_get_real_ticks in cpu_disable_ticks. There is no need to update cpu_ticks_prev at the time cpu_disable_ticks is called; instead, we can do it the next time cpu_get_ticks is called. The change to cpu_disable_ticks is the important part of the patch. The rest modifies the code to always check timers_state.cpu_ticks_prev, even when the ticks are not advancing (i.e. the VM is stopped). It also makes a similar change to cpu_get_clock_locked, so that the code remains similar for cpu_get_ticks and cpu_get_clock_locked. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1382977938-13844-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-06e1000/rtl8139: update HMP NIC when every bit is writtenAmos Kong2-5/+2
We currently just update the HMP NIC info when the last bit of macaddr is written. This assumes that guest driver will write all the macaddr from bit 0 to bit 5 when it changes the macaddr, this is the current behavior of linux driver (e1000/rtl8139cp), but we can't do this assumption. The macaddr that is used for rx-filter will be updated when every bit is changed. This patch updates the e1000/rtl8139 nic to update HMP NIC info when every bit is changed. It will be same as virtio-net. Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Alex Williamson <alex.williamson@redhat.com> Message-id: 1383650238-16015-1-git-send-email-akong@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-06virtio-net: only delete bh that existedJason Wang1-1/+1
We delete without check whether it existed during exit. This will lead NULL pointer deference since it was created conditionally depends on guest driver status and features. So add a check of existence before trying to delete it. Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383728288-28469-1-git-send-email-jasowang@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05rtc: remove dead SQW IRQ codeJan Kiszka1-8/+1
This was once introduced by commit 100d9891d6 but was never used in-tree and then got broken by commit 32e0c8260d. Time to clean up. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Message-id: 520B6A27.4040207@siemens.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05vga: fix invalid read after freeMarc-André Lureau1-1/+0
After calling dpy_gfx_replace_surface(s->con, surface), the outer surface is invalid. ==5370== Invalid read of size 4 ==5370== at 0x460229: surface_bits_per_pixel (console.h:250) ==5370== by 0x466A81: get_depth_index (vga.c:1173) ==5370== by 0x467EC2: vga_draw_graphic (vga.c:1718) ==5370== by 0x4687A5: vga_update_display (vga.c:1914) ==5370== by 0x2A782E: qxl_hw_update (qxl.c:1766) ==5370== by 0x3EB83B: graphic_hw_update (console.c:254) ==5370== by 0x3FBE31: qemu_spice_display_refresh (spice-display.c:418) ==5370== by 0x2A7D01: display_refresh (qxl.c:1886) ==5370== by 0x3EEE1C: dpy_refresh (console.c:1436) ==5370== by 0x3EB543: gui_update (console.c:192) ==5370== by 0x3C43B3: timerlist_run_timers (qemu-timer.c:488) ==5370== by 0x3C4416: qemu_clock_run_timers (qemu-timer.c:499) ==5370== Address 0x22ffb1e0 is 0 bytes inside a block of size 56 free'd ==5370== at 0x4A074C4: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==5370== by 0x4245FC: free_and_trace (vl.c:2771) ==5370== by 0x50899AE: g_free (gmem.c:252) ==5370== by 0x3EE8D3: qemu_free_displaysurface (console.c:1332) ==5370== by 0x3EEDB7: dpy_gfx_replace_surface (console.c:1427) ==5370== by 0x467EB6: vga_draw_graphic (vga.c:1714) ==5370== by 0x4687A5: vga_update_display (vga.c:1914) ==5370== by 0x2A782E: qxl_hw_update (qxl.c:1766) ==5370== by 0x3EB83B: graphic_hw_update (console.c:254) ==5370== by 0x3FBE31: qemu_spice_display_refresh (spice-display.c:418) ==5370== by 0x2A7D01: display_refresh (qxl.c:1886) ==5370== by 0x3EEE1C: dpy_refresh (console.c:1436) Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1383664554-15248-1-git-send-email-marcandre.lureau@gmail.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05tests: fix 64-bit int literals for 32-bit hostsStefan Hajnoczi3-4/+5
On 32-bit hosts: CC tests/test-opts-visitor.o tests/test-opts-visitor.c: In function 'test_value': tests/test-opts-visitor.c:128: warning: integer constant is too large for 'long' type CC tests/test-bitops.o tests/test-bitops.c:34: warning: integer constant is too large for 'long' type tests/test-bitops.c:35: warning: integer constant is too large for 'long' type tests/test-bitops.c:35: warning: integer constant is too large for 'long' type CC tests/endianness-test.o tests/endianness-test.c:47: warning: integer constant is too large for 'long' type Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1383669768-23926-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05docs/memory.txt: Clarify and expand priority/overlap documentationPeter Maydell1-2/+62
The documentation of how overlapping memory regions behave and how the priority system works was rather brief, and confusion about priorities seems to be quite common for developers trying to understand how the memory region system works, so expand and clarify it. This includes a worked example with overlaps, documentation of the behaviour when an overlapped container has "holes", and mention that it's valid for a region to have both MMIO callbacks and subregions (and how this interacts with priorities when it does). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1381848154-31602-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05configure: detect endian via compile testMike Frysinger1-26/+14
This avoids needing to execute a program and keeping an (incomplete) list when cross-compiling. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Tested-by: James Hogan <james.hogan@imgtec.com> [mips] Message-id: 1372649418-4987-1-git-send-email-vapier@gentoo.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05tests: fix memleak in error path test for input visitorWenchao Xia1-0/+1
Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1383676551-18806-3-git-send-email-xiawenc@linux.vnet.ibm.com Cc: qemu-stable@nongnu.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05qapi: fix memleak by adding implict struct functions in dealloc visitorWenchao Xia1-0/+20
Otherwise member "base" is leaked in a qapi_free_STRUCTURE() call. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1383676551-18806-2-git-send-email-xiawenc@linux.vnet.ibm.com Cc: qemu-stable@nongnu.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05bswap.h: Remove cpu_to_32wu()Peter Maydell2-13/+8
Replace the legacy cpu_to_32wu() with stl_p(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383669517-25598-10-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05bswap.h: Remove cpu_to_be64wu()Peter Maydell2-6/+1
Replace the legacy cpu_to_be64wu() with stq_be_p(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383669517-25598-9-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05bswap.h: Remove cpu_to_be32wu()Peter Maydell4-12/+6
Replace the legacy cpu_to_be32wu() with stl_be_p(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383669517-25598-8-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05bswap.h: Remove cpu_to_be16wu()Peter Maydell4-26/+18
Replace the legacy cpu_to_be16wu() with stw_be_p(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383669517-25598-7-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05bswap.h: Remove be32_to_cpupu()Peter Maydell2-6/+1
Replace the legacy be32_to_cpupu() with ldl_be_p(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383669517-25598-6-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05bswap.h: Remove le32_to_cpupu()Peter Maydell3-7/+2
Replace the legacy le32_to_cpupu() with ldl_le_p(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383669517-25598-5-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05bswap.h: Remove le16_to_cpupu()Peter Maydell3-8/+2
Replace the legacy le16_to_cpupu() with lduw_le_p(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383669517-25598-4-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05bswap.h: Remove cpu_to_le32wu()Peter Maydell3-7/+2
Replace the legacy cpu_to_le32wu() with stl_le_p(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383669517-25598-3-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05bswap.h: Remove cpu_to_le16wu()Peter Maydell3-8/+3
Replace the legacy cpu_to_le16wu() with stw_le_p(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383669517-25598-2-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into ↵Anthony Liguori66-739/+1674
staging QOM device refactorings * QTest coverage for all machines * QOM realize for Milkymist UART * QOM realize for ARM MPCore * device_add bug fixes and cleanups * QOM for PCMCIA/MicroDrive (last legacy IDE device) # gpg: Signature made Tue 05 Nov 2013 09:07:03 AM PST using RSA key ID 3E7E013F # gpg: Can't check signature: public key not found # By Andreas Färber (49) and others # Via Andreas Färber * afaerber/tags/qom-devices-for-anthony: (54 commits) pcmcia/pxa2xx: QOM'ify PXA2xxPCMCIAState ide: Drop ide_init2_with_non_qdev_drives() microdrive: Coding Style cleanups pcmcia: QOM'ify PCMCIACardState and MicroDriveState pxa: Fix typo "dettach" qom: Fix pointer to int property helpers' documentation qdev-monitor: Inline qdev_init() for device_add qdev-monitor: Avoid qdev as variable name qdev: Drop misleading qdev_free() function qdev-monitor: Unref device when device_add fails qdev-monitor: Fix crash when device_add is called with abstract driver qdev-monitor: Clean up qdev_device_add() variable naming arm11mpcore: Split off RealView MPCore arm11mpcore: Prepare for QOM embedding arm11mpcore: Convert mpcore_rirq_state to QOM realize realview_gic: Prepare for QOM embedding realview_gic: Convert to QOM realize arm11mpcore: Convert ARM11MPCorePriveState to QOM realize arm11mpcore: Split off SCU device arm11mpcore: Create container MemoryRegion in instance_init ...
2013-11-05pcmcia/pxa2xx: QOM'ify PXA2xxPCMCIAStateAndreas Färber1-12/+66
Turn it into a SysBusDevice and use a container MemoryRegion. Add a link<pcmcia-card> property to the PCMCIACardState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-11-05ide: Drop ide_init2_with_non_qdev_drives()Andreas Färber2-51/+0
All its users have finally been converted. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-11-05microdrive: Coding Style cleanupsAndreas Färber1-24/+38
Add missing braces. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-11-05pcmcia: QOM'ify PCMCIACardState and MicroDriveStateAndreas Färber7-75/+219
Turn PCMCIACardState into a device. Move callbacks to new PCMCIACardClass. Derive TYPE_MICRODRIVE from TYPE_PCMCIA_CARD. Replace ide_init2_with_non_qdev_drives(). Signed-off-by: Othmar Pasteka <pasteka@kabsi.at> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-11-05pxa: Fix typo "dettach"Andreas Färber2-2/+2
Signed-off-by: Andreas Färber <afaerber@suse.de>