[Qemu-block] [PULL v2 10/45] vring: slim down allocation of VirtQueueElements

2016-02-06 Thread Michael S. Tsirkin
From: Paolo Bonzini Build the addresses and s/g lists on the stack, and then copy them to a VirtQueueElement that is just as big as required to contain this particular s/g list. The cost of the copy is minimal compared to that of a large malloc. Reviewed-by: Cornelia Huck

[Qemu-block] [PULL v2 06/45] virtio: move allocation to virtqueue_pop/vring_pop

2016-02-06 Thread Michael S. Tsirkin
From: Paolo Bonzini The return code of virtqueue_pop/vring_pop is unused except to check for errors or 0. We can thus easily move allocation inside the functions and just return a pointer to the VirtQueueElement. The advantage is that we will be able to allocate only the

[Qemu-block] [PULL v2 07/45] virtio: introduce qemu_get/put_virtqueue_element

2016-02-06 Thread Michael S. Tsirkin
From: Paolo Bonzini Move allocation to virtio functions also when loading/saving a VirtQueueElement. This will also let the load/save functions keep backwards compatibility when the VirtQueueElement layout is changed. Reviewed-by: Cornelia Huck

Re: [Qemu-block] [PULL 06/49] virtio: move allocation to virtqueue_pop/vring_pop

2016-02-06 Thread Michael S. Tsirkin
On Fri, Feb 05, 2016 at 12:52:55PM +, Peter Maydell wrote: > On 4 February 2016 at 21:51, Michael S. Tsirkin wrote: > > From: Paolo Bonzini > > > > The return code of virtqueue_pop/vring_pop is unused except to check for > > errors or 0. We can thus

Re: [Qemu-block] [PATCH] blockdev: Unset temporary flag when changing medium.

2016-02-06 Thread Alyssa Milburn
On Sat, Feb 06, 2016 at 02:04:23PM +0100, Max Reitz wrote: > On 04.02.2016 18:36, Alyssa Milburn wrote: > > This avoids a 'change' command from the monitor unlink()ing the new > > file if the bdrv was previously snapshotted. > > > > Signed-off-by: Alyssa Milburn > > --- > >

Re: [Qemu-block] [PATCH v12 1/2] mirror: Rewrite mirror_iteration

2016-02-06 Thread Max Reitz
On 05.02.2016 03:00, Fam Zheng wrote: > The "pnum < nb_sectors" condition in deciding whether to actually copy > data is unnecessarily strict, and the qiov initialization is > unnecessarily for bdrv_aio_write_zeroes and bdrv_aio_discard. > > Rewrite mirror_iteration to fix both flaws. > > The

[Qemu-block] [PATCH v2] blockdev: unset inappropriate flags when changing medium

2016-02-06 Thread Alyssa Milburn
Most importantly, this removes BDRV_O_TEMPORARY, to avoid unlink()ing an image which replaces a snapshotted one. Signed-off-by: Alyssa Milburn --- blockdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blockdev.c b/blockdev.c index be4ca44..a916b06 100644 ---