Re: [Qemu-block] [PATCH v3 0/4] Bitmap clean-up patches for 2.6

2015-11-24 Thread Vladimir Sementsov-Ogievskiy
Hmm, stop. Very bad thing (sorry, that I didn't realize it before): This breaks my dirty bitmap migration series with its meta bitmaps. Meta bitmap is an additional HBitmap in BdrvDirtyBitmap, which tracks dirtiness of this BdrvDirtyBitmap. And it (meta bitmap) have its own granularity of

[Qemu-block] [PATCH v2 09/14] vdi: Assign bs->file->bs to file in vdi_co_get_block_status

2015-11-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/vdi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/vdi.c b/block/vdi.c index 2199fd3..6b1a57b 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -550,6 +550,7 @@ static int64_t coroutine_fn vdi_co_get_block_status(BlockDriverState *bs,

[Qemu-block] [PATCH v2 12/14] qemu-img: Make MapEntry a QAPI struct

2015-11-24 Thread Fam Zheng
The "flags" bit mask is expanded to two booleans, "data" and "zero"; "bs" is replaced with "filename" string. Signed-off-by: Fam Zheng --- qapi/block-core.json | 28 qemu-img.c | 48 ++-- 2 files

[Qemu-block] [PATCH v2 14/14] iotests: Add "qemu-img map" test for VMDK extents

2015-11-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/059 | 10 ++ tests/qemu-iotests/059.out | 38 ++ 2 files changed, 48 insertions(+) diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059 index 0ded0c3..261d8b0 100755 ---

[Qemu-block] [PATCH v2 13/14] qemu-img: Use QAPI visitor to generate JSON

2015-11-24 Thread Fam Zheng
A visible improvement is that "filename" is now included in the output if it's valid. Signed-off-by: Fam Zheng --- qemu-img.c | 39 --- tests/qemu-iotests/122.out | 96 ++ 2 files changed, 79

[Qemu-block] [PATCH v2 05/14] iscsi: Assign bs to file in iscsi_co_get_block_status

2015-11-24 Thread Fam Zheng
Reviewed-by: Eric Blake Signed-off-by: Fam Zheng --- block/iscsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index 2d1e230..8c7f1b3 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -625,6 +625,9 @@ out: if

[Qemu-block] [PATCH v2 04/14] raw: Assign bs to file in raw_co_get_block_status

2015-11-24 Thread Fam Zheng
Reviewed-by: Eric Blake Signed-off-by: Fam Zheng --- block/raw-posix.c | 1 + block/raw_bsd.c | 1 + 2 files changed, 2 insertions(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index 2cd7d68..9988aa4 100644 --- a/block/raw-posix.c +++

[Qemu-block] [PATCH v2 02/14] qcow: Assign bs->file->bs to file in qcow_co_get_block_status

2015-11-24 Thread Fam Zheng
Reviewed-by: Eric Blake Signed-off-by: Fam Zheng --- block/qcow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow.c b/block/qcow.c index 558f443..b59383f 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -509,6 +509,7 @@ static int64_t

[Qemu-block] [PATCH v2 08/14] sheepdog: Assign bs to file in sd_co_get_block_status

2015-11-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/sheepdog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/sheepdog.c b/block/sheepdog.c index 0f6789e..d5e7ff8 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -2740,6 +2740,9 @@ sd_co_get_block_status(BlockDriverState *bs,

[Qemu-block] [PATCH v2 03/14] qcow2: Assign bs->file->bs to file in qcow2_co_get_block_status

2015-11-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2.c b/block/qcow2.c index 836888c..7634c42 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1302,6 +1302,7 @@ static int64_t coroutine_fn

[Qemu-block] [PATCH v2 00/14] qemu-img map: Allow driver to return file of the allocated block

2015-11-24 Thread Fam Zheng
v2: Add Eric's rev-by in patches 2, 4, 5. 01: Refering -> referring in commit message. [Eric] Recurse to "file" for sensible "zero" flag. [Paolo] 12: New. Make MapEntry a QAPI struct. [Paolo, Markus] I stumbled upon this when looking at external bitmap formats. Current "qemu-img

[Qemu-block] [PATCH v2 07/14] qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status

2015-11-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/qed.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/qed.c b/block/qed.c index a6bbd8b..03af9c1 100644 --- a/block/qed.c +++ b/block/qed.c @@ -692,6 +692,7 @@ typedef struct { uint64_t pos; int64_t status; int

[Qemu-block] [PATCH v2 11/14] vmdk: Return extent's file in bdrv_get_block_status

2015-11-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/vmdk.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index f5a56fd..b60a5af 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1265,6 +1265,7 @@ static int64_t coroutine_fn

[Qemu-block] [PATCH v2 10/14] vpc: Assign bs->file->bs to file in vpc_co_get_block_status

2015-11-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/vpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/vpc.c b/block/vpc.c index 912f5d0..412ff41 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -588,6 +588,7 @@ static int64_t coroutine_fn vpc_co_get_block_status(BlockDriverState

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 2/3] block: Hide HBitmap in block dirty bitmap interface

2015-11-24 Thread Fam Zheng
On Tue, 11/24 12:12, Vladimir Sementsov-Ogievskiy wrote: > On 24.11.2015 05:28, Fam Zheng wrote: > >On Mon, 11/23 16:34, John Snow wrote: > >>Hmm, what's the idea, here? > >> > >>This patch does a lot more than just hide hbitmap details from callers > >>of block_dirty_bitmap functions. > >> > >>So

Re: [Qemu-block] [PATCH v6] raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2015-11-24 Thread Programmingkid
On Nov 24, 2015, at 9:38 AM, Kevin Wolf wrote: > > >> +/* If using a physical device */ >> +if (strstart(filename, "/dev/", NULL)) { >> +char bsdPath[MAXPATHLEN]; >> + >> +/* If the physical device is a cdrom */ >> +if (strcmp(filename, "/dev/cdrom") == 0) { > >

[Qemu-block] [PATCH v3 1/4] backup: Use Bitmap to replace "s->bitmap"

2015-11-24 Thread Fam Zheng
"s->bitmap" tracks done sectors, we only check bit states without using any iterator which HBitmap is good for. Switch to "Bitmap" which is simpler and more memory efficient. Meanwhile, rename it to done_bitmap, to reflect the intention. Signed-off-by: Fam Zheng Reviewed-by:

[Qemu-block] [PATCH v3 0/4] Bitmap clean-up patches for 2.6

2015-11-24 Thread Fam Zheng
v3: Split patch 2. [Vladimir] v2: bitmap_set -> set_bit. [Congyang, Paolo, John] Add John Snow's rev-by with that change. This makes a cleaner base for more dirty bitmap work. "granularity" appearing with different representations have always been mind twisting, remove it from HBitmap to

[Qemu-block] [PATCH v3 2/4] block: Hide HBitmap in block dirty bitmap interface

2015-11-24 Thread Fam Zheng
HBitmap is an implementation detail of block dirty bitmap that should be hidden from users. Introduce a BdrvDirtyBitmapIter to encapsulate the underlying HBitmapIter. A small difference in the interface is, before, an HBitmapIter is initialized in place, now the new BdrvDirtyBitmapIter must be

[Qemu-block] [PATCH v3 3/4] block: Manage granularity in BdrvDirtyBitmap

2015-11-24 Thread Fam Zheng
BdrvDirtyBitmap has to know about granularity because it's in the API, but currently the logic is in HBitmap. Because HBitmap has a delicate implementation that has a multi-layer array of arrays of different granularities, handling the "bit granularity" there only makes it harder to understand.

[Qemu-block] [PATCH v3 4/4] hbitmap: Drop "granularity"

2015-11-24 Thread Fam Zheng
Now all callers except the test code use zero, drop the parameter to make the interface cleaner and more intuitive. Test code of hbitmap granularity is removed together. Signed-off-by: Fam Zheng --- block.c| 4 +- include/qemu/hbitmap.h | 20 +

[Qemu-block] [PATCH] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2015-11-24 Thread Programmingkid
Mac OS X can be picky when it comes to allowing the user to use physical devices in QEMU. Most mounted volumes appear to be off limits to QEMU. If an issue is detected, a message is displayed showing the user how to unmount a volume. Signed-off-by: John Arbuckle ---

[Qemu-block] [PATCH v2 01/14] block: Add "file" output parameter to block status query functions

2015-11-24 Thread Fam Zheng
The added parameter can be used to return the BDS pointer which the valid offset is referring to. It's value should be ignored unless BDRV_BLOCK_OFFSET_VALID in ret is set. Until block drivers fill in the right value, let's clear it explicitly right before calling .bdrv_get_block_status.

[Qemu-block] [PATCH v2 06/14] parallels: Assign bs->file->bs to file in parallels_co_get_block_status

2015-11-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parallels.c index d1146f1..6552f32 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -273,6 +273,7 @@ static int64_t coroutine_fn

[Qemu-block] [PATCH 27/40] aio: document locking

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- docs/multiple-iothreads.txt | 5 ++--- include/block/aio.h | 24 +++- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/docs/multiple-iothreads.txt b/docs/multiple-iothreads.txt index

[Qemu-block] [PATCH 24/40] aio: tweak walking in dispatch phase

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- aio-posix.c | 26 -- aio-win32.c | 26 -- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/aio-posix.c b/aio-posix.c index 482b316..370fefe 100644 --- a/aio-posix.c +++

[Qemu-block] [PATCH 29/40] quorum: use atomics for rewrite_count

2015-11-24 Thread Paolo Bonzini
This is simpler than taking and releasing the AioContext lock. Signed-off-by: Paolo Bonzini --- block/quorum.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/block/quorum.c b/block/quorum.c index b9ba028..3b19c9e 100644 --- a/block/quorum.c

[Qemu-block] [PATCH 32/40] block: explicitly acquire aiocontext in callbacks that need it

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- aio-posix.c | 4 aio-win32.c | 6 -- block/curl.c| 16 +++--- block/iscsi.c | 4 block/nbd-client.c | 14 ++--

[Qemu-block] [PATCH 35/40] block: explicitly acquire aiocontext in aio callbacks that need it

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- block/archipelago.c| 3 --- block/blkdebug.c | 4 --- block/blkverify.c | 9 +++ block/block-backend.c | 4 --- block/curl.c | 2 +- block/io.c | 13 +- block/iscsi.c | 2 --

[Qemu-block] [PATCH 40/40] dma-helpers: avoid lock inversion with AioContext

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- dma-helpers.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dma-helpers.c b/dma-helpers.c index 68f6f07..b3e19ba 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -210,9 +210,25 @@ BlockAIOCB

[Qemu-block] [PATCH 37/40] async: optimize aio_bh_poll

2015-11-24 Thread Paolo Bonzini
Avoid entering the slow path of qemu_lockcnt_dec_and_lock if no bottom half has to be deleted. If a bottom half deletes itself, it will be picked up on the next visit of the list, or when the AioContext itself is finalized. Signed-off-by: Paolo Bonzini --- async.c | 13

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6 05/14] iscsi: Assign bs to file in iscsi_co_get_block_status

2015-11-24 Thread Eric Blake
On 11/23/2015 10:22 PM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > block/iscsi.c | 3 +++ > 1 file changed, 3 insertions(+) Reviewed-by: Eric Blake > > diff --git a/block/iscsi.c b/block/iscsi.c > index 2d1e230..8c7f1b3 100644 > ---

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6 04/14] raw: Assign bs to file in raw_co_get_block_status

2015-11-24 Thread Eric Blake
On 11/23/2015 10:22 PM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > block/raw-posix.c | 1 + > block/raw_bsd.c | 1 + > 2 files changed, 2 insertions(+) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt

Re: [Qemu-block] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector()

2015-11-24 Thread John Snow
On 11/24/2015 07:17 AM, Alberto Garcia wrote: > Commit 5f81724d made PIO read requests async but didn't add the > relevant block_acct_failed() and block_acct_invalid() calls. > > Signed-off-by: Alberto Garcia > --- > hw/ide/atapi.c | 6 -- > 1 file changed, 4

[Qemu-block] [PATCH 01/40] 9pfs: allocate pdus with g_malloc/g_free

2015-11-24 Thread Paolo Bonzini
Prepare for moving the allocation to virtqueue_pop. Signed-off-by: Paolo Bonzini --- hw/9pfs/virtio-9p-device.c | 7 +-- hw/9pfs/virtio-9p.c| 10 +++--- hw/9pfs/virtio-9p.h| 2 -- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git

[Qemu-block] [PATCH 02/40] virtio: move VirtQueueElement at the beginning of the structs

2015-11-24 Thread Paolo Bonzini
The next patch will make virtqueue_pop/vring_pop allocate memory for a "subclass" of VirtQueueElement. For this to work, VirtQueueElement must be the first field in the containing struct. Signed-off-by: Paolo Bonzini --- hw/9pfs/virtio-9p.h | 2 +-

[Qemu-block] [RFC PATCH 00/40] Sneak peek of virtio and dataplane changes for 2.6

2015-11-24 Thread Paolo Bonzini
This large series is basically all that I would like to get into 2.6. It is a combination of several pieces of work on dataplane and multithreaded block layer. It's also a large part of why I would like someone else to look at miscellaneous patches for a while (in case you've missed that). I can

[Qemu-block] [PATCH 07/40] virtio: slim down allocation of VirtQueueElements

2015-11-24 Thread 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. When virtqueue_map is used on the destination side of migration or on

[Qemu-block] [PATCH 06/40] virtio: introduce virtqueue_alloc_element

2015-11-24 Thread Paolo Bonzini
Allocate the arrays for in_addr/out_addr/in_sg/out_sg outside the VirtQueueElement. For now, virtqueue_pop and vring_pop keep allocating a very large VirtQueueElement. Signed-off-by: Paolo Bonzini --- hw/virtio/dataplane/vring.c | 2 +- hw/virtio/virtio.c | 60

[Qemu-block] [PATCH 03/40] virtio: move allocation to virtqueue_pop/vring_pop

2015-11-24 Thread 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 space that is needed for the actual size of

[Qemu-block] [PATCH 04/40] virtio: introduce qemu_get/put_virtqueue_element

2015-11-24 Thread 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. Signed-off-by: Paolo Bonzini --- hw/block/virtio-blk.c | 10

[Qemu-block] [PATCH 09/40] vring: make vring_enable_notification return void

2015-11-24 Thread Paolo Bonzini
Make the API more similar to the regular virtqueue API. Signed-off-by: Paolo Bonzini --- hw/block/dataplane/virtio-blk.c | 3 ++- hw/virtio/dataplane/vring.c | 3 +-- include/hw/virtio/dataplane/vring.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)

[Qemu-block] [PATCH 08/40] vring: slim down allocation of VirtQueueElements

2015-11-24 Thread 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. Signed-off-by: Paolo Bonzini ---

[Qemu-block] [PATCH 22/40] aio: make ctx->list_lock a QemuLockCnt, subsuming ctx->walking_bh

2015-11-24 Thread Paolo Bonzini
This will make it possible to walk the list of bottom halves without holding the AioContext lock---and in turn to call bottom half handlers without holding the lock. Signed-off-by: Paolo Bonzini --- async.c | 31 ++-

[Qemu-block] [PATCH 11/40] virtio: add AioContext-specific function for host notifiers

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/virtio/virtio.c | 16 include/hw/virtio/virtio.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 0e9fff6..c835451 100644 --- a/hw/virtio/virtio.c +++

[Qemu-block] [PATCH 05/40] virtio: read/write the VirtQueueElement a field at a time

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/virtio/virtio.c | 95 -- 1 file changed, 93 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index fd63206..f5f8108 100644 --- a/hw/virtio/virtio.c +++

[Qemu-block] [PATCH 23/40] qemu-thread: optimize QemuLockCnt with futexes on Linux

2015-11-24 Thread Paolo Bonzini
This is complex, but I think it is reasonably documented in the source. Signed-off-by: Paolo Bonzini --- docs/lockcnt.txt | 9 +- include/qemu/futex.h | 36 ++ include/qemu/thread.h| 3 + trace-events | 10 ++ util/lockcnt.c |

[Qemu-block] [PATCH 36/40] aio: update locking documentation

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- docs/multiple-iothreads.txt | 65 +++-- 1 file changed, 57 insertions(+), 8 deletions(-) diff --git a/docs/multiple-iothreads.txt b/docs/multiple-iothreads.txt index 4197f62..729c64b 100644 ---

[Qemu-block] [PATCH 33/40] block: explicitly acquire aiocontext in bottom halves that need it

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- async.c | 2 -- block/archipelago.c | 3 +++ block/blkdebug.c | 4 block/blkverify.c | 3 +++ block/block-backend.c | 4 block/curl.c | 25 + block/gluster.c | 2

[Qemu-block] [PATCH 15/40] virtio-scsi: do not use vring in dataplane

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/scsi/virtio-scsi-dataplane.c | 196 +--- hw/scsi/virtio-scsi.c | 51 ++- include/hw/virtio/virtio-scsi.h | 21 + 3 files changed, 35 insertions(+), 233 deletions(-) diff --git

[Qemu-block] [PATCH 38/40] aio-posix: partially inline aio_dispatch into aio_poll

2015-11-24 Thread Paolo Bonzini
This patch prepares for the removal of unnecessary lockcnt inc/dec pairs. Extract the dispatching loop for file descriptor handlers into a new function aio_dispatch_handlers, and then inline aio_dispatch into aio_poll. aio_dispatch can now become void. Signed-off-by: Paolo Bonzini

[Qemu-block] [PATCH 13/40] virtio-blk: fix "disabled data plane" mode

2015-11-24 Thread Paolo Bonzini
In disabled mode, virtio-blk dataplane seems to be enabled, but flow actually goes through the normal virtio path. This patch simplifies a bit the handling of disabled mode. In disabled mode, virtio_blk_handle_output might be called even if s->dataplane is not NULL. This is a bit tricky,

[Qemu-block] [PATCH 18/40] qemu-thread: introduce QemuRecMutex

2015-11-24 Thread Paolo Bonzini
GRecMutex is new in glib 2.32, so we cannot use it. Introduce a recursive mutex in qemu-thread instead, which will be used instead of RFifoLock. Signed-off-by: Paolo Bonzini --- include/qemu/thread-posix.h | 6 ++ include/qemu/thread-win32.h | 10 ++

[Qemu-block] [PATCH 19/40] aio: convert from RFifoLock to QemuRecMutex

2015-11-24 Thread Paolo Bonzini
It is simpler and a bit faster, and QEMU does not need the contention callbacks (and thus the fairness) anymore. Signed-off-by: Paolo Bonzini --- async.c | 8 ++--- include/block/aio.h | 3 +- include/qemu/rfifolock.h | 54

[Qemu-block] [PATCH 16/40] vring: remove

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/virtio/Makefile.objs | 1 - hw/virtio/dataplane/Makefile.objs | 1 - hw/virtio/dataplane/vring.c | 547 -- include/hw/virtio/dataplane/vring-accessors.h | 75

[Qemu-block] [PATCH 39/40] async: remove unnecessary inc/dec pairs

2015-11-24 Thread Paolo Bonzini
Pull the increment/decrement pair out of aio_bh_poll and into the callers. Signed-off-by: Paolo Bonzini --- aio-posix.c | 7 ++- aio-win32.c | 9 ++--- async.c | 12 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/aio-posix.c

[Qemu-block] [PATCH 20/40] aio: rename bh_lock to list_lock

2015-11-24 Thread Paolo Bonzini
This will be used for AioHandlers too. There is going to be little or no contention, so it is better to reuse the same lock. Signed-off-by: Paolo Bonzini --- async.c | 16 include/block/aio.h | 2 +- 2 files changed, 9 insertions(+), 9

[Qemu-block] [PATCH 26/40] aio-win32: remove walking_handlers, protecting AioHandler list with list_lock

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- aio-win32.c | 81 + 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/aio-win32.c b/aio-win32.c index a05cffe..fe89b20 100644 --- a/aio-win32.c +++ b/aio-win32.c @@

[Qemu-block] [PATCH 34/40] block: explicitly acquire aiocontext in timers that need it

2015-11-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- aio-posix.c | 2 -- aio-win32.c | 2 -- block/curl.c| 2 ++ block/iscsi.c | 2 ++ block/null.c| 4 block/qed.c | 2 ++ block/throttle-groups.c

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 2/3] block: Hide HBitmap in block dirty bitmap interface

2015-11-24 Thread John Snow
On 11/23/2015 09:28 PM, Fam Zheng wrote: > On Mon, 11/23 16:34, John Snow wrote: >> Hmm, what's the idea, here? >> >> This patch does a lot more than just hide hbitmap details from callers >> of block_dirty_bitmap functions. >> >> So we're changing the backing hbitmap to always be one where g=0

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 2/3] block: Hide HBitmap in block dirty bitmap interface

2015-11-24 Thread Vladimir Sementsov-Ogievskiy
On 24.11.2015 05:28, Fam Zheng wrote: On Mon, 11/23 16:34, John Snow wrote: Hmm, what's the idea, here? This patch does a lot more than just hide hbitmap details from callers of block_dirty_bitmap functions. So we're changing the backing hbitmap to always be one where g=0 and the number of

Re: [Qemu-block] [Qemu-devel] [PATCH v2 14/21] blockdev: Set 'format' indicates non-empty drive

2015-11-24 Thread Wen Congyang
On 11/23/2015 11:59 PM, Kevin Wolf wrote: > Creating an empty drive while specifying 'format' doesn't make sense. > The specified format driver would simply be ignored. > > Make a set 'format' option an indication that a non-empty drive should > be created. This makes 'format' consistent with

Re: [Qemu-block] [PATCH] qemu-iotests: Add -nographic when starting QEMU in 119 and 120

2015-11-24 Thread Kevin Wolf
Am 23.11.2015 um 22:15 hat Max Reitz geschrieben: > On 23.11.2015 03:32, Fam Zheng wrote: > > Otherwise, a window flashes on my desktop (built with SDL). Add this as > > other cases have it. > > > > Signed-off-by: Fam Zheng > > > > --- > > v2: Fix 119 too. [Max] > > --- > >

Re: [Qemu-block] [PATCH -qemu] nvme: support Google vendor extension

2015-11-24 Thread Paolo Bonzini
On 24/11/2015 07:29, Ming Lin wrote: >> Here is new performance number: >> >> qemu-nvme + google-ext + eventfd: 294MB/s >> virtio-blk: 344MB/s >> virtio-scsi: 296MB/s >> >> It's almost same as virtio-scsi. Nice. Pretty good indeed. > Looks like "regular MMIO" runs in vcpu thread, while "eventfd

Re: [Qemu-block] [PATCH v2] raw-posix.c: Make GetBSDPath() handle caching options

2015-11-24 Thread Kevin Wolf
Am 21.11.2015 um 01:17 hat Programmingkid geschrieben: > Add support for caching options that can be specified from > the command line. > > Signed-off-by: John Arbuckle Thanks, applied to the block branch. Kevin

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6 02/14] qcow: Assign bs->file->bs to file in qcow_co_get_block_status

2015-11-24 Thread Eric Blake
On 11/23/2015 10:21 PM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > block/qcow.c | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Eric Blake > > diff --git a/block/qcow.c b/block/qcow.c > index 558f443..b59383f 100644 > --- a/block/qcow.c > +++

Re: [Qemu-block] [PATCH for-2.6 12/14] qemu-img: In 'map', use QDict to generate JSON output

2015-11-24 Thread Paolo Bonzini
On 24/11/2015 06:22, Fam Zheng wrote: > case OFORMAT_JSON: > -printf("%s{ \"start\": %"PRId64", \"length\": %"PRId64", \"depth\": > %d," > - " \"zero\": %s, \"data\": %s", > - (e->start == 0 ? "[" : ",\n"), > - e->start, e->length,

[Qemu-block] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector()

2015-11-24 Thread Alberto Garcia
Commit 5f81724d made PIO read requests async but didn't add the relevant block_acct_failed() and block_acct_invalid() calls. Signed-off-by: Alberto Garcia --- hw/ide/atapi.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ide/atapi.c

[Qemu-block] [PATCH for-2.5 2/2] atapi: Fix code indentation

2015-11-24 Thread Alberto Garcia
This was accidentally changed by commit 5f81724d Signed-off-by: Alberto Garcia --- hw/ide/atapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 5e3791c..65f8dd4 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@

Re: [Qemu-block] [PATCH for-2.6 01/14] block: Add "file" output parameter to block status query functions

2015-11-24 Thread Paolo Bonzini
On 24/11/2015 06:21, Fam Zheng wrote: > +if (bs->file && *file == bs->file->bs && This check is unnecessary, just use "if (file)". Paolo > (ret & BDRV_BLOCK_DATA) && !(ret & BDRV_BLOCK_ZERO) && > (ret & BDRV_BLOCK_OFFSET_VALID)) { > +BlockDriverState *file2; >

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6 12/14] qemu-img: In 'map', use QDict to generate JSON output

2015-11-24 Thread Markus Armbruster
Paolo Bonzini writes: > On 24/11/2015 06:22, Fam Zheng wrote: >> case OFORMAT_JSON: >> -printf("%s{ \"start\": %"PRId64", \"length\": %"PRId64", \"depth\": >> %d," >> - " \"zero\": %s, \"data\": %s", >> - (e->start == 0 ? "[" :

Re: [Qemu-block] [PATCH for-2.6 01/14] block: Add "file" output parameter to block status query functions

2015-11-24 Thread Fam Zheng
On Tue, 11/24 12:47, Paolo Bonzini wrote: > > > On 24/11/2015 06:21, Fam Zheng wrote: > > +if (bs->file && *file == bs->file->bs && > > This check is unnecessary, just use "if (file)". "file" would be bs in the case of protocol, and this function will infinitely recurse. Fam

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6 12/14] qemu-img: In 'map', use QDict to generate JSON output

2015-11-24 Thread Fam Zheng
On Tue, 11/24 21:25, Fam Zheng wrote: > On Tue, 11/24 13:45, Markus Armbruster wrote: > > Paolo Bonzini writes: > > > > > On 24/11/2015 06:22, Fam Zheng wrote: > > >> case OFORMAT_JSON: > > >> -printf("%s{ \"start\": %"PRId64", \"length\": %"PRId64", > > >>

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6 12/14] qemu-img: In 'map', use QDict to generate JSON output

2015-11-24 Thread Paolo Bonzini
On 24/11/2015 14:30, Fam Zheng wrote: > Or you mean we don't have to serialize the list in one go, instead we can > serialize one MapEntry a time with QAPI like what we do now? Yes, serializing the whole list in one go needs a visitor that can do streaming. We can write the array manually, and

Re: [Qemu-block] [PATCH for-2.6 01/14] block: Add "file" output parameter to block status query functions

2015-11-24 Thread Paolo Bonzini
On 24/11/2015 13:50, Fam Zheng wrote: > > > +if (bs->file && *file == bs->file->bs && > > > > This check is unnecessary, just use "if (file)". > > "file" would be bs in the case of protocol, and this function will infinitely > recurse. Oh, that's right! But then I think we want to check

Re: [Qemu-block] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector()

2015-11-24 Thread Kevin Wolf
Am 24.11.2015 um 13:17 hat Alberto Garcia geschrieben: > Commit 5f81724d made PIO read requests async but didn't add the > relevant block_acct_failed() and block_acct_invalid() calls. > > Signed-off-by: Alberto Garcia No cover letter? Also, adding CC to John. Series:

Re: [Qemu-block] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector()

2015-11-24 Thread Alberto Garcia
On Tue 24 Nov 2015 01:47:52 PM CET, Kevin Wolf wrote: > Am 24.11.2015 um 13:17 hat Alberto Garcia geschrieben: >> Commit 5f81724d made PIO read requests async but didn't add the >> relevant block_acct_failed() and block_acct_invalid() calls. >> >> Signed-off-by: Alberto Garcia

Re: [Qemu-block] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector()

2015-11-24 Thread Kevin Wolf
Am 24.11.2015 um 13:52 hat Alberto Garcia geschrieben: > On Tue 24 Nov 2015 01:47:52 PM CET, Kevin Wolf wrote: > > Am 24.11.2015 um 13:17 hat Alberto Garcia geschrieben: > >> Commit 5f81724d made PIO read requests async but didn't add the > >> relevant block_acct_failed() and