Re: [Qemu-block] [Qemu-devel] [PATCH 06/13] vvfat: fix field names in FAT12/FAT16 boot sector

2017-05-16 Thread Hervé Poussineau
Le 16/05/2017 à 16:39, Kevin Wolf a écrit : Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: Specification: "FAT: General overview of on-disk format" v1.03, page 11 Signed-off-by: Hervé Poussineau --- block/vvfat.c | 10 +- 1 file changed, 5

Re: [Qemu-block] [Qemu-devel] [PATCH 05/13] vvfat: introduce offset_to_bootsector, offset_to_fat and offset_to_root_dir

2017-05-16 Thread Hervé Poussineau
Le 16/05/2017 à 16:16, Kevin Wolf a écrit : Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: - offset_to_bootsector is the number of sectors up to FAT bootsector - offset_to_fat is the number of sectors up to first File Allocation Table - offset_to_root_dir is the number of sectors up

Re: [Qemu-block] [Qemu-devel] [PATCH 03/13] vvfat: fix typos

2017-05-16 Thread Hervé Poussineau
Le 16/05/2017 à 15:21, Kevin Wolf a écrit : Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: @@ -806,7 +806,7 @@ static int read_directory(BDRVVVFATState* s, int mapping_index) (ROOT_ENTRIES - cur) * sizeof(direntry_t)); } - /* reget the mapping, since

Re: [Qemu-block] [PATCH] nvme: Add support for Controller Memory Buffers

2017-05-16 Thread Stephen Bates
> Awesome, this looks great! > > Acked-by: Keith Busch Thanks Keith! I still seem to be having issues getting my patches onto the qemu-* mailing lists. Does anyone have any idea how I go about rectifying that? Stephen

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: 147: Don't test inet6 if not available

2017-05-16 Thread Fam Zheng
On Fri, 05/05 18:21, Fam Zheng wrote: > This is the case in our docker tests, as we use --net=none there. Skip > this method. Ping. Is this patch okay? > > Signed-off-by: Fam Zheng > --- > tests/qemu-iotests/147 | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git

[Qemu-block] [PATCH v2 12/12] dirty-bitmap: Convert internal hbitmap size/granularity

2017-05-16 Thread Eric Blake
Now that all callers are using byte-based interfaces, there's no reason for our internal hbitmap to remain with sector-based granularity. It also simplifies our internal scaling, since we already know that hbitmap widens requests out to granularity boundaries. Signed-off-by: Eric Blake

[Qemu-block] [PATCH v2 09/12] dirty-bitmap: Change bdrv_[re]set_dirty_bitmap() to use bytes

2017-05-16 Thread Eric Blake
Some of the callers were already scaling bytes to sectors; others can be easily converted to pass byte offsets, all in our shift towards a consistent byte interface everywhere. Making the change will also make it easier to write the hold-out callers to use byte rather than sectors for their

[Qemu-block] [PATCH v2 11/12] dirty-bitmap: Switch bdrv_set_dirty() to bytes

2017-05-16 Thread Eric Blake
Both callers already had bytes available, but were scaling to sectors. Move the scaling to internal code. In the case of bdrv_aligned_pwritev(), we are now passing the exact offset rather than a rounded sector-aligned value, but that's okay as long as dirty bitmap widens start/bytes to

[Qemu-block] [PATCH v2 08/12] dirty-bitmap: Change bdrv_get_dirty() to take bytes

2017-05-16 Thread Eric Blake
Half the callers were already scaling bytes to sectors; the other half can eventually be simplified to use byte iteration. Both callers were already using the result as a bool, so make that explicit. Making the change also makes it easier for a future dirty-bitmap patch to offload scaling over

[Qemu-block] [PATCH v2 05/12] dirty-bitmap: Set iterator start by offset, not sector

2017-05-16 Thread Eric Blake
All callers to bdrv_dirty_iter_new() passed 0 for their initial starting point, drop that parameter. All callers to bdrv_set_dirty_iter() were scaling an offset to a sector number; move the scaling to occur internally to dirty bitmap code instead. Signed-off-by: Eric Blake

[Qemu-block] [PATCH v2 06/12] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset

2017-05-16 Thread Eric Blake
Thanks to recent cleanups, all callers were scaling a return value of sectors into bytes; do the scaling internally instead. Signed-off-by: Eric Blake Reviewed-by: John Snow --- v2: no change --- block/backup.c | 2 +- block/dirty-bitmap.c | 2 +-

[Qemu-block] [PATCH v2 04/12] dirty-bitmap: Track size in bytes

2017-05-16 Thread Eric Blake
We are still using an internal hbitmap that tracks a size in sectors, with the granularity scaled down accordingly, because it lets us use a shortcut for our iterators which are currently sector-based. But there's no reason we can't track the dirty bitmap size in bytes, since it is an

[Qemu-block] [PATCH v2 10/12] mirror: Switch mirror_dirty_init() to byte-based iteration

2017-05-16 Thread Eric Blake
Now that we have adjusted the majority of the calls this function makes to be byte-based, it is easier to read the code if it makes passes over the image using bytes rather than sectors. Signed-off-by: Eric Blake Reviewed-by: John Snow --- v2: no change ---

[Qemu-block] [PATCH v2 07/12] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes

2017-05-16 Thread Eric Blake
Thanks to recent cleanups, all callers were scaling a return value of sectors into bytes; do the scaling internally instead. Signed-off-by: Eric Blake Reviewed-by: John Snow --- v2: no change --- block/dirty-bitmap.c | 4 ++-- block/mirror.c | 13

[Qemu-block] [PATCH v2 02/12] migration: Don't lose errno across aio context changes

2017-05-16 Thread Eric Blake
set_dirty_tracking() was assuming that the errno value set by bdrv_create_dirty_bitmap() would not be corrupted by either blk_get_aio_context() or aio_context_release(). Rather than audit whether this assumption is safe, rewrite the code to just grab the value of errno sooner. CC:

[Qemu-block] [PATCH v2 01/12] dirty-bitmap: Report BlockDirtyInfo.count in bytes, as documented

2017-05-16 Thread Eric Blake
We've been documenting the value in bytes since its introduction in commit b9a9b3a4 (v1.3), where it was actually reported in bytes. Commit e4654d2 (v2.0) then removed things from block/qapi.c, in preparation for a rewrite to a list of dirty sectors in the next commit 21b5683 in block.c, but the

[Qemu-block] [PATCH v2 03/12] dirty-bitmap: Drop unused functions

2017-05-16 Thread Eric Blake
We had several functions that no one is currently using, and which use sector-based interfaces. I'm trying to convert towards byte-based interfaces, so it's easier to just drop the unused functions: bdrv_dirty_bitmap_size bdrv_dirty_bitmap_get_meta bdrv_dirty_bitmap_reset_meta

[Qemu-block] [PATCH v2 00/12] make dirty-bitmap byte-based

2017-05-16 Thread Eric Blake
There are patches floating around to add NBD_CMD_BLOCK_STATUS, but NBD wants to report status on byte granularity (even if the reporting will probably be naturally aligned to sectors or even much higher levels). I've therefore started the task of converting our block status code to report at a

Re: [Qemu-block] [PATCH] nvme: Add support for Controller Memory Buffers

2017-05-16 Thread Keith Busch
On Tue, May 16, 2017 at 01:10:59PM -0600, sba...@raithlin.com wrote: > From: Stephen Bates > > Implement NVMe Controller Memory Buffers (CMBs) which were added in > version 1.2 of the NVMe Specification. This patch adds an optional > argument (cmb_size_mb) which indicates

[Qemu-block] [PULL 8/8] curl: do not do aio_poll when waiting for a free CURLState

2017-05-16 Thread Jeff Cody
From: Paolo Bonzini Instead, put the CURLAIOCB on a wait list and yield; curl_clean_state will wake the corresponding coroutine. Because of CURL's callback-based structure, we cannot easily convert everything to CoMutex/CoQueue; keeping the QemuMutex is simpler. However,

[Qemu-block] [PULL 6/8] curl: convert CURLAIOCB to byte values

2017-05-16 Thread Jeff Cody
From: Paolo Bonzini This is in preparation for the conversion from bdrv_aio_readv to bdrv_co_preadv, and it also requires changing some of the size_t values to uint64_t. This was broken before for disks > 2TB, but now it would break at 4GB. Reviewed-by: Jeff Cody

[Qemu-block] [PULL 4/8] curl: avoid recursive locking of BDRVCURLState mutex

2017-05-16 Thread Jeff Cody
From: Paolo Bonzini The curl driver has a ugly hack where, if it cannot find an empty CURLState, it just uses aio_poll to wait for one to be empty. This is probably buggy when used together with dataplane, and the simplest way to fix it is to use coroutines instead. A more

[Qemu-block] [PULL 2/8] curl: strengthen assertion in curl_clean_state

2017-05-16 Thread Jeff Cody
From: Paolo Bonzini curl_clean_state should only be called after all AIOCBs have been completed. This is not so obvious for the call from curl_detach_aio_context, so assert that. Cc: qemu-sta...@nongnu.org Reviewed-by: Jeff Cody Signed-off-by: Paolo

[Qemu-block] [PULL 7/8] curl: convert readv to coroutines

2017-05-16 Thread Jeff Cody
From: Paolo Bonzini This is pretty simple. The bottom half goes away because, unlike bdrv_aio_readv, coroutine-based read can return immediately without yielding. However, for simplicity I kept the former bottom half handler in a separate function. Reviewed-by: Jeff Cody

[Qemu-block] [PULL 3/8] curl: never invoke callbacks with s->mutex held

2017-05-16 Thread Jeff Cody
From: Paolo Bonzini All curl callbacks go through curl_multi_do, and hence are called with s->mutex held. Note that with comments, and make curl_read_cb drop the lock before invoking the callback. Likewise for curl_find_buf, where the callback can be invoked by the caller.

[Qemu-block] [PULL 5/8] curl: split curl_find_state/curl_init_state

2017-05-16 Thread Jeff Cody
From: Paolo Bonzini If curl_easy_init fails, a CURLState is left with s->in_use = 1. Split curl_init_state in two, so that we can distinguish the two failures and call curl_clean_state if needed. While at it, simplify curl_find_state, removing a dummy loop. The aio_poll

[Qemu-block] [PULL 1/8] block: curl: Allow passing cookies via QCryptoSecret

2017-05-16 Thread Jeff Cody
From: Peter Krempa Since cookies can contain sensitive data (session ID, etc ...) it is desired to hide them from the prying eyes of users. Add a possibility to pass them via the secret infrastructure. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1447413

[Qemu-block] [PULL 0/8] Block patches for curl

2017-05-16 Thread Jeff Cody
The following changes since commit 3a8760664d5c1a1a93c9012bdb8ac07ab8fd4b0d: Merge tag 'tracing-pull-request' into staging (2017-05-12 10:39:35 -0400) are available in the git repository at: git://github.com/codyprime/qemu-kvm-jtc.git tags/block-pull-request for you to fetch changes up to

Re: [Qemu-block] [Qemu-devel] [PATCH 05/13] vvfat: introduce offset_to_bootsector, offset_to_fat and offset_to_root_dir

2017-05-16 Thread Kevin Wolf
Am 16.05.2017 um 17:05 hat Eric Blake geschrieben: > On 05/16/2017 09:16 AM, Kevin Wolf wrote: > > Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: > >> - offset_to_bootsector is the number of sectors up to FAT bootsector > >> - offset_to_fat is the number of sectors up to first File

Re: [Qemu-block] [PATCH] gluster: add support for PREALLOC_MODE_FALLOC

2017-05-16 Thread Jeff Cody
On Mon, May 15, 2017 at 09:11:36PM +0200, Niels de Vos wrote: > Add missing support for "preallocation=falloc" to the Gluster block > driver. This change bases its logic on that of block/file-posix.c and > removed the gluster_supports_zerofill() function in favour of an #ifdef > check in an easy

Re: [Qemu-block] [Qemu-devel] [PATCH 08/13] vvfat: correctly create long names for non-ASCII filenames

2017-05-16 Thread Kevin Wolf
Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: > Assume that input filename is encoded as UTF-8, so correctly create UTF-16 > encoding. > Reuse long_file_name structure to give back to caller the generated long name. > It will be used in next commit to transform the long file name into

Re: [Qemu-block] [PATCH 18/18] block: make accounting thread-safe

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:42:08PM +0200, Paolo Bonzini wrote: > diff --git a/block/accounting.c b/block/accounting.c > index 0429e31c9f..85890e4fe5 100644 > --- a/block/accounting.c > +++ b/block/accounting.c > @@ -35,6 +35,7 @@ static const int qtest_latency_ns = NANOSECONDS_PER_SECOND > /

Re: [Qemu-block] [PATCH v2 00/18] Block layer thread safety, part 1

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:41:50PM +0200, Paolo Bonzini wrote: > This series uses mutexes or atomic operations around core block layer > operations. The remaining parts include: > > I've removed the failing assertion in bdrv_aligned_pwritev in order to > test block migration. > > Paolo > >

Re: [Qemu-block] [PATCH 17/18] block: introduce block_account_one_io

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:42:07PM +0200, Paolo Bonzini wrote: > This is the common code to account operations that produced actual I/O. > > Signed-off-by: Paolo Bonzini > --- > v1->v2: new, to hoist qemu_clock_get_ns out of the > "if

Re: [Qemu-block] [PATCH 16/18] block: protect modification of dirty bitmaps with a mutex

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:42:06PM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > v1->v2: remove bdrv_get_dirty from API [Stefan] > convert block migration from bdrv_get_dirty to _locked > [Stefan] > > block/dirty-bitmap.c

Re: [Qemu-block] [Qemu-devel] [PATCH 05/13] vvfat: introduce offset_to_bootsector, offset_to_fat and offset_to_root_dir

2017-05-16 Thread Eric Blake
On 05/16/2017 09:16 AM, Kevin Wolf wrote: > Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: >> - offset_to_bootsector is the number of sectors up to FAT bootsector >> - offset_to_fat is the number of sectors up to first File Allocation Table >> - offset_to_root_dir is the number of

Re: [Qemu-block] [PATCH 15/18] migration/block: reset dirty bitmap before reading

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:42:05PM +0200, Paolo Bonzini wrote: > Any data that is returned by read may be stale already, the bitmap > has to be cleared before issuing the read. > > Signed-off-by: Paolo Bonzini > --- > v1->v2: new > > migration/block.c | 3 ++- > 1

Re: [Qemu-block] [PATCH 14/18] block: introduce dirty_bitmap_mutex

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:42:04PM +0200, Paolo Bonzini wrote: > It protects only the list of dirty bitmaps; in the next patch we will > also protect their content. > > Signed-off-by: Paolo Bonzini > --- > v1->v2: remove global mutex [Fam] > > block/dirty-bitmap.c

Re: [Qemu-block] [PATCH 13/18] block: protect tracked_requests and flush_queue with reqs_lock

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:42:03PM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > v1->v2: correct and simplify flush queue handling [Fam, me] > > block.c | 1 + > block/io.c| 16 ++-- >

Re: [Qemu-block] [PATCH 10/18] util: add stats64 module

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:42:00PM +0200, Paolo Bonzini wrote: > This module provides fast paths for 64-bit atomic operations on machines > that only have 32-bit atomic access. > > Signed-off-by: Paolo Bonzini > --- > v1->v2: use CONFIG_ATOMIC64 [Paolo] >

Re: [Qemu-block] [PATCH 09/18] throttle-groups: protect throttled requests with a CoMutex

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:41:59PM +0200, Paolo Bonzini wrote: > Another possibility is to use tg->lock, which we're holding anyway in > both schedule_next_request and throttle_group_co_io_limits_intercept. > This would require open-coding the CoQueue however, so I've chosen this > alternative. >

Re: [Qemu-block] [PATCH 08/18] throttle-groups: do not use qemu_co_enter_next

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:41:58PM +0200, Paolo Bonzini wrote: > Prepare for removing this function; always restart throttled requests > from coroutine context. This will matter when restarting throttled > requests will have to acquire a CoMutex. > > Signed-off-by: Paolo Bonzini

Re: [Qemu-block] [Qemu-devel] [PATCH 06/13] vvfat: fix field names in FAT12/FAT16 boot sector

2017-05-16 Thread Kevin Wolf
Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: > Specification: "FAT: General overview of on-disk format" v1.03, page 11 > Signed-off-by: Hervé Poussineau > --- > block/vvfat.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git

Re: [Qemu-block] [PATCH v3 0/7] curl: locking cleanups/fixes, coroutine conversion, remove aio_poll

2017-05-16 Thread Jeff Cody
On Mon, May 15, 2017 at 12:00:52PM +0200, Paolo Bonzini wrote: > Compared to v2, this silences checkpatch and correctly destroy the mutex on > exiting from curl_open with an error. > > Paolo > > Paolo Bonzini (7): > curl: strengthen assertion in curl_clean_state > curl: never invoke

Re: [Qemu-block] [PATCH] block/win32: fix 'ret not initialized' warning

2017-05-16 Thread Stefan Hajnoczi
On Tue, May 16, 2017 at 09:42:55AM +0200, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann > --- > block/file-win32.c | 1 + > 1 file changed, 1 insertion(+) Thanks, applied to my staging tree: https://github.com/stefanha/qemu/commits/staging Stefan signature.asc

Re: [Qemu-block] [Qemu-devel] [PATCH 05/13] vvfat: introduce offset_to_bootsector, offset_to_fat and offset_to_root_dir

2017-05-16 Thread Kevin Wolf
Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: > - offset_to_bootsector is the number of sectors up to FAT bootsector > - offset_to_fat is the number of sectors up to first File Allocation Table > - offset_to_root_dir is the number of sectors up to root directory sector Hm... These

Re: [Qemu-block] [PATCH 07/18] throttle-groups: only start one coroutine from drained_begin

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:41:57PM +0200, Paolo Bonzini wrote: > Starting all waiting coroutines from bdrv_drain_all is unnecessary; > throttle_group_co_io_limits_intercept calls schedule_next_request as > soon as the coroutine restarts, which in turn will restart the next > request if possible. >

Re: [Qemu-block] [PATCH 05/18] block: access wakeup with atomic ops

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:41:55PM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > v1->v2: add comment [Fam] > > block/io.c| 3 ++- > block/nfs.c | 4 +++- > block/sheepdog.c | 3 ++- > include/block/block.h

Re: [Qemu-block] [PATCH 01/18] block: access copy_on_read with atomic ops

2017-05-16 Thread Stefan Hajnoczi
On Thu, May 11, 2017 at 04:41:51PM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > v1->v2: use atomic_fetch_dec [Stefan] > > block.c | 6 -- > block/io.c| 8 > blockdev.c| 2 +- >

Re: [Qemu-block] [Qemu-devel] [PATCH 03/13] vvfat: fix typos

2017-05-16 Thread Kevin Wolf
Am 15.05.2017 um 22:31 hat Hervé Poussineau geschrieben: > Signed-off-by: Hervé Poussineau > --- > block/vvfat.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/block/vvfat.c b/block/vvfat.c > index 002bd86e42..57f2489689 100644 > ---

Re: [Qemu-block] [Qemu-devel] [PATCH 01/13] vvfat: fix qemu-img map and qemu-img convert

2017-05-16 Thread Kevin Wolf
Am 15.05.2017 um 22:42 hat Eric Blake geschrieben: > On 05/15/2017 03:31 PM, Hervé Poussineau wrote: > > - bs->total_sectors is the number of sectors of the whole disk > > - s->sector_count is the number of sectors of the FAT partition I wonder if we should rename s->sector_count into something

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Use QDict helpers for --force-share

2017-05-16 Thread Markus Armbruster
Eric Blake writes: > Fam's addition of --force-share in commits 459571f7 and 335e9937 > were developed prior to the addition of QDict scalar insertion > macros, but merged after the general cleanup in commit 46f5ac20. > Patch created mechanically by rerunning: > > spatch

Re: [Qemu-block] [PATCH 0/5] nbd: error path refactoring

2017-05-16 Thread Vladimir Sementsov-Ogievskiy
16.05.2017 13:00, Paolo Bonzini wrote: On 16/05/2017 11:45, Vladimir Sementsov-Ogievskiy wrote: Hi all. There are several patches, as preparation for v2 of my NBD BLOCK_STATUS series. patch 0001 was sent earlier and unchanged here. Thanks, applied. I suppose that if we can remove

Re: [Qemu-block] [Qemu-devel] [PATCH v4 0/6] COLO block replication supports shared disk case

2017-05-16 Thread 吴志勇
HI, Hai Liang Is there recently any plan to post libvirt support for COLO feature? Regards, Zhi Yong Wu At 2017-04-12 22:05:15, "zhanghailiang" wrote: >COLO block replication doesn't support the shared disk case, >Here we try to implement it and this is the

Re: [Qemu-block] [Qemu-devel] [PATCH 0/5] nbd: error path refactoring

2017-05-16 Thread no-reply
Hi, This series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Subject: [Qemu-devel] [PATCH 0/5] nbd: error path refactoring Type: series Message-id:

Re: [Qemu-block] [PATCH 0/5] nbd: error path refactoring

2017-05-16 Thread Paolo Bonzini
On 16/05/2017 11:45, Vladimir Sementsov-Ogievskiy wrote: > Hi all. There are several patches, as preparation for v2 of my > NBD BLOCK_STATUS series. > > patch 0001 was sent earlier and unchanged here. Thanks, applied. I suppose that if we can remove nbd_negotiate_read/write/drop it's also

[Qemu-block] [PATCH 4/5] nbd: add errp to read_sync, write_sync and drop_sync

2017-05-16 Thread Vladimir Sementsov-Ogievskiy
There a lot of calls of these functions, which already have errp, which they are filling themselves. On the other hand, nbd_wr_syncv has errp parameter too, so it would be great to connect them. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/client.c | 76

[Qemu-block] [PATCH 3/5] nbd: add errp parameter to nbd_wr_syncv()

2017-05-16 Thread Vladimir Sementsov-Ogievskiy
Will be used in following patch to provide actual error message in some cases. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 4 ++-- include/block/nbd.h | 3 ++- nbd/common.c| 12 +--- nbd/nbd-internal.h | 4 ++-- 4 files

[Qemu-block] [PATCH 1/5] nbd: strict nbd_wr_syncv

2017-05-16 Thread Vladimir Sementsov-Ogievskiy
nbd_wr_syncv is called either from coroutine or from client negotiation code, when socket is in blocking mode. So, -EAGAIN is impossible. Furthermore, EAGAIN is confusing, as, what to read/write again? With EAGAIN as a return code we don't know how much data is already read or written by the

[Qemu-block] [PATCH 5/5] nbd/client.c: use errp instead of LOG

2017-05-16 Thread Vladimir Sementsov-Ogievskiy
Move to modern errp scheme from just LOGging errors. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 7 ++- include/block/nbd.h | 5 +++-- nbd/client.c| 26 ++ qemu-nbd.c | 3 ++- 4 files changed, 25

[Qemu-block] [PATCH 2/5] nbd: read_sync and friends: return 0 on success

2017-05-16 Thread Vladimir Sementsov-Ogievskiy
functions read_sync, drop_sync, write_sync, and also nbd_negotiate_write, nbd_negotiate_read, nbd_negotiate_drop_sync returns number of processed bytes. But what this number can be, except requested number of bytes? Actually, underlying nbd_wr_syncv function returns a value >= 0 and !=

Re: [Qemu-block] [PATCH v9 4/4] qemu-img: copy *key-secret opts when opening newly created files

2017-05-16 Thread Daniel P. Berrange
On Mon, May 15, 2017 at 07:43:15PM +0200, Max Reitz wrote: > On 2017-05-15 16:04, Daniel P. Berrange wrote: > > The qemu-img dd/convert commands will create an image file and > > then try to open it. Historically it has been possible to open > > new files without passing any options. With

Re: [Qemu-block] [PATCH v4] qemu-img: Check for backing image if specified during create

2017-05-16 Thread Kevin Wolf
Am 15.05.2017 um 21:17 hat Max Reitz geschrieben: > On 2017-05-15 20:41, Max Reitz wrote: > > On 2017-05-12 21:47, John Snow wrote: > >> > >> > >> On 05/12/2017 03:46 PM, Eric Blake wrote: > >>> On 05/12/2017 01:07 PM, Max Reitz wrote: > On 2017-05-11 20:27, John Snow wrote: > > Fixes:

Re: [Qemu-block] [Qemu-devel] [PATCH] block/win32: fix 'ret not initialized' warning

2017-05-16 Thread Fam Zheng
On Tue, 05/16 09:52, Stefan Weil wrote: > Am 16.05.2017 um 09:42 schrieb Gerd Hoffmann: > > Signed-off-by: Gerd Hoffmann > > --- > > block/file-win32.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/block/file-win32.c b/block/file-win32.c > > index

Re: [Qemu-block] [PATCH] block/win32: fix 'ret not initialized' warning

2017-05-16 Thread Stefan Weil
Am 16.05.2017 um 09:42 schrieb Gerd Hoffmann: Signed-off-by: Gerd Hoffmann --- block/file-win32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/file-win32.c b/block/file-win32.c index 1a35dbabf2..8f14f0bdcd 100644 --- a/block/file-win32.c +++ b/block/file-win32.c

[Qemu-block] [PATCH] block/win32: fix 'ret not initialized' warning

2017-05-16 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- block/file-win32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/file-win32.c b/block/file-win32.c index 1a35dbabf2..8f14f0bdcd 100644 --- a/block/file-win32.c +++ b/block/file-win32.c @@ -346,6 +346,7 @@ static int