[Qemu-devel] [PATCH v3 1/2] main-loop: Introduce context parameter for qemu_poll_ns

2014-10-27 Thread Fam Zheng
So that qemu_poll_ns can save state in the context in the future. Signed-off-by: Fam Zheng --- aio-posix.c | 2 +- include/block/aio.h | 2 ++ include/qemu/timer.h | 7 ++- main-loop.c | 7 +-- qemu-timer.c | 3 ++- 5 files changed, 16 insertions(+), 5 deletion

[Qemu-devel] [PATCH v3 0/2] main-loop: Use epoll on Linux

2014-10-27 Thread Fam Zheng
v3: Use separate structure for poll context instead of AioContext. (Stefan) Fam Zheng (2): main-loop: Introduce context parameter for qemu_poll_ns main-loop: Use epoll on Linux Makefile.objs| 1 + aio-posix.c | 2 +- include/block/aio.h | 2 + include/qe

[Qemu-devel] [PATCH v3 2/2] main-loop: Use epoll on Linux

2014-10-27 Thread Fam Zheng
A new implementation for qemu_poll_ns based on epoll is introduced here to address the slowness of g_poll and ppoll when the number of fds are high. On my laptop this would reduce the virtio-blk on top of null-aio device's response time from 32 us to 29 us with few fds (~10), and 48 us to 32 us wi

Re: [Qemu-devel] [PATCH v14 14/14] iotests: Add test for qcow2's bdrv_make_empty

2014-10-27 Thread Max Reitz
On 2014-10-24 at 18:31, Eric Blake wrote: On 10/24/2014 07:57 AM, Max Reitz wrote: Add a test for qcow2's fast bdrv_make_empty implementation on images without internal snapshots. Signed-off-by: Max Reitz --- tests/qemu-iotests/098 | 82 ++ te

Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable

2014-10-27 Thread Gerd Hoffmann
On Fr, 2014-10-24 at 11:00 +0200, Marc-André Lureau wrote: > The spice server is polling on write, unless > SPICE_CHAR_DEVICE_NOTIFY_WRITABLE flag is set. In this case, qemu must > call spice_server_char_device_wakeup() when the frontend is writable. > > Signed-off-by: Marc-André Lureau > --- >

Re: [Qemu-devel] [question] How is the progress of optimizing qcow2_check_metadata_overlap() with reagard to cpu overhead?

2014-10-27 Thread Max Reitz
On 2014-10-25 at 09:00, Zhang Haoyu wrote: Hi, Max How is the progress of optimizing qcow2_check_metadata_overlap? http://thread.gmane.org/gmane.comp.emulators.kvm.devel/127037/focus=127364 Thanks, Zhang Haoyu Hi Zhang Haoyu, there are still a couple of upstream series I've worked on for som

Re: [Qemu-devel] [PATCH] block: qemu-iotest 107 supports NFS

2014-10-27 Thread Max Reitz
On 2014-10-25 at 17:05, Peter Lieven wrote: As discussed during review a follow up for Max's fix. Signed-off-by: Peter Lieven --- tests/qemu-iotests/107 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCHv4 3/4] block/iscsi: set max_transfer_length

2014-10-27 Thread Max Reitz
On 2014-10-25 at 17:16, Peter Lieven wrote: Am 23.10.2014 um 13:18 schrieb Max Reitz: On 2014-10-16 at 09:54, Peter Lieven wrote: the limit of 0xff for 16 byte CDBs is intentional to avoid overflows on 32-bit architectures. How is it related to 32 bit? I somehow feel like it has to do some

Re: [Qemu-devel] Close the BlockDriverState when guest eject the media

2014-10-27 Thread Markus Armbruster
Eric Blake writes: > On 10/21/2014 12:10 AM, Gonglei wrote: > > There is a problem. > > 1. Qemu receive the "eject" command. > 2. Runs "eject_request_cb" when an eject request is issued from > the monitor, the tray > is closed, and the medium is locked. But the drive is no

Re: [Qemu-devel] [PATCHv5 1/6] util: introduce MIN_NON_ZERO

2014-10-27 Thread Max Reitz
On 2014-10-25 at 18:18, Peter Lieven wrote: at least in block layer we have the case of limits being defined for a BlockDriverState. However, in this context often zero (0) has the special meanining of undefined which means no limit. If two of those limits are combined and the minimum is needed t

Re: [Qemu-devel] [PATCHv5 3/6] block/iscsi: set max_transfer_length

2014-10-27 Thread Max Reitz
On 2014-10-25 at 18:18, Peter Lieven wrote: Copy the max_xfer_len from the BlockLimits VPD or use the maximum value fitting in the CDB. Signed-off-by: Peter Lieven --- block/iscsi.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/block/iscsi.c b/block

Re: [Qemu-devel] [PATCHv5 5/6] block/iscsi: limit to INT_MAX throughout iscsi_refresh_limits

2014-10-27 Thread Max Reitz
On 2014-10-25 at 18:18, Peter Lieven wrote: As Max pointed out there is a hidden cast from int64_t to int. So use the newly introduced nb_sectors_lun2qemu for all limits. Signed-off-by: Peter Lieven --- block/iscsi.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions

Re: [Qemu-devel] [PATCHv5 6/6] block/iscsi: check for oversized requests

2014-10-27 Thread Max Reitz
On 2014-10-25 at 18:18, Peter Lieven wrote: Cancel oversized requests early. They would generate an iSCSI protocol error anyway; after having transferred possibly a lot of data over the wire. Suggested-By: Max Reitz Signed-off-by: Peter Lieven --- block/iscsi.c | 12 1 file c

Re: [Qemu-devel] [PATCHv5 5/6] block/iscsi: limit to INT_MAX throughout iscsi_refresh_limits

2014-10-27 Thread Peter Lieven
On 27.10.2014 09:32, Max Reitz wrote: On 2014-10-25 at 18:18, Peter Lieven wrote: As Max pointed out there is a hidden cast from int64_t to int. So use the newly introduced nb_sectors_lun2qemu for all limits. Signed-off-by: Peter Lieven --- block/iscsi.c | 20 ++-- 1 file

Re: [Qemu-devel] [PATCHv5 3/6] block/iscsi: set max_transfer_length

2014-10-27 Thread Peter Lieven
On 27.10.2014 09:28, Max Reitz wrote: On 2014-10-25 at 18:18, Peter Lieven wrote: Copy the max_xfer_len from the BlockLimits VPD or use the maximum value fitting in the CDB. Signed-off-by: Peter Lieven --- block/iscsi.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions

Re: [Qemu-devel] [PATCHv5 5/6] block/iscsi: limit to INT_MAX throughout iscsi_refresh_limits

2014-10-27 Thread Max Reitz
On 2014-10-27 at 09:35, Peter Lieven wrote: On 27.10.2014 09:32, Max Reitz wrote: On 2014-10-25 at 18:18, Peter Lieven wrote: As Max pointed out there is a hidden cast from int64_t to int. So use the newly introduced nb_sectors_lun2qemu for all limits. Signed-off-by: Peter Lieven --- block/

Re: [Qemu-devel] [PATCHv5 3/6] block/iscsi: set max_transfer_length

2014-10-27 Thread Max Reitz
On 2014-10-27 at 09:36, Peter Lieven wrote: On 27.10.2014 09:28, Max Reitz wrote: On 2014-10-25 at 18:18, Peter Lieven wrote: Copy the max_xfer_len from the BlockLimits VPD or use the maximum value fitting in the CDB. Signed-off-by: Peter Lieven --- block/iscsi.c | 17 +++--

Re: [Qemu-devel] [PATCHv5 3/6] block/iscsi: set max_transfer_length

2014-10-27 Thread Peter Lieven
On 27.10.2014 09:44, Max Reitz wrote: On 2014-10-27 at 09:36, Peter Lieven wrote: On 27.10.2014 09:28, Max Reitz wrote: On 2014-10-25 at 18:18, Peter Lieven wrote: Copy the max_xfer_len from the BlockLimits VPD or use the maximum value fitting in the CDB. Signed-off-by: Peter Lieven --- bl

Re: [Qemu-devel] [PATCHv3 1/6] block: add accounting for merged requests

2014-10-27 Thread Max Reitz
On 2014-10-25 at 18:55, Peter Lieven wrote: Signed-off-by: Peter Lieven --- block.c|2 ++ block/accounting.c |7 +++ block/qapi.c |1 + hmp.c |4 +++- include/block/accounting.h |3 +++ qapi/block-core.

[Qemu-devel] [PATCH] virtio-scsi: sense in virtio_scsi_command_complete

2014-10-27 Thread Ting Wang
If req->resp.cmd.status is not GOOD, the address of sense for qemu_iovec_from_buf should be modified from &req->resp to sense. Signed-off-by: Ting Wang --- hw/scsi/virtio-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c inde

Re: [Qemu-devel] [PATCHv5 3/6] block/iscsi: set max_transfer_length

2014-10-27 Thread Max Reitz
On 2014-10-27 at 09:47, Peter Lieven wrote: On 27.10.2014 09:44, Max Reitz wrote: On 2014-10-27 at 09:36, Peter Lieven wrote: On 27.10.2014 09:28, Max Reitz wrote: On 2014-10-25 at 18:18, Peter Lieven wrote: Copy the max_xfer_len from the BlockLimits VPD or use the maximum value fitting in th

[Qemu-devel] [PATCH 7/9] block/parallels: support padded Parallels images

2014-10-27 Thread Denis V. Lunev
Unfortunately, old guest OSes do not align partitions to page size by default. This is true for Windows 2003 and Windows XP. For the time being Parallels was created an optimization for such OSes in its desktop product. Desktop users are not qualified enough to create properly aligned installation

[Qemu-devel] [PATCH 1/9] iotests: replace fake parallels image with authentic one

2014-10-27 Thread Denis V. Lunev
The image was generated using http://openvz.org/Ploop utility and properly filled with the same content as original one. Signed-off-by: Denis V. Lunev Reviewed-by: Paolo Bonzini CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi --- tests/qemu-iotests/076 | 10 +++

[Qemu-devel] [PATCH 4/9] configure: add dependency from libxml2

2014-10-27 Thread Denis V. Lunev
This dependency is required for adequate Parallels images support. Typically the disk consists of several images which are glued by XML disk descriptor. Also XML hides inside several important parameters which are not available in the image header. The patch also adds clause to checkpatch.pl to un

[Qemu-devel] [PATCH 6/9] iotests: simple parallels XML disk descriptor file test added

2014-10-27 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi --- tests/qemu-iotests/076| 6 ++ tests/qemu-iotests/076.out| 4 tests/qemu-iotests/sample_images/parallels-sim

[Qemu-devel] [PATCH 2/9] iotests: add v2 parallels sample image and simple test for it

2014-10-27 Thread Denis V. Lunev
This is simple test image for the following commit made by me. commit d25d59802021a747812472780d80a0e792078f40 Author: Denis V. Lunev Date: Mon Jul 28 20:23:55 2014 +0400 parallels: 2TB+ parallels images support Signed-off-by: Denis V. Lunev Reviewed-by: Paolo Bonzini CC: Jef

Re: [Qemu-devel] [PATCHv3 5/6] block: add qemu-iotest for write-merge parameter

2014-10-27 Thread Max Reitz
On 2014-10-25 at 18:55, Peter Lieven wrote: Signed-off-by: Peter Lieven --- tests/qemu-iotests/109 | 113 tests/qemu-iotests/109.out | 68 ++ tests/qemu-iotests/group |1 + 3 files changed, 182 insertions(+)

[Qemu-devel] [PATCH 5/9] block/parallels: allow to specify DiskDescriptor.xml instead of image file

2014-10-27 Thread Denis V. Lunev
Typically Parallels disk bundle consists of several images which are glued by XML disk descriptor. Also XML hides inside several important parameters which are not available in the image header. This patch allows to specify this XML file as a filename for an image to open. It is allowed only to op

[Qemu-devel] [PATCH 0/9] parallels format support improvements

2014-10-27 Thread Denis V. Lunev
This patchset contains my previous patchset sent originally 08.10.2014 with minor Valgrind fix and iotests update as a base. The patchset implements additional compatibility bits for Parallels format: - initial support of parsing of Parallels DiskDeskriptor.xml Typically Parallels disk bundle co

Re: [Qemu-devel] [PATCH] Make qemu_shutdown_requested signal-safe

2014-10-27 Thread Paolo Bonzini
On 10/26/2014 10:32 AM, Jan Kiszka wrote: > From: Jan Kiszka > > qemu_shutdown_requested may be interrupted by qemu_system_killed. > If the latter sets shutdown_requested after qemu_shutdown_requested > has read it but before it was cleared, the shutdown event is lost. > Fix this by using atomic

[Qemu-devel] [PATCH 3/9] block/parallels: fix access to not initialized memory in catalog_bitmap

2014-10-27 Thread Denis V. Lunev
found by valgrind. Command: ./qemu-img convert -f parallels -O qcow2 1.hds 1.img Invalid read of size 4 at 0x17D0EF: parallels_co_read (parallels.c:357) by 0x11FEE4: bdrv_aio_rw_vector (block.c:4640) by 0x11FFBF: bdrv_aio_readv_em (block.c:4652) by 0x11F55F: bdrv_co_readv_em (block.c:4

Re: [Qemu-devel] [PATCH v14 11/14] qemu-img: Specify backing file for commit

2014-10-27 Thread Max Reitz
On 2014-10-24 at 18:23, Eric Blake wrote: On 10/24/2014 07:57 AM, Max Reitz wrote: Introduce a new parameter for qemu-img commit which may be used to explicitly specify the backing file into which an image should be committed if the backing chain has more than a single layer. Signed-off-by: Max

Re: [Qemu-devel] [PATCHv3 5/6] block: add qemu-iotest for write-merge parameter

2014-10-27 Thread Peter Lieven
On 27.10.2014 10:08, Max Reitz wrote: On 2014-10-25 at 18:55, Peter Lieven wrote: Signed-off-by: Peter Lieven --- tests/qemu-iotests/109 | 113 tests/qemu-iotests/109.out | 68 ++ tests/qemu-iotests/group |1 +

Re: [Qemu-devel] [PATCH] Make qemu_shutdown_requested signal-safe

2014-10-27 Thread Jan Kiszka
On 2014-10-27 10:09, Paolo Bonzini wrote: > On 10/26/2014 10:32 AM, Jan Kiszka wrote: >> From: Jan Kiszka >> >> qemu_shutdown_requested may be interrupted by qemu_system_killed. >> If the latter sets shutdown_requested after qemu_shutdown_requested >> has read it but before it was cleared, the sh

[Qemu-devel] [PATCHv6 2/6] BlockLimits: introduce max_transfer_length

2014-10-27 Thread Peter Lieven
Signed-off-by: Peter Lieven Reviewed-by: Max Reitz --- block.c |4 include/block/block_int.h |3 +++ 2 files changed, 7 insertions(+) diff --git a/block.c b/block.c index 88f6d9b..76fcc1d 100644 --- a/block.c +++ b/block.c @@ -519,6 +519,7 @@ void bdrv_refresh_lim

[Qemu-devel] [PATCHv6 4/6] block: avoid creating oversized writes in multiwrite_merge

2014-10-27 Thread Peter Lieven
Signed-off-by: Peter Lieven Reviewed-by: Ronnie Sahlberg Reviewed-by: Max Reitz --- block.c |5 + 1 file changed, 5 insertions(+) diff --git a/block.c b/block.c index 76fcc1d..4179341 100644 --- a/block.c +++ b/block.c @@ -4446,6 +4446,11 @@ static int multiwrite_merge(BlockDriverState

[Qemu-devel] [PATCHv6 3/6] block/iscsi: set max_transfer_length

2014-10-27 Thread Peter Lieven
Copy the max_xfer_len from the BlockLimits VPD or use the maximum value fitting in the CDB. The helper function sector_limits_lun2qemu is introduced to convert and cap the limits from the VPD to the maximum power of two fitting in an integer; integer is the range for nb_sectors throughout the bloc

[Qemu-devel] [PATCHv6 6/6] block/iscsi: check for oversized requests

2014-10-27 Thread Peter Lieven
Cancel oversized requests early. They would generate an iSCSI protocol error anyway; after having transferred possibly a lot of data over the wire. Suggested-By: Max Reitz Signed-off-by: Peter Lieven --- block/iscsi.c | 12 1 file changed, 12 insertions(+) diff --git a/block/isc

[Qemu-devel] [PATCHv6 0/6] introduce max_transfer_length

2014-10-27 Thread Peter Lieven
This series adds the basics for introducing a maximum transfer length to the block layer. Its main purpose is currently avoiding that a multiwrite_merge exceeds the max_xfer_len of an attached iSCSI LUN. This is a required bug fix. Splitting up requests according to the max_transfer_length will fo

[Qemu-devel] [PATCHv6 1/6] util: introduce MIN_NON_ZERO

2014-10-27 Thread Peter Lieven
at least in block layer we have the case of limits being defined for a BlockDriverState. However, in this context often zero (0) has the special meanining of undefined which means no limit. If two of those limits are combined and the minimum is needed the minimum function should only return zero if

Re: [Qemu-devel] [PATCHv6 3/6] block/iscsi: set max_transfer_length

2014-10-27 Thread Max Reitz
On 2014-10-27 at 10:18, Peter Lieven wrote: Copy the max_xfer_len from the BlockLimits VPD or use the maximum value fitting in the CDB. The helper function sector_limits_lun2qemu is introduced to convert and cap the limits from the VPD to the maximum power of two fitting in an integer; integer i

[Qemu-devel] [PATCHv6 5/6] block/iscsi: use sector_limits_lun2qemu throughout iscsi_refresh_limits

2014-10-27 Thread Peter Lieven
As Max pointed out there is a hidden cast from int64_t to int for all limits. So use the newly introduced sector_limits_lun2qemu for all limits received from the target. Signed-off-by: Peter Lieven --- block/iscsi.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-)

Re: [Qemu-devel] [PATCH] virtio-scsi: sense in virtio_scsi_command_complete

2014-10-27 Thread Paolo Bonzini
On 10/27/2014 09:51 AM, Ting Wang wrote: > If req->resp.cmd.status is not GOOD, the address of sense for > qemu_iovec_from_buf should be modified from &req->resp to sense. > > Signed-off-by: Ting Wang > --- > hw/scsi/virtio-scsi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff

Re: [Qemu-devel] [PATCHv6 5/6] block/iscsi: use sector_limits_lun2qemu throughout iscsi_refresh_limits

2014-10-27 Thread Max Reitz
On 2014-10-27 at 10:18, Peter Lieven wrote: As Max pointed out there is a hidden cast from int64_t to int for all limits. So use the newly introduced sector_limits_lun2qemu for all limits received from the target. Signed-off-by: Peter Lieven --- block/iscsi.c | 20 ++-- 1 f

Re: [Qemu-devel] [RFC PATCH 0/2] virtio-mmio: add irqfd support for vhost-net based on virtio-mmio

2014-10-27 Thread Li Liu
On 2014/10/26 19:52, Michael S. Tsirkin wrote: > On Sat, Oct 25, 2014 at 04:24:52PM +0800, john.liuli wrote: >> From: Li Liu >> >> This set of patches try to implemet irqfd support of vhost-net >> based on virtio-mmio. >> >> I had posted a mail to talking about the status of vhost-net >> on kv

Re: [Qemu-devel] [PATCH] hw/scsi/virtio-scsi.c: fix the "type" use error in virtio_scsi_handle_ctrl

2014-10-27 Thread Paolo Bonzini
On 10/25/2014 04:43 AM, Bin Wu wrote: > The local variable "type" in virtio_scsi_handle_ctl represents the tmf > command type from the guest and it has the same meaning as the > req->req.tmf.type. However, before the invoking of virtio_scsi_parse_req > the req->req.tmf.type doesn't has the correct

Re: [Qemu-devel] [PATCH 1/6] ahci: Correct PIO/D2H FIS responses

2014-10-27 Thread Markus Armbruster
John Snow writes: > Currently, the D2H FIS packets AHCI generates simply parrot back > the LBA that the guest sent to us in the cmd_fis. However, some > commands (like READ NATIVE MAX) modify the LBA registers as a > return value, through which the AHCI D2H FIS is the only response > mechanism. T

Re: [Qemu-devel] [PATCH 00/17] RFC: userfault v2

2014-10-27 Thread zhanghailiang
Hi Andrea, Thanks for your hard work on userfault;) This is really a useful API. I want to confirm a question: Can we support distinguishing between writing and reading memory for userfault? That is, we can decide whether writing a page, reading a page or both trigger userfault. I think this

Re: [Qemu-devel] [RFC PATCH 0/2] virtio-mmio: add irqfd support for vhost-net based on virtio-mmio

2014-10-27 Thread Peter Maydell
On 25 October 2014 09:24, john.liuli wrote: > To get the interrupt reason to support such VIRTIO_NET_F_STATUS > features I add a new register offset VIRTIO_MMIO_ISRMEM which > will help to establish a shared memory region between qemu and > virtio-mmio device. Then the interrupt reason can be acce

[Qemu-devel] [PATCH 9/9] parallels: change copyright information in the image header

2014-10-27 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/parallels.c b/block/parallels.c index d07e4f7..1491211 100644 --- a/block/parallels.c +++ b/b

[Qemu-devel] [PATCH 8/9] iotests: padded parallels image test

2014-10-27 Thread Denis V. Lunev
Unfortunately, old guest OSes do not align partitions to page size by default. This is true for Windows 2003 and Windows XP. "Padding" is a value which should be added to guest LBA to obtain sector number inside the image. This results in a shifted images. 0123offset inside image (in 51

[Qemu-devel] How to run "qemu-system-aarch64" without "-kernel" parameter?

2014-10-27 Thread Sudheesh PM
I amusing qemu-system-aarch64 (version 2.1.0) to run aarch64 on ARM64 machine using openstack.I am facing difficulty in passing "kernel" parameter. How to boot a virtual machine without passing "-kernel" option? I want to use only "- drive file=rootfs.img" for booting. please help. Regards,Sudh

Re: [Qemu-devel] [PATCH v6] numa: make 'info numa' take into account hotplugged memory

2014-10-27 Thread zhanghailiang
Hi Luiz, Can you apply this to your qmp branch? It has been reviewd;) Thanks, zhanghailiang On 2014/10/23 8:32, zhanghailiang wrote: Hi, Ping... This patch has been reviewed, please pick up, Thanks. Best Regargs, zhanghailiang On 2014/10/17 17:02, Gonglei wrote: On 2014/10/17 16:50, zhangh

Re: [Qemu-devel] [PATCH 5/6] ide: Correct handling of malformed/short PRDTs

2014-10-27 Thread Paolo Bonzini
On 10/02/2014 12:55 AM, John Snow wrote: > +/* If this is true, you're leaking memory. */ ... or qsg is uninitialized, which would work because qemu_sglist_init initializes all fields. This is the only comment I have on the series. :) Paolo > +assert(qsg->sg == NULL); > + > qsg->

Re: [Qemu-devel] [PATCH 0/6] AHCI Device Fixes

2014-10-27 Thread Paolo Bonzini
On 10/02/2014 12:55 AM, John Snow wrote: > Based off of feedback from the RFC of the same name, > this series batches together a group of fixes that > improve the AHCI device to fix a number of bugs. > > A number of fixes included in the RFC that provide more > radical changes are omitted for now

[Qemu-devel] [PATCH v4 2/7] qemu-img: Add progress output for amend

2014-10-27 Thread Max Reitz
Now that bdrv_amend_options() supports a status callback, use it to display a progress report. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Benoît Canet --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 25 ++--- qemu-img.texi| 2 +- 3 files changed,

[Qemu-devel] [PATCH v4 0/7] block/qcow2: Improve zero cluster expansion

2014-10-27 Thread Max Reitz
The main purpose of this series is to add a progress report to qemu-img amend. This is achieved by adding a callback function to bdrv_amend_options() - the reasons for this choice are explained in patch 1. While adapting qcow2's expand_zero_clusters_in_l1() accordingly, I noticed a way to simplify

[Qemu-devel] [PATCH v4 1/7] block: Add status callback to bdrv_amend_options()

2014-10-27 Thread Max Reitz
Depending on the changed options and the image format, bdrv_amend_options() may take a significant amount of time. In these cases, a way to be informed about the operation's status is desirable. Since the operation is rather complex and may fundamentally change the image, implementing it as AIO or

[Qemu-devel] [PATCH v4 3/7] qemu-img: Fix insignificant memleak

2014-10-27 Thread Max Reitz
As soon as options is set in img_amend(), it needs to be freed before the function returns. This leak is rather insignificant, as qemu-img will exit subsequently anyway, but there's no point in not fixing it. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Benoit Canet --- qemu-i

[Qemu-devel] [PATCH v4 5/7] block/qcow2: Make get_refcount() global

2014-10-27 Thread Max Reitz
Reading the refcount of a cluster is an operation which can be useful in all of the qcow2 code, so make that function globally available. While touching this function, amend the comment describing the "addend" parameter: It is (no longer, if it ever was) necessary to have it set to -1 or 1; any va

[Qemu-devel] [PATCH v4 6/7] block/qcow2: Simplify shared L2 handling in amend

2014-10-27 Thread Max Reitz
Currently, we have a bitmap for keeping track of which clusters have been created during the zero cluster expansion process. This was necessary because we need to properly increase the refcount for shared L2 tables. However, now we can simply take the L2 refcount and use it for the cluster allocat

[Qemu-devel] [PATCH v4 7/7] iotests: Expand test 061

2014-10-27 Thread Max Reitz
Add some tests for progress output to 061. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Benoît Canet --- tests/qemu-iotests/061 | 25 + tests/qemu-iotests/061.out | 30 ++ tests/qemu-iotests/group | 2 +- 3 files chang

[Qemu-devel] [PATCH v4 4/7] block/qcow2: Implement status CB for amend

2014-10-27 Thread Max Reitz
The only really time-consuming operation potentially performed by qcow2_amend_options() is zero cluster expansion when downgrading qcow2 images from compat=1.1 to compat=0.10, so report status of that operation and that operation only through the status CB. For this, approximate the progress as th

[Qemu-devel] [PATCH] uhci: remove useless DEBUG

2014-10-27 Thread arei.gonglei
From: Gonglei commit 50dcc0f8 (uhci: tracing support) had removed DPRINTF, the DEBUG marco is useless now, remove it. Signed-off-by: Gonglei --- hw/usb/hcd-uhci.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 5b88f30..4a4215d 100644 --- a/hw/

[Qemu-devel] [RFC PATCH] target-ppc: explicitly save page table headers in big endian

2014-10-27 Thread Cédric Le Goater
Currently, when the page tables are saved, the kvm_get_htab_header structs and the ptes are assumed being big endian and dumped as a indistinct blob in the statefile. This is no longer true when the host is little endian and this breaks restoration. This patch unfolds the kvmppc_save_htab routi

Re: [Qemu-devel] How to run "qemu-system-aarch64" without "-kernel" parameter?

2014-10-27 Thread Peter Maydell
On 27 October 2014 09:40, Sudheesh PM wrote: > I amusing qemu-system-aarch64 (version 2.1.0) to run aarch64 on ARM64 > machine using openstack. > I am facing difficulty in passing "kernel" parameter. How to boot a virtual > machine without passing "-kernel" option? > > I want to use only "- drive

Re: [Qemu-devel] [RFC PATCH 0/2] virtio-mmio: add irqfd support for vhost-net based on virtio-mmio

2014-10-27 Thread Michael S. Tsirkin
On Mon, Oct 27, 2014 at 05:19:23PM +0800, Li Liu wrote: > > > On 2014/10/26 19:52, Michael S. Tsirkin wrote: > > On Sat, Oct 25, 2014 at 04:24:52PM +0800, john.liuli wrote: > >> From: Li Liu > >> > >> This set of patches try to implemet irqfd support of vhost-net > >> based on virtio-mmio. > >>

[Qemu-devel] [PATCH] block/vdi: Limit maximum size even futher

2014-10-27 Thread Max Reitz
The block layer read and write functions do not like requests which are bigger than INT_MAX bytes. Since the VDI bmap is read and written in a single operation, its size is therefore limited accordingly. This reduces the maximum VDI image size supported by QEMU to half of what it currently is (down

Re: [Qemu-devel] [RFC PATCH 2/2] Assign a new irq handler while irqfd enabled

2014-10-27 Thread Li Liu
On 2014/10/26 19:56, Michael S. Tsirkin wrote: > On Sat, Oct 25, 2014 at 04:24:54PM +0800, john.liuli wrote: >> From: Li Liu >> >> This irq handler will get the interrupt reason from a >> shared memory. And will be assigned only while irqfd >> enabled. >> >> Signed-off-by: Li Liu >> --- >> dri

Re: [Qemu-devel] [PATCH] block/vdi: Limit maximum size even futher

2014-10-27 Thread Peter Lieven
On 27.10.2014 11:56, Max Reitz wrote: The block layer read and write functions do not like requests which are bigger than INT_MAX bytes. Since the VDI bmap is read and written in a single operation, its size is therefore limited accordingly. This reduces the maximum VDI image size supported by QE

Re: [Qemu-devel] [RFC PATCH 0/2] virtio-mmio: add irqfd support for vhost-net based on virtio-mmio

2014-10-27 Thread Li Liu
On 2014/10/27 17:37, Peter Maydell wrote: > On 25 October 2014 09:24, john.liuli wrote: >> To get the interrupt reason to support such VIRTIO_NET_F_STATUS >> features I add a new register offset VIRTIO_MMIO_ISRMEM which >> will help to establish a shared memory region between qemu and >> virtio-

Re: [Qemu-devel] [PATCH] block/vdi: Limit maximum size even futher

2014-10-27 Thread Max Reitz
On 2014-10-27 at 12:10, Peter Lieven wrote: On 27.10.2014 11:56, Max Reitz wrote: The block layer read and write functions do not like requests which are bigger than INT_MAX bytes. Since the VDI bmap is read and written in a single operation, its size is therefore limited accordingly. This reduc

Re: [Qemu-devel] [PATCH] block/vdi: Limit maximum size even futher

2014-10-27 Thread Max Reitz
On 2014-10-27 at 12:39, Max Reitz wrote: On 2014-10-27 at 12:10, Peter Lieven wrote: On 27.10.2014 11:56, Max Reitz wrote: The block layer read and write functions do not like requests which are bigger than INT_MAX bytes. Since the VDI bmap is read and written in a single operation, its size is

[Qemu-devel] [PATCH] vnc: sanitize bits_per_pixel from the client

2014-10-27 Thread Petr Matousek
bits_per_pixel that are less than 8 could result in accessing non-initialized buffers later in the code due to the expectation that bytes_per_pixel value that is used to initialize these buffers is never zero. To fix this check that bits_per_pixel from the client is one of the values that the rfb

Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable

2014-10-27 Thread Marc-André Lureau
Hi On Mon, Oct 27, 2014 at 9:08 AM, Gerd Hoffmann wrote: > > +static void spice_chr_accept_input(struct CharDriverState *chr) > > +{ > > +SpiceCharDriver *s = chr->opaque; > > + > > +spice_server_char_device_wakeup(&s->sin); > > Does this build on older spice versions? I'd suspect this

Re: [Qemu-devel] [PATCH] uhci: remove useless DEBUG

2014-10-27 Thread Gerd Hoffmann
On Mo, 2014-10-27 at 18:20 +0800, arei.gong...@huawei.com wrote: > commit 50dcc0f8 (uhci: tracing support) had removed > DPRINTF, the DEBUG marco is useless now, remove it. Added to usb patch queue. thanks, Gerd

Re: [Qemu-devel] [PATCH v7 07/32] target-arm: extend async excp masking

2014-10-27 Thread Peter Maydell
On 26 October 2014 22:30, Peter Maydell wrote: > In fact, since all of the "exception is not taken" cases are for > "we are in secure EL3 and the exception is not being routed to > secure EL3" you could just make all those entries read "1" and > rely on the "target_el < current_el" check. That doe

Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable

2014-10-27 Thread Gerd Hoffmann
On Mo, 2014-10-27 at 12:45 +0100, Marc-André Lureau wrote: > Hi > > > On Mon, Oct 27, 2014 at 9:08 AM, Gerd Hoffmann > wrote: > > +static void spice_chr_accept_input(struct CharDriverState > *chr) > > +{ > > +SpiceCharDriver *s = chr->opaque; > > + >

Re: [Qemu-devel] [RFC PATCH 0/2] virtio-mmio: add irqfd support for vhost-net based on virtio-mmio

2014-10-27 Thread Peter Maydell
On 27 October 2014 11:23, Li Liu wrote: > So you mean virtio-mmio will be replaced by PCI/PCIe on ARM at last? That is the plan, yes. I can't make any promises on timescales at the moment, though... -- PMM

Re: [Qemu-devel] [PATCH] vnc: sanitize bits_per_pixel from the client

2014-10-27 Thread Gerd Hoffmann
On Mo, 2014-10-27 at 12:41 +0100, Petr Matousek wrote: > bits_per_pixel that are less than 8 could result in accessing > non-initialized buffers later in the code due to the expectation > that bytes_per_pixel value that is used to initialize these buffers is > never zero. > > To fix this check tha

Re: [Qemu-devel] [RFC PATCH 2/2] Assign a new irq handler while irqfd enabled

2014-10-27 Thread Michael S. Tsirkin
On Mon, Oct 27, 2014 at 07:04:11PM +0800, Li Liu wrote: > > > On 2014/10/26 19:56, Michael S. Tsirkin wrote: > > On Sat, Oct 25, 2014 at 04:24:54PM +0800, john.liuli wrote: > >> From: Li Liu > >> > >> This irq handler will get the interrupt reason from a > >> shared memory. And will be assigned

[Qemu-devel] How to add emulated hardware module to QEMU

2014-10-27 Thread 梁凯源
Hello all, I am a student of Tianjin University, researching emulation of hardware module in QEMU. Could you give me some suggestions? In my project, I need to add a virtual hardware to qemu. By code reviewing, I seemly get the point that devices and peripherals under dir hw/*/* register themse

[Qemu-devel] [PATCH 0/2] block: Propagate error in bdrv_img_create()

2014-10-27 Thread Max Reitz
Currently, when trying to create a backed image without specifying its size, when the backing file does not exist or is not accessible, an appropriate error message will be generated which is then (in bdrv_img_create()) prefixed with the image file name and the strerror(). However, both are general

[Qemu-devel] [PATCH 2/2] iotests: Add test for non-existing backing file

2014-10-27 Thread Max Reitz
Test the error message when a COW file is about to be created which is supposed to inherit the size of its backing file, while the backing file given does not actually exist. Signed-off-by: Max Reitz --- tests/qemu-iotests/111 | 53 ++ tests/qemu-i

[Qemu-devel] [PATCH 1/2] block: Propagate error in bdrv_img_create()

2014-10-27 Thread Max Reitz
If the specified backing file could not be opened, do not generate a new error message which contains the message which has been generated by bdrv_open(), but just propagate the latter. Signed-off-by: Max Reitz --- block.c | 5 - 1 file changed, 5 deletions(-) diff --git a/block.c b/block.c

Re: [Qemu-devel] Postcopy failures

2014-10-27 Thread Dr. David Alan Gilbert
* Gary Hook (gary.h...@nimboxx.com) wrote: > I see this went by: > > Il 07/10/2014 12:29, Dr. David Alan Gilbert ha scritto: > > You mean something like this (untested) ? > > > > if (mis->postcopy_ram_state != POSTCOPY_RAM_INCOMING_NONE) { > > if (mis->postcopy_ram_state == POSTCOPY_RAM_IN

Re: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable

2014-10-27 Thread Amit Shah
Hi, On (Fri) 24 Oct 2014 [11:00:54], Marc-André Lureau wrote: > The spice server is polling on write, unless > SPICE_CHAR_DEVICE_NOTIFY_WRITABLE flag is set. In this case, qemu must > call spice_server_char_device_wakeup() when the frontend is writable. Great, so there's no other change required

Re: [Qemu-devel] [PATCH 0/2] block: Propagate error in bdrv_img_create()

2014-10-27 Thread Peter Lieven
On 27.10.2014 13:30, Max Reitz wrote: Currently, when trying to create a backed image without specifying its size, when the backing file does not exist or is not accessible, an appropriate error message will be generated which is then (in bdrv_img_create()) prefixed with the image file name and t

Re: [Qemu-devel] [PATCH v6] numa: make 'info numa' take into account hotplugged memory

2014-10-27 Thread Luiz Capitulino
On Mon, 27 Oct 2014 17:40:11 +0800 zhanghailiang wrote: > Hi Luiz, > > Can you apply this to your qmp branch? > It has been reviewd;) I can, but I don't have bandwidth for another pull request for v2.2 unless it's a fix for a blocker. This means you have two options, wait for v2.3 or find anoth

Re: [Qemu-devel] A Patch to enable qemu-nbd run as an inetd service

2014-10-27 Thread Jun Sheng
Hi, Since errx is used everywhere in qemu-nbd.c, I suggest that I follow this convention in submitting my patch. On Thu, Oct 23, 2014 at 4:48 AM, Eric Blake wrote: > On 10/22/2014 12:54 PM, Jun Sheng wrote: >> From: Chaos Eternal >> >> >> run qemu-nbd as an inetd service has some benefits >> *

[Qemu-devel] [PATCH 0/2] target-arm: fix some exception-masking issues

2014-10-27 Thread Peter Maydell
These patches fix a couple of issues I noticed with the existing code in the ARM arm_excp_unmasked() function while I was reviewing the TrustZone series: * we currently try to use the same function for M profile and A/R profile, which makes both code paths harder to read (and maybe one day w

[Qemu-devel] [PATCH 2/2] target-arm: Correct condition for taking VIRQ and VFIQ

2014-10-27 Thread Peter Maydell
The VIRQ and VFIQ exceptions are (as the comments say) only taken if the CPU is in Non-secure state and the IMO/FMO bits are set to enable virtualized interrupts. Correct the code to actually implement this by using '||' rather than '&&'. Signed-off-by: Peter Maydell --- target-arm/cpu.h | 4 ++-

[Qemu-devel] [PATCH 1/2] target-arm: Separate out M profile cpu_exec_interrupt handling

2014-10-27 Thread Peter Maydell
The M profile cpu_exec_interrupt handling is fairly simple but does include an M profile specific oddity (disabling interrupts for certain PC values). A/R profile handling on the other hand is getting rapidly more complicated with the support for EL2 and EL3. Split the M profile code out into its o

Re: [Qemu-devel] is it possible to use a disk with multiple iothreads ?

2014-10-27 Thread Stefan Hajnoczi
On Fri, Oct 24, 2014 at 03:39:52PM +0200, Alexandre DERUMIER wrote: > >>Regarding Ceph, do you know why it burns a lot of CPU? > > I'm currently doing some perfs to find why is so huge. > > One thing is that qemu+ qemu rbd block driver + librbd seem to use 2-3x more > cpu, than passing krbd /dev

[Qemu-devel] [PATCH v2] hw/pci: fixed crash when using rombar=0 with romfile=path for hotplugged devices

2014-10-27 Thread Marcel Apfelbaum
Combining rombar=0 with romfile= is an user error, silently dropping the romfile is a reasonable thing to do. Signed-off-by: Marcel Apfelbaum --- v1 -> v2: After a discussion with Michael, Paolo and Alex, this patch silent drops the romfile instead of not allowing the hotplug. An OK from li

Re: [Qemu-devel] [PATCH v2] hw/pci: fixed crash when using rombar=0 with romfile=path for hotplugged devices

2014-10-27 Thread Marcel Apfelbaum
On Mon, 2014-10-27 at 15:44 +0200, Marcel Apfelbaum wrote: > Combining rombar=0 with romfile= is an user error, > silently dropping the romfile is a reasonable thing to do. > > Signed-off-by: Marcel Apfelbaum > --- > v1 -> v2: > After a discussion with Michael, Paolo and Alex, this > patch sile

Re: [Qemu-devel] [PATCH] aio / timers: De-document -clock

2014-10-27 Thread Markus Armbruster
Ping? Markus Armbruster writes: > Commit 6d32717 "aio / timers: Remove alarm timers" has issues: > > 1. It silently ignores -clock for backward compatibility. > Incompatible change: -clock help no longer terminates the program. > Tolerable. > > 2. Failed to update option documentation. In parti

Re: [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously"

2014-10-27 Thread Peter Maydell
On 26 October 2014 09:32, Jan Kiszka wrote: > From: Jan Kiszka > > This reverts commit 15124e142034d21341ec9f1a304a1dc5a6c25681. It breaks > debuggability of qemu. > > Signed-off-by: Jan Kiszka > --- > > Feel free to apply this before or after "Make qemu_shutdown_requested > signal-safe". > > m

Re: [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously"

2014-10-27 Thread Paolo Bonzini
On 10/27/2014 03:18 PM, Peter Maydell wrote: > On 26 October 2014 09:32, Jan Kiszka wrote: >> From: Jan Kiszka >> >> This reverts commit 15124e142034d21341ec9f1a304a1dc5a6c25681. It breaks >> debuggability of qemu. >> >> Signed-off-by: Jan Kiszka >> --- >> >> Feel free to apply this before or

Re: [Qemu-devel] [PATCH] aio / timers: De-document -clock

2014-10-27 Thread Paolo Bonzini
On 10/06/2014 04:19 PM, Markus Armbruster wrote: > Commit 6d32717 "aio / timers: Remove alarm timers" has issues: > > 1. It silently ignores -clock for backward compatibility. > Incompatible change: -clock help no longer terminates the program. > Tolerable. > > 2. Failed to update option document

  1   2   >