- May 04, 2011
-
- May 03, 2011
-
-
Christoph Hellwig authored
Like all block drivers virtio-blk should not allow small than block size granularity access. But given that the protocol specifies a byte unit length field we currently accept such requests, which cause qemu to abort() in lower layers. Add checks to the main read and write handlers to catch them early. Reported-by:
Conor Murphy <conor_murphy_virt@hotmail.com> Tested-by:
Conor Murphy <conor_murphy_virt@hotmail.com> Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Stefan Hajnoczi authored
The qed_bytes_to_clusters() function is normally used with size_t lengths. Consistency check used it with file size length and therefore failed on 32-bit hosts when the image file is 4 GB or more. Make qed_bytes_to_clusters() explicitly 64-bit and update consistency check to keep 64-bit cluster counts. Reported-by:
Michael Tokarev <mjt@tls.msk.ru> Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Michael Tokarev authored
This fixes the problem when qemu continues even if -drive specification is somehow invalid, resulting in a mess. Applicable for both current master and for stable-0.14 (and the same issue exist 0.13 and 0.12 too). The prob can actually be seriuos: when you start guest with two drives and make an error in the specification of one of them, and the guest has something like a raid array on the two drives, guest may start failing that array or kick "missing" drives which may result in a mess - this is what actually happened to me, I did't want a resync at all, and a resync resulted in re-writing (and allocating) a 4TB virtual drive I used for testing, which in turn resulted in my filesystem filling up and whole thing failing badly. Yes it was just testing VM, I experimented with larger raid arrays, but the end result was quite, well, unexpected. Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru> Acked-by:
Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Michael S. Tsirkin authored
vhost was passing a physical address to cpu_physical_memory_set_dirty, which is wrong: we need to translate to ram address first. Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> Note: this lead to crashes during migration, so the patch is needed on the stable branch too.
-
Ryan Harper authored
When removing a drive from the host-side via drive_del we currently have the following path: drive_del qemu_aio_flush() bdrv_close() // zaps bs->drv, which makes any subsequent I/O get // dropped. Works as designed drive_uninit() bdrv_delete() // frees the bs. Since the device is still connected to // bs, any subsequent I/O is a use-after-free. The value of bs->drv becomes unpredictable on free. As long as it remains null, I/O still gets dropped, however it could become non-null at any point after the free resulting SEGVs or other QEMU state corruption. To resolve this issue as simply as possible, we can chose to not actually delete the BlockDriverState pointer. Since bdrv_close() handles setting the drv pointer to NULL, we just need to remove the BlockDriverState from the QLIST that is used to enumerate the block devices. This is currently handled within bdrv_delete, so move this into its own function, bdrv_make_anon(). The result is that we can now invoke drive_del, this closes the file descriptors and sets BlockDriverState->drv to NULL which prevents futher IO to the device, and since we do not free BlockDriverState, we don't have to worry about the copy retained in the block devices. We also don't attempt to remove the qdev property since we are no longer deleting the BlockDriverState on drives with associated drives. This also allows for removing Drives with no devices associated either. Reported-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Ryan Harper <ryanh@us.ibm.com> Acked-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- Apr 10, 2011
-
-
Michael Tokarev authored
fix 2Gb integer overflow in in VNC tight and zlib encodings As found by Roland Dreier <roland@purestorage.com> (excellent catch!), when amount of VNC compressed data produced by zlib and sent to client exceeds 2Gb, integer overflow occurs because currently, we calculate amount of data produced at each step by comparing saved total_out with new total_out, and total_out is something which grows without bounds. Compare it with previous avail_out instead of total_out, and leave total_out alone. The same code is used in vnc-enc-tight.c and vnc-enc-zlib.c, so fix both cases. There, there's no actual need to save previous_out value, since capacity-offset (which is how that value is calculated) stays the same so it can be recalculated again after call to deflate(), but whole thing becomes less readable this way. Reported-by:
Roland Dreier <roland@purestorage.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru> Signed-off-by:
Corentin Chary <corentin.chary@gmail.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Apr 09, 2011
-
-
Atsushi Nemoto authored
On Mon, 4 Apr 2011 20:15:30 +0200, Aurelien Jarno <aurelien@aurel32.net> wrote: > Is it really safe ignoring write to this register? If yes, it's probably > a good idea to explain why in a comment. In any case, if supporting this > register is easy to do, it would be the best option. I think it is safe. Please see an updated comment below. And though implementing this register might be possible, I suppose it is not worth to supporting FrameTooLong detection, for now at least. Thank you for comments. >8--------------------------------------------------------------------- From: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Date: Tue, 5 Apr 2011 23:12:07 +0900 Subject: [PATCH] lan9118: Ignore write to MAC_VLAN1 register Since linux 2.6.38, smsc911x driver writes to VLAN1 registger. Since this register only affects FrameTooLong detection, ignoring write to this register should be safe. Signed-off-by:
Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit a0313c00)
-
- Apr 04, 2011
-
-
Ryan Harper authored
If the block device has been closed, we no longer have a medium to submit IO against, check for this before submitting io. This prevents a segfault further in the code where we dereference elements of the block driver. Signed-off-by:
Ryan Harper <ryanh@us.ibm.com> Reviewed-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- Apr 01, 2011
-
-
Bernhard Kohl authored
If these messages are not handled correctly the guest driver may hang. Always mandatory: - ABORT - BUS DEVICE RESET Mandatory if tagged queuing is implemented (which disks usually do): - ABORT TAG - CLEAR QUEUE Signed-off-by:
Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 508240c0)
-
- Mar 29, 2011
-
-
Michael S. Tsirkin authored
Commit c81131db detects old guests by comparing virtio and PCI status. It attempts to do this on load, as well, but load_config callback in a binding is invoked too early and so the virtio status isn't set yet. We could add yet another callback to the binding, to invoke after load, but it seems easier to reuse the existing vmstate callback. Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> Cc: Alexander Graf <agraf@suse.de> (cherry picked from commit 89c473fd)
-
René Rebe authored
Fix applesmc REV key string literal hex encoding. Signed-off-by:
René Rebe <rene@exactcode.de> Acked-by:
Alexander Graf <agraf@suse.de> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 7f90fa77)
-
Aurelien Jarno authored
rbd support tries to both link with -lrados and -lcrypto. While the first one is of course necessary, the second is not necessary (only librados ifself needs to link with libcrypto). This fixes a licensing issue: qemu as a whole is GPL v2, and thus can't be linked with OpenSSL without an exception in the license, which seems difficult to get given the number of persons involved. Cc: Christian Brunner <chb@muc.de> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit cc4e8741)
-
- Mar 06, 2011
-
-
Jason Wang authored
Signed-off-by:
Jason Wang <jasowang@redhat.com> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 96c94b29)
-
Stefan Hajnoczi authored
Update not only dbc but also dnad when skipping bytes during the MSGOUT phase. Previously only dbc was updated which is probably wrong and could lead to bogus message codes being read. Tested on Linux and Windows Server 2003. Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 444dd39b)
-
- Mar 04, 2011
-
-
Aurelien Jarno authored
Revert "prep: Disable second IDE channel, as long as ISA IDE emulation doesn't support same irq for both channels" This reverts commit 491e2a33. (cherry picked from commit 81aa0647)
-
- Mar 03, 2011
-
-
Jan Kiszka authored
Nothing prevented IRQ sharing on the ISA bus in principle. Not all boards supported this, neither each and every card nor driver and OS. Still, there existed valid IRQ sharing scenarios, (at least) two of them can also be found in QEMU: >2 PC UARTs and the PREP IDE buses. So remove this artificial restriction from our ISA model. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit ee951a37)
-
Stefan Hajnoczi authored
A pointer to a size_t variable was passed as the void * pointer to lduw_p() in virtio_net_receive(). Instead of acting on the 16-bit value this caused failure on big-endian hosts. Avoid this issue in the future by using stw_p() instead. In general we should use ld*_p() for loading from target memory and st*_p() for storing to target memory anyway, not the other way around. Also tighten up a correct use of lduw_p() when stw_p() should be used instead in virtio_net_get_config(). Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit b46d97f2)
-
- Feb 25, 2011
-
-
Peter Maydell authored
The SD_STATUS and SEND_NUM_WR_BLOCKS commands are supposed to cause the card to send data back to the host. However sd.c was missing the state change to sd_sendingdata_state for these commands, with the effect that the Linux driver would either hang indefinitely waiting for nonexistent data (pl181) or read zeroes and provoke a qemu warning message (omap). Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Stefan Weil authored
Reverse mode is unusable: qemu -vnc localhost:5500,reverse crashes in vnc_refresh_server_surface because some pointers are NULL. Fix this by calling vnc_dpy_resize (which initializes these pointers) before calling vnc_refresh. Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by:
Stefan Weil <weil@mail.berlios.de> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Feb 20, 2011
-
-
Stefan Hajnoczi authored
Check if the backend option is missing before searching the backend table. This fixes a NULL pointer dereference when QEMU is invoked with the following invalid command-line: $ qemu -chardev id=foo,path=/tmp/socket Previously QEMU would segfault, now it produces this error message: chardev: "foo" missing backend Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Feb 16, 2011
-
-
Anthony Liguori authored
Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Feb 14, 2011
-
-
Anthony Liguori authored
Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Anthony Liguori authored
I unfortunately got on an unnamed branch and pushed the wrong bits Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Bruce Rogers authored
Since the addition of the slirp member to struct mbuf, the value of SLIRP_MSIZE and the initialization of m_size have not been correct, resulting in overrunning the end of the malloc'd buffer in some cases. Signed-off-by:
Bruce Rogers <brogers@novell.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
Gleb Natapov authored
TPR blocks all interrupts in a priority class, so simple "less or equal" check is not enough. Signed-off-by:
Gleb Natapov <gleb@redhat.com> Reviewed-by:
Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Feb 11, 2011
-
-
Kevin Wolf authored
When copying L2 tables (this happens only with internal snapshots), the order wasn't completely safe, so that after a crash you could end up with a L2 table that has too low refcount, possibly leading to corruption in the long run. This patch puts the operations in the right order: First allocate the new L2 table and replace the reference, and only then decrease the refcount of the old table. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 16fde5f2)
-
Kevin Wolf authored
Output the error message string of the bdrv_open return code. Also set a non-empty device name for the images because the unknown feature error message includes it. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit b9eaf9ec)
-
Kevin Wolf authored
Instead of just returning -ENOTSUP, generate a more detailed error. Unfortunately we don't have a helpful text for features that we don't know yet, so just print the feature mask. It might be useful at least if someone asks for help. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Anthony Liguori <aliguori@us.ibm.com> Acked-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> (cherry picked from commit 10b758e8)
-
Kevin Wolf authored
The qcow2 driver is now declared responsible for any QCOW image that has version 2 or greater (before this, version 3 would be detected as raw). For everything newer than version 2, an error is reported. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit e8cdcec1)
-
Kevin Wolf authored
Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit f54e3641)
-
Kevin Wolf authored
When reading a compressed cluster failed, qcow2 falsely returned success. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> (cherry picked from commit 8af36488)
-
Kevin Wolf authored
Requests could return success even though they failed when bdrv_aio_readv returned NULL for a backing file read. Reported-by:
Chunqiang Tang <ctang@us.ibm.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 3ab4c7e9)
-
Chunqiang Tang authored
This patch fixes the following bug in QCOW2. For a QCOW2 image that is larger than its base image, when handling a read request straddling over the end of the base image, the QCOW2 driver attempts to read beyond the end of the base image and the request would fail. This bug was found by Fast Virtual Disk (FVD)'s fully automated testing tool. The following test triggered the bug. dd if=/dev/zero of=/var/ramdisk/truth.raw count=0 bs=1 seek=1098561536 dd if=/dev/zero of=/var/ramdisk/zero-500M.raw count=0 bs=1 seek=593099264 ./qemu-img create -f qcow2 -ocluster_size=65536,backing_fmt=blksim -b /var/ramdisk/zero-500M.raw /var/ramdisk/test.qcow2 1098561536 ./qemu-io --auto --seed=30477694 --truth=/var/ramdisk/truth.raw --format=qcow2 --test=blksim:/var/ramdisk/test.qcow2 --verify_write=true --compare_before=false --compare_after=true --round=100000 --parallel=100 --io_size=10485760 --fail_prob=0 --cancel_prob=0 --instant_qemubh=true Signed-off-by:
Chunqiang Tang <ctang@us.ibm.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com> (cherry picked from commit e0d9c6f9)
-
Jes Sorensen authored
Pointed out by Markus Signed-off-by:
Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 982aa955)
-
- Feb 09, 2011
-
-
Stefan Weil authored
Extract from "man realloc": "If realloc() fails the original block is left untouched; it is not freed or moved." Fix a possible memory leak (reported by cppcheck). Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by:
Stefan Weil <weil@mail.berlios.de> Signed-off-by:
Riku Voipio <riku.voipio@nokia.com> (cherry picked from commit 8d79de6e)
-
Stefan Weil authored
Extract from "man realloc": "If realloc() fails the original block is left untouched; it is not freed or moved." Fix a possible memory leak (reported by cppcheck). Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by:
Stefan Weil <weil@mail.berlios.de> Signed-off-by:
Riku Voipio <riku.voipio@nokia.com>
-
Martin Mohring authored
In case a chrooted build uses XEN or KVM, a looped mount needs to be done to setup the chroot. The ioctl for loop mount works correctly for arm, mips, ppc32 and sh4, so its now activated. Signed-off-by:
Riku Voipio <riku.voipio@nokia.com>
-
- Feb 08, 2011
-