summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-03-12qcow2: Reduce number of I/O requestsKevin Wolf3-77/+168
If the first part of a write request is allocated, but the second isn't and it can be allocated so that the resulting area is contiguous, handle it at once. This is a common case for sequential writes. After this patch, alloc_cluster_offset() only checks if the clusters are already allocated or how many new clusters can be allocated contigouosly. The actual cluster allocation is split off into a new function do_alloc_cluster_offset(). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-12qcow2: Add qcow2_alloc_clusters_at()Kevin Wolf2-0/+30
This function allows to allocate clusters at a given offset in the image file. This is useful if you want to allocate the second part of an area that must be contiguous. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-12qcow2: Factor out count_cow_clustersKevin Wolf1-19/+36
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-12qmp: convert blockdev-snapshot-sync to a wrapper around transactionsPaolo Bonzini5-73/+44
Simplify the blockdev-snapshot-sync code and gain failsafe operation by turning it into a wrapper around the new transaction command. A new option is also added matching "mode". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12add mode field to blockdev-snapshot-sync transaction itemPaolo Bonzini3-10/+44
The mode field lets a management application create the snapshot destination outside QEMU. Right now, the only modes are "existing" and "absolute-paths". Mirroring introduces "no-backing-file". In the future "relative-paths" could be implemented too. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12rename blockdev-group-snapshot-syncPaolo Bonzini3-76/+96
We will add other kinds of operation. Prepare for this by adjusting the schema. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12qapi: complete implementation of unionsPaolo Bonzini5-1/+98
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12use QSIMPLEQ_FOREACH_SAFE when freeing list elementsPaolo Bonzini1-2/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12Add 'make check-block'Kevin Wolf2-1/+27
Runs the full qemu-iotests suite for various image formats. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12make check: Add qemu-iotests subsetKevin Wolf2-0/+22
Run the 'quick' group from qemu-iotests during 'make check'. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12qemu-iotests: Mark some tests as quickKevin Wolf1-12/+12
This creates a new test group 'quick' for some test case that take at most a couple of seconds each, so that the group can be run during a quick 'make check' Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12qcow2: Add error messages in qcow2_truncateKevin Wolf2-1/+4
qemu-img resize has some limitations with qcow2, but the user is only told that "this image format does not support resize". Quite confusing, so add some more detailed error_report() calls and change "this image format" into "this image". Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-12block: handle -EBUSY in bdrv_commit_all()Stefan Hajnoczi3-6/+13
Monitor operations that manipulate image files must not execute while a background job (like image streaming) is in progress. This prevents corruptions from happening when two pieces of code are manipulating the image file without knowledge of each other. The monitor "commit" command raises QERR_DEVICE_IN_USE when bdrv_commit() returns -EBUSY but "commit all" has no error handling. This is easy to fix, although note that we do not deliver a detailed error about which device was busy in the "commit all" case. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12qcow2: Add some tracingKevin Wolf4-1/+65
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-12qed: do not evict in-use L2 table cache entriesStefan Hajnoczi1-4/+18
The L2 table cache reduces QED metadata reads that would be required when translating LBAs to offsets into the image file. Since requests execute in parallel it is possible to share an L2 table between multiple requests. There is a potential data corruption issue when an in-use L2 table is evicted from the cache because the following situation occurs: 1. An allocating write performs an update to L2 table "A". 2. Another request needs L2 table "B" and causes table "A" to be evicted. 3. A new read request needs L2 table "A" but it is not cached. As a result the L2 update from #1 can overlap with the L2 fetch from #3. We must avoid doing overlapping I/O requests here since the worst case outcome is that the L2 fetch completes before the L2 update and yields stale data. In that case we would effectively discard the L2 update and lose data clusters! Thanks to Benoît Canet <benoit.canet@gmail.com> for extensive testing and debugging which lead to discovery of this bug. Reported-by: Benoît Canet <benoit.canet@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Tested-by: Benoît Canet <benoit.canet@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12Group snapshot: Fix format name for backing filePaolo Bonzini1-1/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-11Add missing const attributes for MemoryRegionOpsStefan Weil9-13/+13
Most MemoryRegionOps already had the const attribute. This patch adds it to the remaining ones. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-11tcg: Improve tcg_out_label and fix its usage for w64Stefan Weil4-14/+14
tcg_out_label is always called with a third argument of pointer type which was casted to tcg_target_long. These casts can be avoided by changing the prototype of tcg_out_label. There was also a cast to long. For most hosts with sizeof(long) == sizeof(tcg_target_long) == sizeof(void *) this did not matter, but for w64 it was wrong. This is fixed now. Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-11configure: Test for libiberty.a (mingw32)Stefan Weil1-1/+7
MinGW-w64 and some versions of MinGW32 don't provide libiberty.a, so add this library only if it was found. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-11w64: Don't redefine lseek, ftruncateStefan Weil1-2/+6
MinGW-w64 already defines lseek and ftruncate (and uses the 64 bit variants). The conditional compilation avoids redefinitions (which would be wrong) and compiler warnings. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-11cache-utils: Add missing include file for uintptr_tStefan Weil1-0/+3
Commit 021ecd8b9db37927059f5d3234b51ed766706437 breaks the build for PPC hosts because it uses uintptr_t without the necessary include file. uintptr_t is defined in stdint.h, so add this include. Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-11build: Include config-host.mak as soon as possibleLluís Vilanova1-7/+8
Current code depends on variables defined in config-host.mak before it is actually included. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Cc: Anthony Liguori <aliguori@us.ibm.com> Cc: Paul Brook <paul@codesourcery.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-11gdbstub: Do not kill target in system emulation modeJan Kiszka1-0/+2
Too many VM kittens were killed since 7d03f82f81. Another one just died under my fat fingers. When you quit a kgdb session, does the Linux kernel power off? Or when you terminate gdb attached to a hardware debugger, does your board vanish in space? No. So let's stop terminating QEMU when the gdbstub receives a kill commando in system emulation mode. Real termination can still be achieved via "monitor quit". We keep the behavior for user mode emulation which is arguably more like a gdbserver scenario. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-11target-i386: Mask NX bit from cpu_get_phys_page_debug resultJan Kiszka2-6/+8
This was a long pending bug, now revealed by the assert in phys_page_find that stumbled over the large page index returned by cpu_get_phys_page_debug for NX-marked pages: We need to mask out NX and all user-definable bits 52..62 from PDEs and the final PTE to avoid corrupting physical addresses. Reviewed-by: Avi Kivity <avi@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-09Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori17-58/+45
* stefanha/trivial-patches: configure: Quote the configure args printed in config.log osdep: Remove local definition of macro offsetof libcacard: Spelling and grammar fixes in documentation Spelling fixes in comments (it's -> its) vnc: Add break statement libcacard: Use format specifier %u instead of %d for unsigned values Fix sign of sscanf format specifiers block/vmdk: Fix warning from splint (comparision of unsigned value) qmp: Fix spelling fourty -> forty qom: Fix spelling in documentation sh7750: Remove redundant 'struct' from MemoryRegionOps
2012-03-09Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori12-242/+742
* qemu-kvm/uq/master: kvm: fill in padding to help valgrind kvm: x86: Add user space part for in-kernel i8254 kvm: Add kvm_has_pit_state2 helper i8254: Open-code timer restore i8254: Factor out base class for KVM reuse
2012-03-09Merge remote-tracking branch 'kraxel/usb.42' into stagingAnthony Liguori8-143/+203
* kraxel/usb.42: xhci: fix port status xhci: fix control xfers usb: add shortcut for control transfers usb-host: enable pipelineing for bulk endpoints. usb: add pipelining option to usb endpoints usb: queue can have async packets uhci_fill_queue: zap debug printf usb: add USB_RET_IOERROR usb: return BABBLE rather then NAK when we receive too much data usb-ehci: Cleanup itd error handling usb-ehci: Fix and simplify nakcnt handling usb-ehci: Remove dead nakcnt code usb-ehci: Fix cerr tracking usb-ehci: Any packet completion except for NAK should set the interrupt usb-ehci: Rip the queues when the async or period schedule is halted usb-ehci: Drop cached qhs when the doorbell gets rung usb-ehci: always call ehci_queues_rip_unused for period queues usb-ehci: split our qh queue into async and periodic queues usb-ehci: Never follow table entries with the T-bit set usb-redir: Set ep type and interface
2012-03-09libcacard: Fix compilation with gcc-4.7Hans de Goede1-2/+2
VCARD_ATR_PREFIX is used as part of an array initializer so it should not have () around it, so far this happened to work, but gcc-4.7 does not like it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-09xilinx_zynq: fix the buildAnthony Liguori1-2/+2
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-08configure: Quote the configure args printed in config.logPeter Maydell1-1/+3
Use the same mechanism we use for printing the configure command line to config-host.mak to print it to config.log. This fixes a bug where the config.log version didn't quote arguments with spaces. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-08osdep: Remove local definition of macro offsetofStefan Weil2-17/+0
The macro offsetof is defined in stddef.h. It is conforming to the standards C89, C99 and POSIX.1-2001 (see man page), so it is a sufficiently old standard. Therefore chances are very high that QEMU never needs a local definition of this macro. osdep.h already includes stddef.h, so this patch simply removes the unneeded code from the files configure and osdep.h. If we ever need the local definition again, it should be added to compiler.h (the macro is usually provided with the compiler, it is not OS specific). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-08libcacard: Spelling and grammar fixes in documentationStefan Weil1-13/+13
* it's -> its * it's -> it is (that's no fix, but makes future checks easier) * this functions -> this function * replacable -> replaceable * reader's -> readers * logins into -> logs into v2: Also replace 'aid' by 'AID' (thanks to Peter Maydell for this hint). v3: Fix sentence (contributed by Alon Levy / Robert Relyea). Cc: Alon Levy <alevy@redhat.com> Cc: Robert Relyea <rrelyea@redhat.com> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-08Spelling fixes in comments (it's -> its)Stefan Weil9-10/+10
* it's -> its (fixed for all files) * dont -> don't (only fixed in a line which was touched by the previous fix) * distrub -> disturb (fixed in the same line) Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-08vnc: Add break statementStefan Weil1-0/+1
This was not a bug, but it is not common practice to omit the break statement from the last case statement before an empty default case. Any change of the default case would introduce a bug. This was reported as a warning by splint. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-08libcacard: Use format specifier %u instead of %d for unsigned valuesStefan Weil1-10/+10
splint reported warnings for those code statements. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-07Fix sign of sscanf format specifiersStefan Weil1-1/+2
All values read by sscanf are unsigned, so replace %d by %u. This signed / unsigned mismatch was detected by splint. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-07block/vmdk: Fix warning from splint (comparision of unsigned value)Stefan Weil1-1/+1
l1_entry_sectors will never be less than 0. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-07qmp: Fix spelling fourty -> fortyStefan Weil1-2/+2
This was found by codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-07qom: Fix spelling in documentationStefan Weil1-1/+1
This fixes a new spelling issue which was detected by codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-07sh7750: Remove redundant 'struct' from MemoryRegionOpsStefan Weil2-2/+2
The 'struct' is not needed, and all other MemoryRegionOps don't use it. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-07xhci: fix port statusGerd Hoffmann1-1/+1
Don't signal port status change if the usb device isn't in attached state. Happens with usb-host devices with the pass-through device being plugged out at the host. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07xhci: fix control xfersGerd Hoffmann1-8/+5
Use the new, direct control transfer submission method instead of bypassing the usb core by calling usb_device_handle_control directly. The later fails for async control transfers. This patch gets xhci + usb-host combo going.
2012-03-07usb: add shortcut for control transfersGerd Hoffmann2-0/+60
Add a more direct code path to submit control transfers. Instead of feeding three usb packets (setup, data, ack) to usb_handle_packet and have the do_token_* functions in usb.c poke the control transfer parameters out of it just submit a single packet carrying the actual data with the control xfer parameters filled into USBPacket->parameters. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb-host: enable pipelineing for bulk endpoints.Gerd Hoffmann1-0/+3
We really don't want to wait for packets finish before submitting the next, we want keep the data flow running. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb: add pipelining option to usb endpointsGerd Hoffmann2-1/+12
With this patch applied USB drivers can enable pipelining per endpoint. With pipelining enabled the usb core will continue submitting packets even when there are still async transfers in flight instead of passing them on one by one. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb: queue can have async packetsGerd Hoffmann1-0/+3
This can happen today in case the ->complete() callback queues up the next packet. Also we'll support pipelining soon, which allows to have multiple packets per queue in flight (aka ASYNC) state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07uhci_fill_queue: zap debug printfGerd Hoffmann1-1/+0
2012-03-07usb: add USB_RET_IOERRORHans de Goede6-10/+19
We already have USB_RET_NAK, but that means that a device does not want to send/receive right now. But with host / network redirection we can actually have a transaction fail due to some io error, rather then ie the device just not having any data atm. This patch adds a new error code named USB_RET_IOERROR for this, and uses it were appropriate. Notes: -Currently all usb-controllers handle this the same as NODEV, but that may change in the future, OHCI could indicate a CRC error instead for example. -This patch does not touch hw/usb-musb.c, that is because the code in there handles STALL and NAK specially and has a if status < 0 generic catch all for all other errors Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb: return BABBLE rather then NAK when we receive too much dataHans de Goede2-3/+9
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb-ehci: Cleanup itd error handlingHans de Goede1-14/+14
All error statuses except for NAK are handled in a switch case, move the handling of NAK into the same switch case. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>