summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-09-20rbd: allow escaping in config stringSage Weil1-2/+27
The config string is variously delimited by =, @, and /, depending on the field. Allow these characters to be escaped by preceeding them with \. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20linux-aio: remove process requests callbackPaolo Bonzini1-10/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20block: avoid SIGUSR2Frediano Ziglio2-29/+9
Now that iothread is always compiled sending a signal seems only an additional step. This patch also avoid writing to two pipe (one from signal and one in qemu_service_io). Work with kvm enabled or disabled. strace output is more readable (less syscalls). [ kwolf: Merged build fix by Paolo Bonzini ] Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20scsi: fix sign extension problemsPaolo Bonzini1-15/+7
When assigning a 32-bit value to cmd->xfer (which is 64-bits) it can be erroneously sign extended because the intermediate 32-bit computation is signed. Fix this by standardizing on the ld*_be_p functions. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20rbd: call flush, if availableSage Weil1-0/+12
librbd recently added async writeback and flush support. If the new rbd_flush() call is available, call it. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20rbd: update comment headingSage Weil1-15/+13
Properly document the configuration string syntax and semantics. Remove (out of date) details about the librbd implementation. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20rbd: ignore failures when reading from default conf locationSage Weil1-10/+4
If we are reading from the default config location, ignore any failures. It is perfectly legal for the user to specify exactly the options they need and to not rely on any config file. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20AHCI Port Interrupt Enable register cleaning on soft resetAlexander Motin1-3/+5
I've found that FreeBSD AHCI driver doesn't work with AHCI hardware emulation of QEMU 0.15.0. I believe the problem is on QEMU's side. As I see, it clears port's Interrupt Enable register each time when reset of any level happens. Is is reasonable for the global controller reset. It is probably not good, but acceptable for FreeBSD driver for the port hard reset. But it is IMO wrong for the device soft reset. None of real hardware I know behaves that way. Signed-off-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20posix-aio-compat: Removed unused offset variableFrediano Ziglio1-3/+2
Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20VMDK: fix leak of extent_fileFam Zheng1-4/+10
Release extent_file on error in vmdk_parse_extents. Added closing files in freeing extents. Signed-off-by: Fam Zheng <famcool@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20scsi-disk: lazily allocate bounce bufferPaolo Bonzini1-11/+33
It will not be needed for reads and writes if the HBA provides a sglist. In addition, this lets scsi-disk refuse commands with an excessive allocation length, as well as limit memory on usual well-behaved guests. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20scsi-disk: commonize iovec creation between reads and writesPaolo Bonzini1-24/+18
Also, consistently use qiov.size instead of iov.iov_len. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20dma-helpers: rewrite completion/cancellationPaolo Bonzini1-13/+31
This fixes various problems with completion/cancellation: * if the io_func fails to get an AIOCB, the callback wasn't called * If DMA encounters a bounce buffer conflict, and the DMA operation is canceled before the bottom half fires, bad things happen. * memory is not unmapped after cancellation, again causing problems when doing DMA to I/O areas * cancellation could leak the iovec * the callback was missed if the I/O operation failed without returning an AIOCB and probably more that I've missed. The patch fixes them by sharing the cleanup code between completion and cancellation. The dma_bdrv_cb now returns a boolean completed/not completed flag, and the wrapper dma_continue takes care of tasks to do upon completion. Most of these are basically impossible in practice, but it is better to be tidy... Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-20dma-helpers: allow including from target-independent codePaolo Bonzini1-2/+6
Target-independent code cannot construct sglists, but it can take them from the outside as a black box. Allow this. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-19dma-helpers: rename is_write to to_devPaolo Bonzini4-10/+10
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-19scsi-generic: do not disable FUAPaolo Bonzini1-6/+0
I found no rationale for this in the logs, and it is quite bad because it will make scsi-generic unsafe WRT power failures. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-19raw-posix: Fix bdrv_flush error return valuesKevin Wolf1-1/+8
bdrv_flush is supposed to use 0/-errno return values Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-19nbd: support NBD_SET_FLAGS ioctlPaolo Bonzini1-0/+8
The nbd kernel module cannot enable DISCARD requests unless it is informed about it. The flags field in the header is used for this, and this patch adds support for it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-19nbd: sync API definitions with upstreamPaolo Bonzini2-1/+12
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-19nbd: support feature negotiationPaolo Bonzini4-19/+39
nbd supports writing flags in bytes 24...27 of the header, and uses that for the read-only flag. Add support for it in qemu-nbd. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-18sun4u: don't set up isa_mem_baseBlue Swirl1-1/+0
Since we use memory API in sun4u.c, after 71579cae30b53c910cd6c47ab4e683f647d36519, setting up isa_mem_base puts vga.chain4 outside of the physical address space. Fix by removing obsolete isa_mem_base set up. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-17tcg/ppc64: Only one call output register needed for 64 bit hostsStefan Weil1-1/+1
The second register is only needed for 32 bit hosts. Cc: Vassili Karpov <av1474@comtv.ru> Fine-with-me'd-by: Vassili Karpov <av1474@comtv.ru> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-17tcg/sparc: Only one call output register needed for 64 bit hostsStefan Weil1-2/+4
The second register is only needed for 32 bit hosts. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-17tcg/s390: Only one call output register needed for 64 bit hostsStefan Weil1-1/+3
The second register is only needed for 32 bit hosts. Cc: Alexander Graf <agraf@suse.de> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-17tcg/ia64: Only one call output register needed for 64 bit hostsStefan Weil1-3/+2
The second register is never used for ia64 hosts. Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-17tcg/i386: Only one call output register needed for 64 bit hostsStefan Weil1-1/+3
The second register is only needed for 32 bit hosts. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-17target-i386: Fix several SSE3 instructions.Max Reitz1-18/+18
haddp[sd], hsubp[sd] and addsubp[sd] operate on floats, thus it is necessary to use the appropriate floating point calculation functions. If this is not done, those functions operate merely on integers, which is not correct. Signed-off-by: Max Reitz <max@tyndur.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-17trace: add virtio_set_status() trace eventStefan Hajnoczi3-8/+12
The virtio device lifecycle can be observed by looking at the sequence of set status operations. This is especially important for catching the reset operation (status value 0), which resets the device and all virtqueues. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-17trace: remove trailing double quotes after PRI*64Stefan Hajnoczi1-17/+17
Now that format strings can end in a PRI*64 macro, remove the workarounds from the trace-events file. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-17trace: allow PRI*64 at beginning and ending of format stringStefan Hajnoczi2-11/+14
The tracetool parser only picks up PRI*64 and other format string macros when enclosed between double quoted strings. Lift this restriction by extracting everything after the closing ')' as the format string: cpu_set_apic_base(uint64_t val) "%016"PRIx64 ^^ ^^ One trick here: it turns out that backslashes in the format string like "\n" were being interpreted by echo(1). Fix this by using the POSIX printf(1) command instead. Although it normally does not make sense to include backslashes in trace event format strings, an injected newline causes tracetool to emit a broken header file and I want to eliminate cases where broken output is emitted, even if the input was bad. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-17trace: remove newline from grlib_irqmp_check_irqs format stringStefan Hajnoczi1-1/+1
There is no need to put a newline in trace event format strings. The backend may use the format string within some context and takes care of how to display the event. The stderr backend automatically appends "\n" whereas the ust backend does not want a newline at all. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-17Makefile: Fix broken buildStefan Weil1-2/+2
make -C mybuilddir no longer works (regression caused by commit) 388d475815c23901010a25c845eb078d47ee0740. PWD is the directory of the caller (not mybuilddir), so BUILD_DIR is set to the wrong value. GNU make sets CURDIR to the correct value. Use this macro instead of PWD. Cc: Lluís Vilanova <vilanova@ac.upc.edu> Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-16qdev: print bus properties tooGerd Hoffmann1-0/+6
Make qdev_device_help print both device and bus properties. Helps libvirt to figure whenever bus properties such as PCI.multifunction are supported present or not. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-16vga: Respect isa_mem_base when registering chain4 aliasJan Kiszka1-0/+1
This does not yet unbreak PPC (which has its own problems) but potentially other non-x86 systems where isa_mem_base is != 0. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-16hw/integratorcp: Fix bugs in writes to CM_CTRL system registerPeter Maydell1-5/+11
Fix a number of bugs in the implementation of writes to the CM_CTRL system register: * write to cm_ctrl, not cm_init ! * an '&' vs '^' typo meant we would write the inverse of the bits * handling the LED via printf() meant we spew lots of output to stdout when Linux uses the LED as a heartbeat indicator * we would hw_error() if a reset was requested rather than actually resetting Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-16bswap.h: build fixChristoph Egger1-2/+1
qemu build fails when CONFIG_MACHINE_BSWAP_H is defined because float32, float64, etc. are not defined. This makes qemu build. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-16console: Properly switch consoles for screen dumpsJan Kiszka1-3/+10
Do not mess with active_console, use console_select instead. This fixes corrupt virtual monitor consoles after issuing the screendump command. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-16vga: Fix text mode screendumpsJan Kiszka1-4/+3
In text mode, even a full refresh of the screen takes multiple updates. As we reset the dump file pointer after the first call, we only wrote the first line. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-16Fix termination by signal with -no-shutdownKevin Wolf1-0/+1
On signals such as SIGTERM qemu should exit instead of just stopping the VM even with -no-shutdown. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-16Remove blanks before \n in output stringsStefan Weil16-41/+41
Those blanks violate the coding conventions, see scripts/checkpatch.pl. Blanks missing after colons in the changed lines were added. This patch does not try to fix tabs, long lines and other problems in the changed lines, therefore checkpatch.pl reports many violations. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-16build: Move tracing objects into libuser on usermode emulation targetsLluís Vilanova4-5/+9
This will apply libuser-specific compilation flags (like the ones added by --enable-user-pie), but keep softmmu emulation targets "as-is". Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-16build: Always have 'BUILD_DIR' variable pointing to the root of the build treeLluís Vilanova1-1/+4
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-15Merge remote-tracking branch 'qemu-kvm-tmp/memory/core' into stagingAnthony Liguori1-2/+2
2011-09-15Merge remote-tracking branch 'aneesh/for-upstream-4' into stagingAnthony Liguori2-0/+130
2011-09-14Fix subtle integer overflow bug in memory APIDavid Gibson1-2/+2
It is quite common to have a MemoryRegion with size of INT64_MAX. When processing alias regions in render_memory_region() it's quite easy to find a case where it will construct a temporary AddrRange with a non-zero start, and size still of INT64_MAX. When means attempting to compute the end of such a range as start + size will result in signed integer overflow. This integer overflow means that addrrange_intersects() can incorrectly report regions as not intersecting when they do. For example consider the case of address ranges {0x10000000000, 0x7fffffffffffffff} and {0x10010000000, 0x10000000} where the second is in fact included completely in the first. This patch rearranges addrrange_intersects() to avoid the integer overflow, correcting this behaviour. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-09-12qcow2: fix range checkFrediano Ziglio1-7/+7
QCowL2Meta::offset is not cluster aligned but only sector aligned however nb_clusters count cluster from cluster start. This fix range check. Note that old code have no corruption issues related to this check cause it only cause intersection to occur when shouldn't. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-12qcow2: align cluster_data to block to improve performance using O_DIRECTFrediano Ziglio1-7/+7
Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-12ahci: Remove unused struct memberStefan Weil2-3/+0
Member variable is_read is written, but never read (contrary to its name). Remove it. Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-12qcow2: initialize metadata before inserting in cluster_allocsFrediano Ziglio1-5/+5
QCow2Meta structure was inserted into list before many fields are initialized. Currently is not a problem cause all occur in a lock but if qcow2_alloc_clusters would in a future unlock this lock some issues could arise. Initializing fields before inserting fix the problem. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-12ide/atapi scsi-disk: Make monitor eject -f, then change workMarkus Armbruster3-1/+4
change fails while the tray is locked by the guest. eject -f forces it open and removes any media. Unfortunately, the tray closes again instantly. Since the lock remains as it is, there is no way to insert another medium unless the guest voluntarily unlocks. Fix by leaving the tray open after monitor eject. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>