summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-09-20Merge remote-tracking branch 'luiz/queue/qmp' into stagingAnthony Liguori13-147/+137
# By Luiz Capitulino # Via Luiz Capitulino * luiz/queue/qmp: QMP: qmp-events.txt: alphabetical order fix and other minor changes QMP: Update qmp-spec.txt QMP: Update README file QMP: QMP/ -> docs/qmp/ QMP: fix qmp-commands.txt generation path QMP: add scripts/qmp Message-id: 1379509422-29115-1-git-send-email-lcapitulino@redhat.com
2013-09-20qcow2: Correct snapshots size for overlap checkMax Reitz1-1/+1
Using s->snapshots_size instead of snapshots_size for the metadata overlap check in qcow2_write_snapshots leads to the detection of an overlap with the main qcow2 image header when deleting the last snapshot, since s->snapshots_size has not yet been updated and is therefore non-zero. However, the offset returned by qcow2_alloc_clusters will be zero since snapshots_size is zero. Therefore, an overlap is detected albeit no such will occur. This patch fixes this by replacing s->snapshots_size by snapshots_size when calling qcow2_pre_write_overlap_check. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-20target-i386: add feature kvm_pv_unhaltAndrew Jones1-1/+1
I don't know yet if want this feature on by default, so for now I'm just adding support for "-cpu ...,+kvm_pv_unhalt". Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-20linux-headers: update to 3.12-rc1Andrew Jones4-0/+41
Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-20target-i386: forward CPUID cache leaves when -cpu host is usedBenoît Canet2-0/+22
Some users running cpu intensive tasks checking the cache CPUID leaves at startup and making decisions based on the result reported that the guest was not reflecting the host CPUID leaves when -cpu host is used. This patch fix this. Signed-off-by: Benoît Canet <benoit@irqsave.net> [Rename new field to cache_info_passthrough - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-20linux-headers: update to 3.11Alexey Kardashevskiy6-44/+254
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-20kvm: fix traces to use %x instead of %dAlexey Kardashevskiy1-3/+3
KVM request types are normally defined using hex constants but QEMU traces print decimal values instead, which is not very convenient. This changes the request type format from %d to %x. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-20kvmvapic: Clear also physical ROM address when entering INACTIVE stateJan Kiszka1-0/+2
To avoid misinterpreting INACTIVE after migration as old qemu-kvm's STANDBY, also clear rom_state_paddr when going back to this state. CC: qemu-stable@nongnu.org Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-20kvmvapic: Enter inactive state on hardware resetJan Kiszka1-3/+1
ROM layout may change after reset of devices are hotplugged, so we have to pick up the physical address again when the ROM is initialized. This is best achieved by resetting the state to INACTIVE. CC: qemu-stable@nongnu.org Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-20kvmvapic: Catch invalid ROM sizeJan Kiszka1-2/+9
If not caught early, a zero-length ROM will cause a NULL-pointer access later on in patch_hypercalls when allocating a zero-length ROM copy and trying to read from it. CC: qemu-stable@nongnu.org Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-20kvm irqfd: support direct msimessage to irq translationAlexey Kardashevskiy3-0/+23
On PPC64 systems MSI Messages are translated to system IRQ in a PCI host bridge. This is already supported for emulated MSI/MSIX but not for irqfd where the current QEMU allocates IRQ numbers from irqchip and maps MSIMessages to IRQ in the host kernel. This adds a new direct mapping flag which tells the kvm_irqchip_add_msi_route() function that a new VIRQ should not be allocated, instead the value from MSIMessage::data should be used. It is up to the platform code to make sure that this contains a valid IRQ number as sPAPR does in spapr_pci.c. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-20fix steal time MSR vmsd callback to proper opaque typeMarcelo Tosatti1-3/+3
Convert steal time MSR vmsd callback pointer to proper X86CPU type. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-20kvm: warn if num cpus is greater than num recommendedAndrew Jones1-29/+40
The comment in kvm_max_vcpus() states that it's using the recommended procedure from the kernel API documentation to get the max number of vcpus that kvm supports. It is, but by always returning the maximum number supported. The maximum number should only be used for development purposes. qemu should check KVM_CAP_NR_VCPUS for the recommended number of vcpus. This patch adds a warning if a user specifies a number of cpus between the recommended and max. Signed-off-by: Andrew Jones <drjones@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-09-20cpu: Move cpu state syncs up into cpu_dump_state()James Hogan4-14/+11
The x86 and ppc targets call cpu_synchronize_state() from their *_cpu_dump_state() callbacks to ensure that up to date state is dumped when KVM is enabled (for example when a KVM internal error occurs). Move this call up into the generic cpu_dump_state() function so that other KVM targets (namely MIPS) can take advantage of it. This requires kvm_cpu_synchronize_state() and cpu_synchronize_state() to be moved out of the #ifdef NEED_CPU_H in <sysemu/kvm.h> so that they're accessible to qom/cpu.c. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Andreas Färber <afaerber@suse.de> Cc: Alexander Graf <agraf@suse.de> Cc: Gleb Natapov <gleb@redhat.com> Cc: qemu-ppc@nongnu.org Cc: kvm@vger.kernel.org Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-09-20exec: always use MADV_DONTFORKAndrea Arcangeli1-0/+1
MADV_DONTFORK prevents fork to fail with -ENOMEM if the default overcommit heuristics decides there's too much anonymous virtual memory allocated. If the KVM secondary MMU is synchronized with MMU notifiers or not, doesn't make a difference in that regard. Secondly it's always more efficient to avoid copying the guest physical address space in the fork child (so we avoid to mark all the guest memory readonly in the parent and so we skip the establishment and teardown of lots of pagetables in the child). In the common case we can ignore the error if MADV_DONTFORK is not available. Leave a second invocation that errors out in the KVM path if MMU notifiers are missing and KVM is enabled, to abort in such case. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Tested-By: Benoit Canet <benoit@irqsave.net> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-09-19coroutine: fix /perf/nesting coroutine benchmarkGabriel Kerneis1-6/+6
The /perf/nesting benchmark is broken because the counters are not reset after each iteration. Therefore, nesting is done only on the first iteration, and skipped on every other. This patch fixes the issue, and reduces the number of iterations to make it possible to run the benchmark in a reasonable amount of time. Signed-off-by: Gabriel Kerneis <gabriel@kerneis.info> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-19coroutine: add qemu_coroutine_yield benchmarkGabriel Kerneis1-0/+33
Current coroutine performance benchmarks test only coroutine creation, either directly or in a nested way. This patch adds a benchmark to evaluate the performance of qemu_coroutine_yield. Signed-off-by: Gabriel Kerneis <gabriel@kerneis.info> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-19usb: Fix iovec memleak on combined-packet freeHans de Goede1-0/+1
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-19usb: Also reset max_packet_size on ep_resetHans de Goede1-0/+3
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-19xhci: Fix memory leak on xhci_disable_epHans de Goede1-0/+5
The USBPacket-s in the transfers need to be cleaned up so that the memory allocated by the iovec in there gets freed. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-19xhci: Add xhci_epid_to_usbep helper functionHans de Goede1-10/+22
And use it instead of prying the USBEndpoint out of the packet struct in various places. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-19xhci: Init a transfers xhci, slotid and epid member on epctx allocHans de Goede1-3/+3
Transfers are part of an epctx, which is part of a slot, which is part of a xhci. Transfers cannot dynamically be moved from one epctx to another, so once created their xhci, slotid and epid are constant, so lets set these up at creation time, rather then re-initializing them with the same value each time a transfer gets submitted. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-19xhci: Fix number of streams allocated when using streamsHans de Goede1-1/+1
According to the xhci spec the total number of streams is 2 ^ (MaxPStreams + 1), and this is also how the Linux xhci driver uses this field. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-19usb: remove old usb-host codeGerd Hoffmann3-2572/+4
The usb-host code has been rewritten for qemu 1.5 to use libusb, the old code has been left in as temporary fallback. Now we are two releases further out, targeting the 1.7 release. No major issues with the new code poped up until now. Time to remove it from tre tree. Should we ever need it again for some reason -- git has a copy for us in the history. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-18qemu-timer: do not take the lock in timer_pendingPaolo Bonzini1-14/+5
We can deduce the result from expire_time, by making it always -1 if the timer is not in the active_timers list. We need to check against negative times passed to timer_mod_ns; clamping them to zero is not a problem because the only clock that has a zero value at VM startup is QEMU_CLOCK_VIRTUAL, and it is monotonic so it cannot be non-zero. QEMU_CLOCK_HOST, instead, is not monotonic but it cannot go to negative values unless the host time is seriously screwed up and points to the 1960s. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-18qemu-timer: make qemu_timer_mod_ns() and qemu_timer_del() thread-safeStefan Hajnoczi2-19/+85
Introduce QEMUTimerList->active_timers_lock to protect the linked list of active timers. This allows qemu_timer_mod_ns() to be called from any thread. Note that vm_clock is not thread-safe and its use of qemu_clock_has_timers() works fine today but is also not thread-safe. The purpose of this patch is to eventually let device models set or cancel timers from a vcpu thread without holding the global mutex. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-18qemu-timer: drop outdated signal safety commentsStefan Hajnoczi1-4/+0
host_alarm_handler() is invoked from the signal processing thread (currently the iothread). Previously we did processing in a real signal handler with signalfd and therefore needed signal-safe timer code. Today host_alarm_handler() just marks the alarm timer as expired/pending and notifies the main loop using qemu_notify_event(). Therefore these outdated comments about signal safety can be dropped. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-18osdep: warn if open(O_DIRECT) on fails with EINVALStefan Hajnoczi1-0/+7
Print a warning when opening a file O_DIRECT fails with EINVAL. This saves users a lot of time trying to figure out the EINVAL error, which is typical when attempting to open a file O_DIRECT on Linux tmpfs. Reported-by: Deepak C Shetty <deepakcs@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-09-18libcacard: link against qemu-error.o for error_report()Stefan Hajnoczi1-1/+2
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-18QMP: qmp-events.txt: alphabetical order fix and other minor changesLuiz Capitulino1-17/+17
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-09-18QMP: Update qmp-spec.txtLuiz Capitulino1-37/+28
Simplify the text, fix some of the examples. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-09-18QMP: Update README fileLuiz Capitulino1-50/+49
Drop unneeded info, fix some of the examples and rename QEMU Monitor Protocol to QEMU Machine Protocol. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-09-18QMP: QMP/ -> docs/qmp/Luiz Capitulino3-0/+0
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-09-18QMP: fix qmp-commands.txt generation pathLuiz Capitulino1-3/+3
This file should be generated in the BUILD_DIR, as all other docs. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-09-18QMP: add scripts/qmpLuiz Capitulino8-2/+2
Populate it with all scripts stored in QMP/. Also fixes trailing whitespaces in qmp-shell and qmp.py. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-09-18qxl: compile only onceGerd Hoffmann1-2/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-18qxl: simplify page dirtyingGerd Hoffmann1-2/+1
No need to do target page size calculations here, memory_region_set_dirty will care for us. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-18qxl: simplify qxl_rom_sizeGerd Hoffmann1-3/+1
Nowdays rom size is fixed at 8192 for live migration compat reasons. So we can ditch the pointless math trying to calculate the size needed. Also make the size sanity check fail at compile time not runtime. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-18qxl: define qxl operating on 4k pagesGerd Hoffmann2-2/+6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-18block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsiStefan Weil1-0/+6
Debian wheezy includes libiscsi-dev 1.4.0 which does not provide SCSI_PROVISIONING_TYPE_DEALLOCATED. Drop iscsi_co_get_block_status in this case to allow compilation without errors. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-17MAINTAINERS: Add myself to MAINTAINERS fileEduardo Otubo1-0/+6
Add myself to the MAINTAINERS file. I'll be looking at qemu-seccomp.c and include/sysemu/seccomp.h. Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com> Acked-by: Paul Moore <pmoore@redhat.com> Message-id: 1378746255-2089-1-git-send-email-otubo@linux.vnet.ibm.com Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
2013-09-17hmp: block-stream: fix typoAnthony Liguori1-1/+1
Found this by enabling C++ errors. The bool and enum arguments are mistakenly flipped. Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
2013-09-17Merge remote-tracking branch 'kiszka/queues/slirp' into stagingAnthony Liguori5-27/+49
# By Liu Ping Fan (3) and Jan Kiszka (1) # Via Jan Kiszka * kiszka/queues/slirp: slirp: clean up slirp_update_timeout slirp: set mainloop timeout with more precise value slirp: define timeout as macro slirp: make timeout local Message-id: cover.1379415024.git.jan.kiszka@siemens.com
2013-09-17Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori73-370/+2823
# By Max Reitz (16) and others # Via Kevin Wolf * kwolf/for-anthony: (33 commits) qemu-iotests: Fix test 038 block: Assert validity of BdrvActionOps qemu-iotests: Cleanup test image in test number 007 qemu-img: fix invalid JSON coroutine: add ./configure --disable-coroutine-pool qemu-iotests: Adjustments due to error propagation qcow2: Use Error parameter qemu-img create: Emit filename on error block: Error parameter for create functions block: Error parameter for open functions bdrv: Use "Error" for creating images bdrv: Use "Error" for opening images qemu-iotests: add 057 internal snapshot for block device test case hmp: add interface hmp_snapshot_delete_blkdev_internal hmp: add interface hmp_snapshot_blkdev_internal qmp: add interface blockdev-snapshot-delete-internal-sync qmp: add interface blockdev-snapshot-internal-sync qmp: add internal snapshot support in qmp_transaction snapshot: distinguish id and name in snapshot delete snapshot: new function bdrv_snapshot_find_by_id_and_name() ... Message-id: 1379073063-14963-1-git-send-email-kwolf@redhat.com
2013-09-17Merge remote-tracking branch 'rth/tgt-i386' into stagingAnthony Liguori2-18/+35
# By Paolo Bonzini (1) and Peter Maydell (1) # Via Richard Henderson * rth/tgt-i386: target-i386: Only provide CMOV and friends if feature bit set target-i386: fix disassembly with PAE=1, PG=0 Message-id: 1379010496-5875-1-git-send-email-rth@twiddle.net
2013-09-17Merge remote-tracking branch 'bonzini/scsi-next' into stagingAnthony Liguori9-135/+496
# By Peter Lieven (3) and others # Via Paolo Bonzini * bonzini/scsi-next: spapr-vscsi: Report error on unsupported MAD requests spapr-vscsi: Adding VSCSI capabilities iscsi: split discard requests in multiple parts iscsi: add .bdrv_get_block_status iscsi: add logical block provisioning information to iscsilun hw/scsi/lsi53c895a: Use deposit32 rather than handcoded shift/mask hw/scsi/lsi53c895a: Use sextract32 for sign-extension scsi: Fix scsi_bus_legacy_add_drive() scsi-generic with serial virtio-scsi: Make type virtio-scsi-common abstract spapr-vscsi: add task management scsi: prefer UUID to VM name for the initiator name Message-id: 1378984634-765-1-git-send-email-pbonzini@redhat.com
2013-09-17Merge remote-tracking branch 'kraxel/chardev.7' into stagingAnthony Liguori1-8/+4
# By Gerd Hoffmann # Via Gerd Hoffmann * kraxel/chardev.7: chardev: fix pty_chr_timer Message-id: 1378972894-11185-1-git-send-email-kraxel@redhat.com
2013-09-17slirp: clean up slirp_update_timeoutJan Kiszka1-2/+2
No need to write out the timeout early, keep it local until we are done. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2013-09-17slirp: set mainloop timeout with more precise valueLiu Ping Fan4-13/+27
If slirp needs to emulate tcp timeout, then the timeout value for mainloop should be more precise, which is determined by slirp's fasttimo or slowtimo. Achieve this by swap the logic sequence of slirp_pollfds_fill and slirp_update_timeout. Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2013-09-17slirp: define timeout as macroLiu Ping Fan1-5/+12
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>