Re: [Qemu-block] [PATCH v3 17/19] qemu-nbd: Add --list option

2019-01-17 Thread Eric Blake
On 1/17/19 4:05 AM, Vladimir Sementsov-Ogievskiy wrote: > 12.01.2019 20:58, Eric Blake wrote: >> We want to be able to detect whether a given qemu NBD server is >> exposing the right export(s) and dirty bitmaps, at least for >> regression testing. We could use 'nbd-client -l' from the upstream >>

Re: [Qemu-block] [PATCH v3 17/19] qemu-nbd: Add --list option

2019-01-17 Thread Vladimir Sementsov-Ogievskiy
17.01.2019 19:58, Eric Blake wrote: > On 1/17/19 4:05 AM, Vladimir Sementsov-Ogievskiy wrote: >> 12.01.2019 20:58, Eric Blake wrote: >>> We want to be able to detect whether a given qemu NBD server is >>> exposing the right export(s) and dirty bitmaps, at least for >>> regression testing. We

Re: [Qemu-block] [PATCH 1/3] block: Expose protocol-specific data to 'qemu-img info'

2019-01-17 Thread Eric Blake
On 1/17/19 10:39 AM, Kevin Wolf wrote: > Am 17.01.2019 um 16:33 hat Eric Blake geschrieben: >> 'qemu-img info' is useful for showing additional information >> about an image - but sometimes the interesting information is >> specific to the protocol rather than to the format layer. Set >> the

Re: [Qemu-block] [Qemu-devel] [PATCH 00/13] Add a 'x-blockdev-reopen' QMP command

2019-01-17 Thread Alberto Garcia
On Thu 17 Jan 2019 04:50:20 PM CET, Eric Blake wrote: >> Removing the backing file can be done by simply passing the option { >> ..., "backing": null } to x-blockdev-reopen. >> > Hmm - that makes my proposal of "option":null as an explicit request > to the default a bit trickier, if we are

Re: [Qemu-block] [PATCH 1/3] block: Expose protocol-specific data to 'qemu-img info'

2019-01-17 Thread Kevin Wolf
Am 17.01.2019 um 16:33 hat Eric Blake geschrieben: > 'qemu-img info' is useful for showing additional information > about an image - but sometimes the interesting information is > specific to the protocol rather than to the format layer. Set > the groundwork for showing this information; further

Re: [Qemu-block] [Qemu-devel] [PATCH 03/15] hw/ssi: Remove SSIBus from "qemu/typedefs.h"

2019-01-17 Thread Markus Armbruster
Paolo Bonzini writes: > On 16/01/19 09:33, Markus Armbruster wrote: >> What problem exactly are we trying to solve here? >> To the best of my knowledge, typedefs.h has been working just fine for >> us, and I can't see why it shouldn't continue to work just fine. > > Patches don't have to solve

Re: [Qemu-block] [PATCH v3 18/19] nbd/client: Work around 3.0 bug for listing meta contexts

2019-01-17 Thread Vladimir Sementsov-Ogievskiy
17.01.2019 6:21, Eric Blake wrote: > On 1/16/19 9:43 AM, Vladimir Sementsov-Ogievskiy wrote: > >>> @@ -839,9 +842,25 @@ static int nbd_list_meta_contexts(QIOChannel *ioc, >>> >>>ret = nbd_receive_one_meta_context(ioc, >>> NBD_OPT_LIST_META_CONTEXT, >>>

Re: [Qemu-block] [Xen-devel] [PATCH] hw/block/xen: use proper format string for printing sectors

2019-01-17 Thread Paul Durrant
> -Original Message- > From: Alex Bennée [mailto:alex.ben...@linaro.org] > Sent: 17 January 2019 08:21 > To: Andrew Cooper > Cc: peter.mayd...@linaro.org; Kevin Wolf ; Stefano > Stabellini ; open list:Block layer core bl...@nongnu.org>; qemu-de...@nongnu.org; Max Reitz ; > Paul Durrant ;

Re: [Qemu-block] [Xen-devel] [PATCH] hw/block/xen: use proper format string for printing sectors

2019-01-17 Thread Alex Bennée
Andrew Cooper writes: > On 16/01/2019 12:13, Alex Bennée wrote: >> The %lu format string is different depending on the host architecture >> which causes builds like the debian-armhf-cross build to fail. Use the >> correct PRi64 format string. >> >> Signed-off-by: Alex Bennée >> --- >>

Re: [Qemu-block] [Qemu-devel] [PATCH 03/15] hw/ssi: Remove SSIBus from "qemu/typedefs.h"

2019-01-17 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Wed, Jan 16, 2019 at 12:49:07PM +0100, Paolo Bonzini wrote: >> On 16/01/19 12:34, Gerd Hoffmann wrote: >> > Hi, >> > >> >> typedefs.h is useful to avoid rebuilding the world too often if a type >> >> is used many times as a pointer, but rarely as a struct and

[Qemu-block] [PATCH v4 00/21] nbd: add qemu-nbd --list

2019-01-17 Thread Eric Blake
I got tired of debugging whether a server was advertising the correct things during negotiation by inspecting the trace logs of qemu-io as client - not to mention that without SOME sort of client tracing particular commands, we can't easily regression test the server for correct behavior. The

[Qemu-block] [PATCH v4 01/21] iotests: Make 233 output more reliable

2019-01-17 Thread Eric Blake
We have a race between the nbd server and the client both trying to report errors at once which can make the test sometimes fail if the output lines swap order under load. Break the race by collecting server messages into a file and then replaying that at the end of the test. Signed-off-by: Eric

[Qemu-block] [PATCH v4 02/21] maint: Allow for EXAMPLES in texi2pod

2019-01-17 Thread Eric Blake
The next commit will add an EXAMPLES section to qemu-nbd.8; for that to work, we need to recognize EXAMPLES in texi2pod. We also need to add a dependency from all man pages against the generator script, since a change to the generator may cause the resulting man page to differ. Signed-off-by:

Re: [Qemu-block] [Qemu-devel] [PATCH] dmg: fix binary search

2019-01-17 Thread John Snow
On 12/21/18 8:58 AM, yuchenlin wrote: > There is a possible hang in original binary searsh implemtation. That is > if chunk1 = 4, chunk2 = 5, chunk3 = 4, and we go else case. > > The chunk1 will be still 4, and so on. > > Signed-off-by: yuchenlin Generally we ask that people use their full

[Qemu-block] [PATCH v4 20/21] nbd/client: Work around 3.0 bug for listing meta contexts

2019-01-17 Thread Eric Blake
Commit 3d068aff forgot to advertise available qemu: contexts when the client requests a list with 0 queries. Furthermore, 3.0 shipped with a qemu-img hack of x-dirty-bitmap (commit 216ee365) that _silently_ acts as though the entire image is clean if a requested bitmap is not present. Both bugs

[Qemu-block] [PATCH v4 08/21] nbd/client: Refactor nbd_receive_list()

2019-01-17 Thread Eric Blake
Right now, nbd_receive_list() is only called by nbd_receive_query_exports(), which in turn is only called if the server lacks NBD_OPT_GO but has working option negotiation, and is merely used as a quality-of-implementation trick since servers can't give decent errors for NBD_OPT_EXPORT_NAME.

[Qemu-block] [PATCH v4 16/21] nbd/client: Refactor nbd_opt_go() to support NBD_OPT_INFO

2019-01-17 Thread Eric Blake
Rename the function to nbd_opt_info_or_go() with an added parameter and slight changes to comments and trace messages, in order to reuse the function for NBD_OPT_INFO. Signed-off-by: Eric Blake --- v4: split out new patch [Vladimir] --- nbd/client.c | 36

[Qemu-block] [PATCH v4 19/21] qemu-nbd: Add --list option

2019-01-17 Thread Eric Blake
We want to be able to detect whether a given qemu NBD server is exposing the right export(s) and dirty bitmaps, at least for regression testing. We could use 'nbd-client -l' from the upstream NBD project to list exports, but it's annoying to rely on out-of-tree binaries; furthermore, nbd-client

[Qemu-block] [PATCH v4 17/21] nbd/client: Add nbd_receive_export_list()

2019-01-17 Thread Eric Blake
We want to be able to detect whether a given qemu NBD server is exposing the right export(s) and dirty bitmaps, at least for regression testing. We could use 'nbd-client -l' from the upstream NBD project to list exports, but it's annoying to rely on out-of-tree binaries; furthermore, nbd-client

[Qemu-block] [PATCH v4 14/21] nbd/client: Split handshake into two functions

2019-01-17 Thread Eric Blake
An upcoming patch will add the ability for qemu-nbd to list the services provided by an NBD server. Share the common code of the TLS handshake by splitting the initial exchange into a separate function, leaving only the export handling in the original function. Functionally, there should be no

[Qemu-block] [PATCH v4 03/21] qemu-nbd: Enhance man page

2019-01-17 Thread Eric Blake
Document some useful qemu-nbd command lines. Mention some restrictions on particular options, like -p being only for MBR images, or -c/-d being Linux-only. Update some text given the recent change to no longer serve oldstyle protocol (missed in commit 7f7dfe2a). Also, consistently use trailing

[Qemu-block] [PATCH v4 07/21] qemu-nbd: Avoid strtol open-coding

2019-01-17 Thread Eric Blake
Our copy-and-pasted open-coding of strtol handling forgot to handle overflow conditions. Use qemu_strto*() instead. In the case of --partition, since we insist on a user-supplied partition to be non-zero, we can use 0 rather than -1 for our initial value to distinguish when a partition is not

Re: [Qemu-block] [Qemu-devel] [PATCH] dmg: fix binary search

2019-01-17 Thread John Snow
On 1/17/19 2:29 PM, John Snow wrote: > > > On 12/21/18 8:58 AM, yuchenlin wrote: >> There is a possible hang in original binary searsh implemtation. That is >> if chunk1 = 4, chunk2 = 5, chunk3 = 4, and we go else case. >> >> The chunk1 will be still 4, and so on. >> >> Signed-off-by:

[Qemu-block] [PATCH v4 04/21] qemu-nbd: Sanity check partition bounds

2019-01-17 Thread Eric Blake
When the user requests a partition, we were using data read from the disk as disk offsets without a bounds check. We got lucky that even when computed offsets are out-of-bounds, blk_pread() will gracefully catch the error later (so I don't think a malicious image can crash or exploit qemu-nbd, and

[Qemu-block] [PATCH v4 18/21] nbd/client: Add meta contexts to nbd_receive_export_list()

2019-01-17 Thread Eric Blake
We want to be able to detect whether a given qemu NBD server is exposing the right export(s) and dirty bitmaps, at least for regression testing. We could use 'nbd-client -l' from the upstream NBD project to list exports, but it's annoying to rely on out-of-tree binaries; furthermore, nbd-client

[Qemu-block] [PATCH v4 11/21] nbd/client: Split out nbd_send_meta_query()

2019-01-17 Thread Eric Blake
Refactor nbd_negotiate_simple_meta_context() to pull out the code that can be reused to send a LIST request for 0 or 1 query. No semantic change. The old comment about 'sizeof(uint32_t)' being equivalent to '/* number of queries */' is no longer needed, now that we are computing 'sizeof(queries)'

[Qemu-block] [PATCH v4 06/21] nbd/server: Favor [u]int64_t over off_t

2019-01-17 Thread Eric Blake
Although our compile-time environment is set up so that we always support long files with 64-bit off_t, we have no guarantee whether off_t is the same type as int64_t. This requires casts when printing values, and prevents us from directly using qemu_strtoi64() (which will be done in the next

[Qemu-block] [PATCH v4 05/21] nbd/server: Hoist length check to qmp_nbd_server_add

2019-01-17 Thread Eric Blake
We only had two callers to nbd_export_new; qemu-nbd.c always passed a valid offset/length pair (because it already checked the file length, to ensure that offset was in bounds), while blockdev-nbd.c always passed 0/-1. Then nbd_export_new reduces the size to a multiple of BDRV_SECTOR_SIZE (can

[Qemu-block] [PATCH v4 12/21] nbd/client: Split out nbd_receive_one_meta_context()

2019-01-17 Thread Eric Blake
Extract portions of nbd_negotiate_simple_meta_context() to a new function nbd_receive_one_meta_context() that copies the pattern of nbd_receive_list() for performing the argument validation of one reply. The error message when the server replies with more than one context changes slightly, but

[Qemu-block] [PATCH v4 09/21] nbd/client: Move export name into NBDExportInfo

2019-01-17 Thread Eric Blake
Refactor the 'name' parameter of nbd_receive_negotiate() from being a separate parameter into being part of the in-out 'info'. This also spills over to a simplification of nbd_opt_go(). The main driver for this refactoring is that an upcoming patch would like to add support to qemu-nbd to list

[Qemu-block] [PATCH v4 15/21] nbd/client: Pull out oldstyle size determination

2019-01-17 Thread Eric Blake
Another refactoring creating nbd_negotiate_finish_oldstyle() for further reuse during 'qemu-nbd --list'. Signed-off-by: Eric Blake Reviewed-by: Richard W.M. Jones --- nbd/client.c | 49 - 1 file changed, 32 insertions(+), 17 deletions(-) diff

[Qemu-block] [PATCH v4 21/21] iotests: Enhance 223, 233 to cover 'qemu-nbd --list'

2019-01-17 Thread Eric Blake
Any good new feature deserves some regression testing :) Coverage includes: - 223: what happens when there are 0 or more than 1 export, proof that we can see multiple contexts including qemu:dirty-bitmap - 233: proof that we can list over TLS, and that mix-and-match of plain/TLS listings will

[Qemu-block] [PATCH v4 10/21] nbd/client: Change signature of nbd_negotiate_simple_meta_context()

2019-01-17 Thread Eric Blake
Pass 'info' instead of three separate parameters related to info, when requesting the server to set the meta context. Update the NBDExportInfo struct to rename the received id field to match the fact that we are currently overloading the field to match whatever context the user supplied through

[Qemu-block] [PATCH v4 13/21] nbd/client: Refactor return of nbd_receive_negotiate()

2019-01-17 Thread Eric Blake
The function could only ever return 0 or -EINVAL; make this clearer by dropping a useless 'fail:' label. Signed-off-by: Eric Blake Reviewed-by: Richard W.M. Jones Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <20181215135324.152629-16-ebl...@redhat.com> --- nbd/client.c | 51

Re: [Qemu-block] [PATCH v5 4/6] nbd/server: implement dirty bitmap export

2019-01-17 Thread John Snow
On 1/9/19 2:21 PM, Eric Blake wrote: > Why are we restricting things to only export disabled bitmaps? Late reply, but the original thought almost surely was that we would only be exporting bitmaps for fleecing use, which should have a non-changing bitmap attached to it. Just some error

Re: [Qemu-block] [PATCH v3 17/19] qemu-nbd: Add --list option

2019-01-17 Thread Vladimir Sementsov-Ogievskiy
12.01.2019 20:58, Eric Blake wrote: > We want to be able to detect whether a given qemu NBD server is > exposing the right export(s) and dirty bitmaps, at least for > regression testing. We could use 'nbd-client -l' from the upstream > NBD project to list exports, but it's annoying to rely on >

Re: [Qemu-block] Crash when deleting an iothread that is being used

2019-01-17 Thread Stefan Hajnoczi
On Tue, Jan 15, 2019 at 03:29:42PM +0200, Alberto Garcia wrote: > Here's how to reproduce the crash: > > { "execute": "qmp_capabilities" } > { "execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": > "hd0"}} > { "execute": "object-add", "arguments": {"qom-type": "iothread",

Re: [Qemu-block] Crash when deleting an iothread that is being used

2019-01-17 Thread Alberto Garcia
On Thu 17 Jan 2019 11:23:31 AM CET, Stefan Hajnoczi wrote: > I'm asking because x-blockdev-set-iothread is a low-level testing > command and it can create IOThread configurations that real-world > users never reach. I see, I suppose I had the wrong assumption about that command then! Berto

Re: [Qemu-block] [PATCH v3 00/19] nbd: add qemu-nbd --list

2019-01-17 Thread Vladimir Sementsov-Ogievskiy
12.01.2019 20:57, Eric Blake wrote: > I got tired of debugging whether a server was advertising the > correct things during negotiation by inspecting the trace > logs of qemu-io as client - not to mention that without SOME > sort of client tracing particular commands, we can't easily > regression

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/6] Acquire the AioContext during _realize()

2019-01-17 Thread Alberto Garcia
On Wed 16 Jan 2019 02:54:44 PM CET, Stefan Hajnoczi wrote: > The x-blockdev-set-iothread command is for low-level tests so I don't > expect users to invoke it. As I said in a different e-mail maybe this is not necessary then. > This patch series makes virtio-blk and virtio-scsi more robust, >

Re: [Qemu-block] [PATCH v5 07/11] block: introduce backup-top filter driver

2019-01-17 Thread Vladimir Sementsov-Ogievskiy
16.01.2019 19:02, Max Reitz wrote: > On 29.12.18 13:20, Vladimir Sementsov-Ogievskiy wrote: >> Backup-top filter does copy-before-write operation. It should be >> inserted above active disk and has a target node for CBW, like the >> following: >> >> +---+ >> | Guest | >>

[Qemu-block] PING: [PATCH] blk: postpone request execution on a context protected with "drained section"

2019-01-17 Thread Denis Plotnikov
Kevin, could you please take a look at my last comments? Thanks! Denis On 15.01.2019 10:22, Denis Plotnikov wrote: > ping ping ping ping > > On 09.01.2019 11:18, Denis Plotnikov wrote: >> ping ping!!! >> >> On 18.12.2018 11:53, Denis Plotnikov wrote: >>> ping ping >>> >>> On 14.12.2018

Re: [Qemu-block] [Qemu-devel] [PATCH v3 19/19] iotests: Enhance 223, 233 to cover 'qemu-nbd --list'

2019-01-17 Thread Eric Blake
On 1/12/19 11:58 AM, Eric Blake wrote: > Any good new feature deserves some regression testing :) > Coverage includes: > - 223: what happens when there are 0 or more than 1 export, > proof that we can see multiple contexts including qemu:dirty-bitmap > - 233: proof that we can list over TLS, and

Re: [Qemu-block] [PATCH v3 00/19] nbd: add qemu-nbd --list

2019-01-17 Thread Eric Blake
On 1/17/19 5:38 AM, Vladimir Sementsov-Ogievskiy wrote: >> Since v2: >> - Several patches merged already >> - 3 new patches based on audit of off_t vs. strtol >> - rebase patches on top of other changes, such as qemu-nbd --bitmap >> - address various review comments [Vladimir, Rich] >> - drop

Re: [Qemu-block] [RFC] nbd: generalize usage of nbd_read

2019-01-17 Thread Eric Blake
On 1/16/19 8:23 AM, Vladimir Sementsov-Ogievskiy wrote: > We generally do very similar things around nbd_read: error_prepend, > specifying, what we have tried to read and be_to_cpu conversion of > integers. > > So, it seems reasonable to move common things to helper functions, > which: > 1.

Re: [Qemu-block] [PATCH v3 18/19] nbd/client: Work around 3.0 bug for listing meta contexts

2019-01-17 Thread Eric Blake
On 1/17/19 2:07 AM, Vladimir Sementsov-Ogievskiy wrote: > 17.01.2019 6:21, Eric Blake wrote: >> On 1/16/19 9:43 AM, Vladimir Sementsov-Ogievskiy wrote: >> @@ -839,9 +842,25 @@ static int nbd_list_meta_contexts(QIOChannel *ioc, ret = nbd_receive_one_meta_context(ioc,

Re: [Qemu-block] PING: [PATCH] blk: postpone request execution on a context protected with "drained section"

2019-01-17 Thread Kevin Wolf
Am 17.01.2019 um 13:57 hat Denis Plotnikov geschrieben: > Kevin, > > could you please take a look at my last comments? I read it, and what it told me is essentially that I need to work on it myself to fully understand the problem and possible acceptable solutions because you can't seem to find

[Qemu-block] [PATCH 3/3] RFC: nbd: Expose protocol-specific information

2019-01-17 Thread Eric Blake
Expose information that the NBD client remembers from its handshake with the server. This is comparable to what 'qemu-nbd --list' outputs when describing a server's capability, so a future patch may refactor that to reuse this QAPI type. The display of flags is interesting - rather than compute

[Qemu-block] [PATCH 2/3] file: Expose some protocol-specific information

2019-01-17 Thread Eric Blake
When analyzing performance, it might be nice to let 'qemu-img info' expose details that it learned from the underlying file or block device. Start the process by picking a few useful items determined during raw_open_common(). Signed-off-by: Eric Blake --- qapi/block-core.json | 24

[Qemu-block] [PATCH 1/3] block: Expose protocol-specific data to 'qemu-img info'

2019-01-17 Thread Eric Blake
'qemu-img info' is useful for showing additional information about an image - but sometimes the interesting information is specific to the protocol rather than to the format layer. Set the groundwork for showing this information; further patches will then enable specific pieces of information.

[Qemu-block] [PATCH 02/13] block: Freeze the backing chain for the duration of the commit job

2019-01-17 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- block/commit.c | 8 1 file changed, 8 insertions(+) diff --git a/block/commit.c b/block/commit.c index 53148e610b..8824d135e0 100644 --- a/block/commit.c +++ b/block/commit.c @@ -73,6 +73,8 @@ static int commit_prepare(Job *job) { CommitBlockJob

[Qemu-block] [PATCH 07/13] block: Allow omitting the 'backing' option in certain cases

2019-01-17 Thread Alberto Garcia
Of all options of type BlockdevRef used to specify children in BlockdevOptions, 'backing' is the only one that is optional. For "x-blockdev-reopen" we want that if an option is omitted then it must be reset to its default value. The default value of 'backing' means that QEMU opens the backing

[Qemu-block] [PATCH 10/13] block: Add bdrv_reset_options_allowed()

2019-01-17 Thread Alberto Garcia
bdrv_reopen_prepare() receives a BDRVReopenState with (among other things) a new set of options to be applied to that BlockDriverState. If an option is missing then it means that we want to reset it to its default value rather than keep the previous one. This way the state of the block device

[Qemu-block] [PATCH 06/13] block: Handle child references in bdrv_reopen_queue()

2019-01-17 Thread Alberto Garcia
Children in QMP are specified with BlockdevRef / BlockdevRefOrNull, which can contain a set of child options, a child reference, or NULL. In optional attributes like "backing" it can also be missing. Only the first case (set of child options) is being handled properly by bdrv_reopen_queue(). This

[Qemu-block] [PATCH 13/13] qemu-iotests: Test the x-blockdev-reopen QMP command

2019-01-17 Thread Alberto Garcia
This patch adds several tests for the x-blockdev-reopen QMP command. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/224 | 1001 tests/qemu-iotests/224.out |5 + tests/qemu-iotests/group |1 + 3 files changed, 1007 insertions(+)

[Qemu-block] [PATCH 00/13] Add a 'x-blockdev-reopen' QMP command

2019-01-17 Thread Alberto Garcia
Hi, here's a patch series to implement a QMP command for bdrv_reopen(). This is not too different from the previous iteration (RFC v2, see changes below), but I'm not tagging it as RFC any longer. The new command is called x-blockdev-reopen, and it's designed to be similar to blockdev-add. It

[Qemu-block] [PATCH 04/13] block: Freeze the backing chain for the duration of the stream job

2019-01-17 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- block/stream.c | 16 1 file changed, 16 insertions(+) diff --git a/block/stream.c b/block/stream.c index 7a49ac0992..39a2e10892 100644 --- a/block/stream.c +++ b/block/stream.c @@ -54,6 +54,14 @@ static int coroutine_fn

[Qemu-block] [PATCH 03/13] block: Freeze the backing chain for the duration of the mirror job

2019-01-17 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- block/mirror.c | 8 1 file changed, 8 insertions(+) diff --git a/block/mirror.c b/block/mirror.c index 22bef9f7e9..afbc30da61 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -630,6 +630,10 @@ static int mirror_exit_common(Job *job) }

[Qemu-block] [PATCH 11/13] block: Remove the AioContext parameter from bdrv_reopen_multiple()

2019-01-17 Thread Alberto Garcia
This parameter has been unused since 1a63a907507fbbcfaee3f622907ec244b Signed-off-by: Alberto Garcia --- block.c | 4 ++-- block/replication.c | 3 +-- include/block/block.h | 2 +- qemu-io-cmds.c| 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git

[Qemu-block] [PATCH 05/13] block: Add 'keep_old_opts' parameter to bdrv_reopen_queue()

2019-01-17 Thread Alberto Garcia
The bdrv_reopen_queue() function is used to create a queue with the BDSs that are going to be reopened and their new options. Once the queue is ready bdrv_reopen_multiple() is called to perform the operation. The original options from each one of the BDSs are kept, with the new options passed to

[Qemu-block] [PATCH 09/13] block: Add 'runtime_opts' and 'mutable_opts' fields to BlockDriver

2019-01-17 Thread Alberto Garcia
This patch adds two new fields to BlockDriver: - runtime_opts: list of runtime options for a particular block driver. We'll use this list later to detect what options are missing when we try to reopen a block device. - mutable_opts: names of the runtime options that can be reset

[Qemu-block] [PATCH 08/13] block: Allow changing the backing file on reopen

2019-01-17 Thread Alberto Garcia
This patch allows the user to change the backing file of an image that is being reopened. Here's what it does: - In bdrv_reopen_prepare(): check that the value of 'backing' points to an existing node or is null. If it points to an existing node it also needs to make sure that replacing the

[Qemu-block] [PATCH 12/13] block: Add an 'x-blockdev-reopen' QMP command

2019-01-17 Thread Alberto Garcia
This command allows reopening an arbitrary BlockDriverState with a new set of options. Some options (e.g node-name) cannot be changed and some block drivers don't allow reopening, but otherwise this command is modelled after 'blockdev-add' and the state of the reopened BlockDriverState should

[Qemu-block] [PATCH 01/13] block: Allow freezing BdrvChild links

2019-01-17 Thread Alberto Garcia
Our permission system is useful to define what operations are allowed on a certain block node and includes things like BLK_PERM_WRITE or BLK_PERM_RESIZE among others. One of the permissions is BLK_PERM_GRAPH_MOD which allows "changing the node that this BdrvChild points to". The exact meaning of

Re: [Qemu-block] [Qemu-devel] [PATCH 00/13] Add a 'x-blockdev-reopen' QMP command

2019-01-17 Thread Eric Blake
On 1/17/19 9:33 AM, Alberto Garcia wrote: > > Changing options > > The general idea is quite straightforward, but the devil is in the > details. Since this command tries to mimic blockdev-add, the state of > the block device after being reopened should generally be equivalent >

Re: [Qemu-block] PING: [PATCH] blk: postpone request execution on a context protected with "drained section"

2019-01-17 Thread Denis Plotnikov
On 17.01.2019 17:23, Kevin Wolf wrote: > Am 17.01.2019 um 13:57 hat Denis Plotnikov geschrieben: >> Kevin, >> >> could you please take a look at my last comments? > > I read it, and what it told me is essentially that I need to work on it > myself to fully understand the problem and possible