[Qemu-block] [PATCH v2 2/4] Introduce attributes to qemu timer subsystem

2018-10-17 Thread Artem Pisarenko
Attributes are simple flags, associated with individual timers for their whole lifetime. They intended to be used to mark individual timers for special handling by various qemu features operating at qemu core level. New/init functions family in timer interface updated and refactored (new 'attrib

Re: [Qemu-block] [PATCH v2 1/8] block: Update flags in bdrv_set_read_only()

2018-10-17 Thread Alberto Garcia
On Fri 12 Oct 2018 01:55:25 PM CEST, Kevin Wolf wrote: > To fully change the read-only state of a node, we must not only change > bs->read_only, but also update bs->open_flags. > > Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH v2 2/4] Introduce attributes to qemu timer subsystem

2018-10-17 Thread Stefan Hajnoczi
On Wed, Oct 17, 2018 at 02:24:19PM +0600, Artem Pisarenko wrote: > Attributes are simple flags, associated with individual timers for their > whole lifetime. > They intended to be used to mark individual timers for special handling by > various qemu features operating at qemu core level. I'm wor

Re: [Qemu-block] [PATCH v2 2/4] Introduce attributes to qemu timer subsystem

2018-10-17 Thread Paolo Bonzini
On 17/10/2018 11:12, Stefan Hajnoczi wrote: >> Attributes are simple flags, associated with individual timers for their >> whole lifetime. >> They intended to be used to mark individual timers for special handling by >> various qemu features operating at qemu core level. > I'm worried that this s

Re: [Qemu-block] [PATCH] block/vhdx: Don't take address of fields in packed structs

2018-10-17 Thread Stefan Hajnoczi
On Tue, Oct 16, 2018 at 06:09:38PM +0100, Peter Maydell wrote: > Taking the address of a field in a packed struct is a bad idea, because > it might not be actually aligned enough for that pointer type (and > thus cause a crash on dereference on some host architectures). Newer > versions of clang wa

Re: [Qemu-block] [PATCH] block/vdi: Don't take address of fields in packed structs

2018-10-17 Thread Stefan Hajnoczi
On Tue, Oct 16, 2018 at 06:25:03PM +0100, Peter Maydell wrote: > Taking the address of a field in a packed struct is a bad idea, because > it might not be actually aligned enough for that pointer type (and > thus cause a crash on dereference on some host architectures). Newer > versions of clang wa

Re: [Qemu-block] [PATCH] migration/block-dirty-bitmap: fix Coverity CID1390625

2018-10-17 Thread Stefan Hajnoczi
On Tue, Oct 16, 2018 at 04:20:18PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Theoretically possible that we finish the skipping loop with bs = NULL > and the following code will crash trying to dereference it. Fix that. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > migration/block-d

Re: [Qemu-block] [PATCH v2 2/4] Introduce attributes to qemu timer subsystem

2018-10-17 Thread Artem Pisarenko
> Further down in this patch the notation is QEMU_TIMER_ATTR_, which I > think is clearer because QEMU_TIMER_ATTR(id) looks like a (non-existent) > macro. Please use the QEMU_TIMER_ATTR_ notation consistently. Yes, I've just forgot to update comments after previous patch version, where it actuall

Re: [Qemu-block] [PATCH v2 2/4] Introduce attributes to qemu timer subsystem

2018-10-17 Thread Paolo Bonzini
On 17/10/2018 12:57, Artem Pisarenko wrote: >> Further down in this patch the notation is QEMU_TIMER_ATTR_, which I >> think is clearer because QEMU_TIMER_ATTR(id) looks like a (non-existent) >> macro.  Please use the QEMU_TIMER_ATTR_ notation consistently. > > Yes, I've just forgot to update comm

Re: [Qemu-block] [PATCH v3 1/6] qemu-nbd: add support for authorization of TLS clients

2018-10-17 Thread Juan Quintela
Daniel P. Berrangé wrote: > From: "Daniel P. Berrange" > > Currently any client which can complete the TLS handshake is able to use > the NBD server. The server admin can turn on the 'verify-peer' option > for the x509 creds to require the client to provide a x509 certificate. > This means the cl

Re: [Qemu-block] [PATCH v3 2/6] nbd: allow authorization with nbd-server-start QMP command

2018-10-17 Thread Juan Quintela
Daniel P. Berrangé wrote: > From: "Daniel P. Berrange" > > As with the previous patch to qemu-nbd, the nbd-server-start QMP command > also needs to be able to specify authorization when enabling TLS encryption. > > First the client must create a QAuthZ object instance using the > 'object-add' com

Re: [Qemu-block] [PATCH v3 3/6] migration: add support for a "tls-authz" migration parameter

2018-10-17 Thread Juan Quintela
Daniel P. Berrangé wrote: > From: "Daniel P. Berrange" > > The QEMU instance that runs as the server for the migration data > transport (ie the target QEMU) needs to be able to configure access > control so it can prevent unauthorized clients initiating an incoming > migration. This adds a new 't

Re: [Qemu-block] [PATCH v3 4/6] chardev: add support for authorization for TLS clients

2018-10-17 Thread Juan Quintela
Daniel P. Berrangé wrote: > From: "Daniel P. Berrange" > > Currently any client which can complete the TLS handshake is able to use > a chardev server. The server admin can turn on the 'verify-peer' option > for the x509 creds to require the client to provide a x509 > certificate. This means the

[Qemu-block] [PATCH v2 09/14] block: Use bdrv_reopen_set_read_only() in the mirror driver

2018-10-17 Thread Alberto Garcia
The 'block-commit' QMP command is implemented internally using two different drivers. If the source image is the active layer then the mirror driver is used (commit_active_start()), otherwise the commit driver is used (commit_start()). In both cases the destination image must be put temporarily in

[Qemu-block] [PATCH v2 05/14] block: Use bdrv_reopen_set_read_only() in bdrv_commit()

2018-10-17 Thread Alberto Garcia
This patch replaces the bdrv_reopen() calls that set and remove the BDRV_O_RDWR flag with the new bdrv_reopen_set_read_only() function. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/commit.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block/commit

[Qemu-block] [PATCH v2 02/14] block: Add bdrv_reopen_set_read_only()

2018-10-17 Thread Alberto Garcia
Most callers of bdrv_reopen() only use it to switch a BlockDriverState between read-only and read-write, so this patch adds a new function that does just that. We also want to get rid of the flags parameter in the bdrv_reopen() API, so this function sets the "read-only" option and passes the origi

[Qemu-block] [PATCH v2 13/14] block: Remove flags parameter from bdrv_reopen_queue()

2018-10-17 Thread Alberto Garcia
Now that all callers are passing all flag changes as QDict options, the flags parameter is no longer necessary, so we can get rid of it. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block.c | 5 +++-- block/replication.c | 6 ++ include/block/block.h | 3 +-- qem

[Qemu-block] [PATCH v2 14/14] block: Stop passing flags to bdrv_reopen_queue_child()

2018-10-17 Thread Alberto Garcia
Now that all callers are passing the new options using the QDict we no longer need the 'flags' parameter. This patch makes the following changes: 1) The update_options_from_flags() call is no longer necessary so it can be removed. 2) The update_flags_from_options() call is now used i

[Qemu-block] [PATCH v2 03/14] block: Use bdrv_reopen_set_read_only() in bdrv_backing_update_filename()

2018-10-17 Thread Alberto Garcia
This patch replaces the bdrv_reopen() calls that set and remove the BDRV_O_RDWR flag with the new bdrv_reopen_set_read_only() function. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block.c b/block

[Qemu-block] [PATCH v2 06/14] block: Use bdrv_reopen_set_read_only() in stream_start/complete()

2018-10-17 Thread Alberto Garcia
This patch replaces the bdrv_reopen() calls that set and remove the BDRV_O_RDWR flag with the new bdrv_reopen_set_read_only() function. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/stream.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --gi

[Qemu-block] [PATCH v2 04/14] block: Use bdrv_reopen_set_read_only() in commit_start/complete()

2018-10-17 Thread Alberto Garcia
This patch replaces the bdrv_reopen() calls that set and remove the BDRV_O_RDWR flag with the new bdrv_reopen_set_read_only() function. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/commit.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/b

[Qemu-block] [PATCH v2 08/14] block: Use bdrv_reopen_set_read_only() in external_snapshot_commit()

2018-10-17 Thread Alberto Garcia
This patch replaces the bdrv_reopen() call that set and remove the BDRV_O_RDWR flag with the new bdrv_reopen_set_read_only() function. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- blockdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.

[Qemu-block] [PATCH v2 07/14] block: Use bdrv_reopen_set_read_only() in qmp_change_backing_file()

2018-10-17 Thread Alberto Garcia
This patch replaces the bdrv_reopen() calls that set and remove the BDRV_O_RDWR flag with the new bdrv_reopen_set_read_only() function. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- blockdev.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/blockdev.c b/bl

[Qemu-block] [PATCH v2 01/14] block: Don't call update_flags_from_options() if the options are wrong

2018-10-17 Thread Alberto Garcia
If qemu_opts_absorb_qdict() fails and we carry on and call update_flags_from_options() then that can result on a failed assertion: $ qemu-io -c 'reopen -o read-only=foo' hd.qcow2 block.c:1101: update_flags_from_options: Assertion `qemu_opt_find(opts, BDRV_OPT_CACHE_DIRECT)' failed. Abort

[Qemu-block] [PATCH v2 11/14] qemu-io: Put flag changes in the options QDict in reopen_f()

2018-10-17 Thread Alberto Garcia
When reopen_f() puts a block device in the reopen queue, some of the new options are passed using a QDict, but others ("read-only" and the cache options) are passed as flags. This patch puts those flags in the QDict. This way the flags parameter becomes redundant and we'll be able to get rid of it

[Qemu-block] [PATCH v2 00/14] Don't pass flags to bdrv_reopen_queue()

2018-10-17 Thread Alberto Garcia
Hi all, when reopening a BlockDriverState using bdrv_reopen() and friends the new options can be specified either with a QDict or with flags. Both methods overlap and that makes the semantics and the implementation unnecessarily complicated. This series removes the 'flags' parameter from these fu

[Qemu-block] [PATCH v2 12/14] block: Clean up reopen_backing_file() in block/replication.c

2018-10-17 Thread Alberto Garcia
This function is used to put the hidden and secondary disks in read-write mode before launching the backup job, and back in read-only mode afterwards. This patch does the following changes: - Use an options QDict with the "read-only" option instead of passing the changes as flags only. -

Re: [Qemu-block] [PATCH v2 2/4] Introduce attributes to qemu timer subsystem

2018-10-17 Thread Artem Pisarenko
Yes, but without words ..."when they fire" in attributes comments. ср, 17 окт. 2018 г. в 17:24, Paolo Bonzini : > On 17/10/2018 12:57, Artem Pisarenko wrote: > >> Further down in this patch the notation is QEMU_TIMER_ATTR_, which I > >> think is clearer because QEMU_TIMER_ATTR(id) looks like a (n

[Qemu-block] [PATCH v2 10/14] block: Drop bdrv_reopen()

2018-10-17 Thread Alberto Garcia
No one is using this function anymore, so we can safely remove it. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block.c | 21 - include/block/block.h | 1 - 2 files changed, 22 deletions(-) diff --git a/block.c b/block.c index 39d40f4556..406c2d1d

[Qemu-block] [PATCH] vpc: Don't leak opts in vpc_open()

2018-10-17 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block/vpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/vpc.c b/block/vpc.c index bf294abfa7..eace2ba484 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -454,10 +454,12 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags, }

[Qemu-block] [PATCH 1/3] qemu-iotests: Modern shellscripting (use $() instead of ``)

2018-10-17 Thread Mao Zhongyi
Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere. `pwd` and `basename $0` are in 231 files under directory tests/qemu-iotests, so replaced it with the following: sed -i 's/`pwd`/$(pwd)/g' $(git grep -l "\`pwd\`") sed -i 's/`

[Qemu-block] [PATCH 1/3] quorum: Remove quorum_err()

2018-10-17 Thread Alberto Garcia
This is a static function with only one caller, so there's no need to keep it. Inlining the code in quorum_compare() makes it much simpler. Signed-off-by: Alberto Garcia Reported-by: Markus Armbruster --- block/quorum.c | 24 +--- 1 file changed, 5 insertions(+), 19 deletion

[Qemu-block] [PATCH 3/3] iotest: Test the blkverify mode of the Quorum driver

2018-10-17 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- tests/qemu-iotests/081 | 30 ++ tests/qemu-iotests/081.out | 16 2 files changed, 46 insertions(+) diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081 index da3fb0984b..0ea010afbf 100755 --- a/tests/qemu-

[Qemu-block] [PATCH 0/3] Misc Quorum fixes

2018-10-17 Thread Alberto Garcia
Hi, Here's a couple of small fixes for the Quorum driver plus new test cases. See the individual patches for details. Regards, Berto Alberto Garcia (3): quorum: Remove quorum_err() quorum: Return an error if the blkverify mode has invalid settings iotest: Test the blkverify mode of the Qu

Re: [Qemu-block] [PATCH] block/vhdx: Don't take address of fields in packed structs

2018-10-17 Thread Kevin Wolf
Am 16.10.2018 um 19:09 hat Peter Maydell geschrieben: > Taking the address of a field in a packed struct is a bad idea, because > it might not be actually aligned enough for that pointer type (and > thus cause a crash on dereference on some host architectures). Newer > versions of clang warn about

[Qemu-block] [PATCH 2/3] quorum: Return an error if the blkverify mode has invalid settings

2018-10-17 Thread Alberto Garcia
The blkverify mode of Quorum can only be enabled if the number of children is exactly two and the value of vote-threshold is also two. If the user tries to enable it but the other settings are incorrect then QEMU simply prints an error message to stderr and carries on disabling the blkverify setti

Re: [Qemu-block] [PATCH v2 2/4] Introduce attributes to qemu timer subsystem

2018-10-17 Thread Paolo Bonzini
On 17/10/2018 15:07, Artem Pisarenko wrote: > Yes, but without words ..."when they fire" in attributes comments. For now the only attribute applies when timers fire; that sentence was a way to clarify the intended scope and address Stefan's comment. I can remove it too, but I'd like to understand

Re: [Qemu-block] [PATCH] block/vdi: Don't take address of fields in packed structs

2018-10-17 Thread Kevin Wolf
Am 16.10.2018 um 19:25 hat Peter Maydell geschrieben: > Taking the address of a field in a packed struct is a bad idea, because > it might not be actually aligned enough for that pointer type (and > thus cause a crash on dereference on some host architectures). Newer > versions of clang warn about

Re: [Qemu-block] [PATCH v2 2/4] Introduce attributes to qemu timer subsystem

2018-10-17 Thread Artem Pisarenko
>ср, 17 окт. 2018 г. в 20:43, Paolo Bonzini: >On 17/10/2018 15:07, Artem Pisarenko wrote: >> Yes, but without words ..."when they fire" in attributes comments. > > For now the only attribute applies when timers fire; that sentence was a > way to clarify the intended scope and address Stefan's comme

Re: [Qemu-block] [PATCH] vpc: Don't leak opts in vpc_open()

2018-10-17 Thread Alberto Garcia
On Wed 17 Oct 2018 03:33:50 PM CEST, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH 2/3] quorum: Return an error if the blkverify mode has invalid settings

2018-10-17 Thread Kevin Wolf
Am 17.10.2018 um 16:33 hat Alberto Garcia geschrieben: > The blkverify mode of Quorum can only be enabled if the number of > children is exactly two and the value of vote-threshold is also two. > > If the user tries to enable it but the other settings are incorrect > then QEMU simply prints an err

Re: [Qemu-block] [PATCH v4 3/8] ide: account UNMAP (TRIM) operations

2018-10-17 Thread Anton Nefedov
On 8/10/2018 7:43 PM, Kevin Wolf wrote: > Am 08.10.2018 um 18:04 hat Anton Nefedov geschrieben: >> >> >> On 8/10/2018 6:46 PM, Kevin Wolf wrote: >>> Am 08.10.2018 um 17:25 hat Anton Nefedov geschrieben: On 8/10/2018 6:03 PM, Kevin Wolf wrote: > Am 08.10.2018 um 16:38 hat Anton

Re: [Qemu-block] [PATCH 0/3] Misc Quorum fixes

2018-10-17 Thread Kevin Wolf
Am 17.10.2018 um 16:33 hat Alberto Garcia geschrieben: > Hi, > > Here's a couple of small fixes for the Quorum driver plus new test > cases. See the individual patches for details. Thanks, applied to the block branch. Kevin

Re: [Qemu-block] [PATCH 2/3] quorum: Return an error if the blkverify mode has invalid settings

2018-10-17 Thread Alberto Garcia
On Wed 17 Oct 2018 05:31:32 PM CEST, Kevin Wolf wrote: > Am 17.10.2018 um 16:33 hat Alberto Garcia geschrieben: >> The blkverify mode of Quorum can only be enabled if the number of >> children is exactly two and the value of vote-threshold is also two. >> >> If the user tries to enable it but the

Re: [Qemu-block] [PATCH 2/3] quorum: Return an error if the blkverify mode has invalid settings

2018-10-17 Thread Kevin Wolf
Am 17.10.2018 um 17:34 hat Alberto Garcia geschrieben: > On Wed 17 Oct 2018 05:31:32 PM CEST, Kevin Wolf wrote: > > Am 17.10.2018 um 16:33 hat Alberto Garcia geschrieben: > >> The blkverify mode of Quorum can only be enabled if the number of > >> children is exactly two and the value of vote-thresh

[Qemu-block] [PATCH v3 4/9] nbd: Support auto-read-only option

2018-10-17 Thread Kevin Wolf
If read-only=off, but auto-read-only=on is given, open a read-write NBD connection if the server provides a read-write export, but instead of erroring out for read-only exports, just degrade to read-only. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/nbd-client.c | 10 +-

[Qemu-block] [PATCH v3 9/9] block: Make auto-read-only=on default for -drive

2018-10-17 Thread Kevin Wolf
While we want machine interfaces like -blockdev and QMP blockdev-add to add as little auto-detection as possible so that management tools are explicit about their needs, -drive is a convenience option for human users. Enabling auto-read-only=on by default there enables users to use read-only images

[Qemu-block] [PATCH v3 1/9] block: Update flags in bdrv_set_read_only()

2018-10-17 Thread Kevin Wolf
To fully change the read-only state of a node, we must not only change bs->read_only, but also update bs->open_flags. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia --- block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block.c b/block.c index 0d6

[Qemu-block] [PATCH v3 0/9] block: Add auto-read-only option

2018-10-17 Thread Kevin Wolf
See patch 2 for an explanation of the motivation. v3: - Clarified QAPI schema documentation that auto-read-only can only degrade read-write to read-only, not the other way round [Eric] - Don't refuse to set copy-on-read=on and auto-read-only=on at the same time; only complain when actually try

[Qemu-block] [PATCH v3 6/9] curl: Support auto-read-only option

2018-10-17 Thread Kevin Wolf
If read-only=off, but auto-read-only=on is given, just degrade to read-only. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/curl.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/curl.c b/block/curl.c index fabb2b4da7..db5d2bd8ef 100644 --- a/block

[Qemu-block] [PATCH v3 3/9] block: Require auto-read-only for existing fallbacks

2018-10-17 Thread Kevin Wolf
Some block drivers have traditionally changed their node to read-only mode without asking the user. This behaviour has been marked deprecated since 2.11, expecting users to provide an explicit read-only=on option. Now that we have auto-read-only=on, enable these drivers to make use of the option.

[Qemu-block] [PATCH v3 2/9] block: Add auto-read-only option

2018-10-17 Thread Kevin Wolf
If a management application builds the block graph node by node, the protocol layer doesn't inherit its read-only option from the format layer any more, so it must be set explicitly. Backing files should work on read-only storage, but at the same time, a block job like commit should be able to reo

[Qemu-block] [PATCH v3 8/9] iscsi: Support auto-read-only option

2018-10-17 Thread Kevin Wolf
If read-only=off, but auto-read-only=on is given, open the volume read-write if we have the permissions, but instead of erroring out for read-only volumes, just degrade to read-only. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/iscsi.c | 8 +--- 1 file changed, 5 insertions(+

[Qemu-block] [PATCH v3 7/9] gluster: Support auto-read-only option

2018-10-17 Thread Kevin Wolf
If read-only=off, but auto-read-only=on is given, open the file read-write if we have the permissions, but instead of erroring out for read-only files, just degrade to read-only. Signed-off-by: Kevin Wolf --- block/gluster.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) di

[Qemu-block] [PATCH v3 5/9] file-posix: Support auto-read-only option

2018-10-17 Thread Kevin Wolf
If read-only=off, but auto-read-only=on is given, open the file read-write if we have the permissions, but instead of erroring out for read-only files, just degrade to read-only. Signed-off-by: Kevin Wolf --- block/file-posix.c | 19 --- 1 file changed, 16 insertions(+), 3 deleti

Re: [Qemu-block] [PATCH v4 0/6] dirty-bitmaps: fix QMP command permissions

2018-10-17 Thread Eric Blake
On 10/2/18 6:02 PM, John Snow wrote: based on: jsnow/bitmaps staging branch This series builds on a previous standalone patch and adjusts the permission for all (or most) of the QMP bitmap commands. V4: - Replace "in-use" with "in use" - Replace "user_modifiable" version with "user_locked"

Re: [Qemu-block] [PATCH v4 0/6] dirty-bitmaps: fix QMP command permissions

2018-10-17 Thread John Snow
On 10/17/2018 02:24 PM, Eric Blake wrote: > On 10/2/18 6:02 PM, John Snow wrote: >> based on: jsnow/bitmaps staging branch >> >> This series builds on a previous standalone patch and adjusts >> the permission for all (or most) of the QMP bitmap commands. >> >> V4: >>   - Replace "in-use" with "i

Re: [Qemu-block] [PATCH v3 7/9] gluster: Support auto-read-only option

2018-10-17 Thread Niels de Vos
On Wed, Oct 17, 2018 at 06:41:58PM +0200, Kevin Wolf wrote: > If read-only=off, but auto-read-only=on is given, open the file > read-write if we have the permissions, but instead of erroring out for > read-only files, just degrade to read-only. > > Signed-off-by: Kevin Wolf > --- > block/gluster

Re: [Qemu-block] [PATCH v3 2/9] block: Add auto-read-only option

2018-10-17 Thread Eric Blake
On 10/17/18 11:41 AM, Kevin Wolf wrote: If a management application builds the block graph node by node, the protocol layer doesn't inherit its read-only option from the format layer any more, so it must be set explicitly. The documentation for this option is consciously phrased in a way that

Re: [Qemu-block] [PATCH v3 3/9] block: Require auto-read-only for existing fallbacks

2018-10-17 Thread Eric Blake
On 10/17/18 11:41 AM, Kevin Wolf wrote: Some block drivers have traditionally changed their node to read-only mode without asking the user. This behaviour has been marked deprecated since 2.11, expecting users to provide an explicit read-only=on option. Now that we have auto-read-only=on, enable

Re: [Qemu-block] [PATCH v3 5/9] file-posix: Support auto-read-only option

2018-10-17 Thread Eric Blake
On 10/17/18 11:41 AM, Kevin Wolf wrote: If read-only=off, but auto-read-only=on is given, open the file read-write if we have the permissions, but instead of erroring out for read-only files, just degrade to read-only. Signed-off-by: Kevin Wolf --- block/file-posix.c | 19 ---

Re: [Qemu-block] [PATCH v3 9/9] block: Make auto-read-only=on default for -drive

2018-10-17 Thread Eric Blake
On 10/17/18 11:42 AM, Kevin Wolf wrote: While we want machine interfaces like -blockdev and QMP blockdev-add to add as little auto-detection as possible so that management tools are explicit about their needs, -drive is a convenience option for human users. Enabling auto-read-only=on by default t

Re: [Qemu-block] [PATCH v4 0/6] dirty-bitmaps: fix QMP command permissions

2018-10-17 Thread Eric Blake
On 10/2/18 6:08 PM, John Snow wrote: John Snow (6): block/dirty-bitmaps: add user_locked status checker block/dirty-bitmaps: fix merge permissions block/dirty-bitmaps: allow clear on disabled bitmaps block/dirty-bitmaps: prohibit enable/disable on locked/frozen bitmaps block/backu

[Qemu-block] [PATCH v2 1/3] qemu-iotests: Modern shellscripting (use $() instead of ``)

2018-10-17 Thread Mao Zhongyi
Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere. `pwd` and `basename $0` are in 231 files under directory tests/qemu-iotests, so replaced it with the following: sed -i 's/`pwd`/$(pwd)/g' $(git grep -l "\`pwd\`") sed -i 's/`

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/3] qemu-iotests: Modern shellscripting (use $() instead of ``)

2018-10-17 Thread Eric Blake
On 10/17/18 10:17 PM, Mao Zhongyi wrote: Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere. `pwd` and `basename $0` are in 231 files under directory tests/qemu-iotests, so replaced it with the following: sed -i 's/`pwd`/$(p