aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-05-04Fix cpu list("-cpu ?") breakage, spotted by TeLeManBlue Swirl3-6/+14
Fix breakage by 04c9a0cbc2bf496889cef6da2d61bf00ef190a4f. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-04vnc: make sure to send pointer type change event on SetEncodingsAnthony Liguori1-0/+2
Commit 37c34d9d5d87ea9d51760310c8863b82cb8c055a introduced a regression when using relative mouse mode with a client that understands the PointerTypeChange pseudo-encoding. Reported-by: Marcelo Tosatti <mtosatti@redhat.com> Reported-by: Gerhard Wiesinger <lists@wiesinger.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03hw: better i440 emulationBernhard M. Wiedemann3-3/+8
updated version of an old patch http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch that together with http://www.mail-archive.com/linuxbios@linuxbios.org/msg02390.html (which is already in coreboot trunk) allows coreboot to autodetect the amount of RAM within qemu/kvm from a register in i440 northbridge. The message on the old patch states: Unfortunately the current version of qemu does not set these registers, but I have patched qemu so that it emulates the i440 more faithfully in this regard. Signed-off-by: Bernhard M. Wiedemann <qemudevbmw@lsmod.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03block: read-only: open cdrom as read-only when using monitor's change commandNaphtali Sprei1-1/+3
Current code of monitor command: 'change', used to open file for read-write uncoditionally. Change to open it as read-only for CDROM, and read-write for all others. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03fix whitespace bogon in some versions of makeNathan Froyd1-1/+1
With three different make binaries I have available, configuring a pristine QEMU tree and attempting to make gives the cryptic: Makefile:27: *** missing separator. Stop. This patch fixes it (presumably because it makes the output of `set-vpath' be an empty string, rather than a bit of whitespace), but I don't understand why this hasn't been a problem for other folks before. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03Changes to usb-linux to conform to coding styleDavid Ahern1-149/+224
Signed-off-by: David Ahern <daahern@cisco.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03Add KVM CFLAGS to vhost buildJan Kiszka1-1/+1
The configure test of vhost uses KVM CFLAGS, so the build must use them as well. Otherwise we specifically miss what --kerneldir provides. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03QMP: Introduce RESUME eventLuiz Capitulino4-0/+17
It's emitted when the Virtual Machine resumes execution. We currently have the STOP event but don't have the matching RESUME one, this means that clients are notified when the VM is stopped but don't get anything when it resumes. Let's fix that as it's already causing some trouble to libvirt. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Create a syntactic shortcut for the file-system pass-thruGautham R Shenoy4-0/+114
Currently the commandline to create a virtual-filesystem pass-through between the guest and the host is as follows: #qemu -fsdev fstype,id=ID,path=path/to/share \ -device virtio-9p-pci,fsdev=ID,mount_tag=tag \ This patch provides a syntactic short-cut to achieve the same as follows: #qemu -virtfs fstype,path=path/to/share,mount_tag=tag This will be internally expanded as: #qemu -fsdev fstype,id=tag,path=path/to/share, \ -device virtio-9p-pci,fsdev=tag,mount_tag=tag \ Signed-off-by: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TFLUSH supportAnthony Liguori1-33/+2
Don't do anything special for flush. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TREMOVE support.Anthony Liguori3-2/+55
Implement P9_TREMOVE support. This gets file deletion to work. [mohan@in.ibm.com: Fix truncate to use the relative path] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TWSTAT supportAnthony Liguori3-2/+326
Implement P9_TWSTAT support. This gets file and directory creation to work. [jvrao@linux.vnet.ibm.com: strdup to qemu_strdup conversion] [aneesh.kumar@linux.vnet.ibm.com: v9fs_fix_path] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TCREATE supportAnthony Liguori3-2/+357
Implement P9_TCREATE support. [jvrao@linux.vnet.ibm.com: strdup to qemu_strdup conversion] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TWRITE supportAnthony Liguori3-2/+118
Implement P9_TWRITE support. This gets write to file to work Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TCLUNK supportAnthony Liguori1-2/+14
Implement P9_TCLUNK support. This patch gets `ls -al` to work. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TREAD supportAnthony Liguori3-2/+275
Implement P9_TREAD support. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TOPEN support.Anthony Liguori3-5/+162
Implement P9_TOPEN support. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TWALK supportAnthony Liguori1-2/+171
Implement P9_TWALK support. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TSTAT supportAnthony Liguori1-2/+53
Implement P9_TSTAT support. This get the mount to work on the guest. [kiran@linux.vnet.ibm.com: malloc to qemu_malloc conversion] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TATTACH support.Anthony Liguori1-2/+31
Implement P9_TATTACH support. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add P9_TVERSION supportAnthony Liguori1-2/+13
Implement P9_TVERSION support. [sripathik@in.ibm.com: Handle unknown 9P versions as per the standards] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add sg helper functionsAnthony Liguori1-0/+53
Add scatter-gather helper functions. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add stat and mode related helper functions.Anthony Liguori1-0/+186
Add helpers to obtain file stat and mode details. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add fid and qid management support.Anthony Liguori1-0/+123
Helper APIs for FID and QID management. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add minimal set of FileOperationsAnthony Liguori3-2/+124
Add minimal set of FileOperations and the corresponding implementations for local fstype. These will be required for the FID management patches later on. [aneesh.kumar@linux.vnet.ibm.com: rpath fix ] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add string manipulation support.Anthony Liguori1-0/+127
Add helpers to do string manipulation. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: pdu processing support.Anthony Liguori2-0/+250
Add helpers to process the PDUs. [kiran@linux.vnet.ibm.com: malloc to qemu_malloc coversion] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Add a virtio 9p device to qemuAnthony Liguori10-1/+1042
This patch doesn't implement the 9p protocol handling code. It adds a simple device which dump the protocol data. [jvrao@linux.vnet.ibm.com: Little-Endian to host format conversion] [aneesh.kumar@linux.vnet.ibm.com: Multiple-mounts support] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Create a commandline option -fsdevGautham R Shenoy9-1/+242
This patch creates a new command line option named -fsdev to hold any file system specific information. The option will currently hold the following attributes: -fsdev fstype id=id,path=path_to_share where fstype: Type of the file system. id: Identifier used to refer to this fsdev path: The path on the host that is identified by this fsdev. [aneesh.kumar@linux.vnet.ibm.com: Abstraction using FsContext] Signed-off-by: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-serial: Fix check for 'assert'; prevent NULL derefsAmit Shah1-1/+1
In the flush_queued_data() function, we expect port to be valid. Assert only for port and not port || discard. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03Fix the RARP protocol IDStefan Berger1-1/+1
The packet(s) sent out after migration are supposed to be RAPR type of packets. If they are supposed to go anywhere useful, the RAPR ethernet identifier needs to be fix. Also see http://www.iana.org/assignments/ethernet-numbers for 0x8035 for RARP. Signed-off-by: Stefan Berger <stefanb@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03Fix tiny leak in qemu_opts_parseJan Kiszka1-2/+2
qemu_opts_create duplicates the id we pass in case it shall be stored in the opts. So we do not need to dup it in qemu_opts_parse, leaking a few bytes this way. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03lsi: Properly initialize controller state on resetJan Kiszka1-2/+8
The LSI controller was lacking a system reset handler. Simply invoke the existing soft reset handler in this case. This also allows to drop its explicit invocation during init. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03lsi: Purge request queue on soft resetJan Kiszka1-0/+11
Avoid keeping zombie requests across controller reset by purging the queue and also dropping the currently active request. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03Fix boot once optionAlex Williamson1-0/+7
The boot once options seems to have gotten broken since it originally went in. We need to wait until the second time restore_boot_devices() gets called before restoring the standard boot order and removing itself from the reset list. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> -- Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03vnc: split encoding in specific filesCorentin Chary6-211/+300
This will allow to implement new encodings (tight, zrle, ..) in a cleaner way. This may hurt performances, because some functions like vnc_convert_pixel are not static anymore, but should not be a problem with gcc 4.5 and the new -flto. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03vnc: Fix compile error on x86_64 with -D_VNC_DEBUG=1Corentin Chary1-1/+2
cc1: warnings being treated as errors vnc-auth-sasl.c: In function ‘vnc_client_write_sasl’: vnc-auth-sasl.c:50: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’ vnc-auth-sasl.c:50: error: format ‘%d’ expects type ‘int’, but argument 5 has type ‘size_t’ make: *** [vnc-auth-sasl.o] Error 1 Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03Merge remote branch 'kwolf/for-anthony' into HEADAnthony Liguori28-494/+843
2010-05-03Merge remote branch 'qemu-kvm/uq/master' into HEADAnthony Liguori7-20/+166
2010-05-03block: Release allocated options after bdrv_openJan Kiszka1-0/+1
They aren't used afterwards nor supposed to be stored by a bdrv_create handler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-03qemu-img rebase: Fix output image corruptionKevin Wolf1-3/+3
qemu-img rebase must always give clusters in the COW file priority over those in the backing file. As it failed to use number of non-allocated clusters but assumed the maximum, it was possible that allocated clusters were taken from the backing file instead, leading to a corrupted output image. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-03block: Add wr_highest_sector blockstatKevin Wolf2-15/+59
This adds the wr_highest_sector blockstat which implements what is generally known as the high watermark. It is the highest offset of a sector written to the respective BlockDriverState since it has been opened. The query-blockstat QMP command is extended to add this value to the result, and also to add the statistics of the underlying protocol in a new "parent" field. Note that to get the "high watermark" of a qcow2 image, you need to look into the wr_highest_sector field of the parent (which can be a file, a host_device, ...). The wr_highest_sector of the qcow2 BlockDriverState itself is the highest offset on the _virtual_ disk that the guest has written to. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-03qcow2: Implement bdrv_truncate() for growing imagesStefan Hajnoczi2-4/+48
This patch adds the ability to grow qcow2 images in-place using bdrv_truncate(). This enables qemu-img resize command support for qcow2. Snapshots are not supported and bdrv_truncate() will return -ENOTSUP. The notion of resizing an image with snapshots could lead to confusion: users may expect snapshots to remain unchanged, but this is not possible with the current qcow2 on-disk format where the header.size field is global instead of per-snapshot. Others may expect snapshots to change size along with the current image data. I think it is safest to not support snapshots and perhaps add behavior later if there is a consensus. Backing images continue to work. If the image is now larger than its backing image, zeroes are read when accessing beyond the end of the backing image. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-03qcow2: Remove abort on free_clusters failureKevin Wolf1-1/+1
While it's true that during regular operation free_clusters failure would be a bug, an I/O error can always happen. There's no need to kill the VM, the worst thing that can happen (and it will) is that we leak some clusters. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-03qemu-img: Add 'resize' command to grow/shrink disk imagesStefan Hajnoczi3-0/+110
This patch adds a 'resize' command to grow/shrink disk images. This allows changing the size of disk images without copying to a new image file. Currently only raw files support resize. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-03block: Cache total_sectors to reduce bdrv_getlength callsStefan Hajnoczi1-5/+38
The BlockDriver bdrv_getlength function is called from the I/O code path when checking that the request falls within the device. Unfortunately this involves an lseek system call in the raw protocol; every read or write request will incur this lseek cost. Jan Kiszka <jan.kiszka@siemens.com> identified this issue and its latency overhead. This patch caches device length in the existing total_sectors variable so lseek calls can be avoided for fixed size devices. Growable devices fall back to the full bdrv_getlength code path because I have not added logic to detect extending the size of the device in a write. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-03raw-posix: Use pread/pwrite instead of lseek+read/writeStefan Hajnoczi1-33/+4
This patch combines the lseek+read/write calls to use pread/pwrite instead. This will result in fewer system calls and is already used by AIO. Thanks to Jan Kiszka <jan.kiszka@siemens.com> for identifying excessive lseek and Christoph Hellwig <hch@lst.de> for confirming that this approach should work. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-03qcow2: Avoid shadowing variable in alloc_clusters_noref()Stefan Hajnoczi1-2/+2
The i loop iterator is shadowed by the next free cluster index. Both using the variable name 'i' makes the code harder to read. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-03block: Set backing_hd to NULL after deleting itStefan Hajnoczi1-1/+3
It is safer to set backing_hd to NULL after deleting it so that any use after deletion is obvious during development. Happy segfaulting! This patch should be applied after Kevin Wolf's "vmdk: Convert to bdrv_open" so that vmdk does not segfault on close. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-03vmdk: Convert to bdrv_openKevin Wolf1-30/+21
It's a format driver, so implement bdrv_open instead of bdrv_file_open. Signed-off-by: Kevin Wolf <kwolf@redhat.com>