qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 06/10] block: Forbid trying to change unsupported options during reopen
Date: Wed, 5 Sep 2018 14:48:13 +0200	[thread overview]
Message-ID: <5ea8a9d1-eea9-5447-32ec-b2565c19287f@redhat.com> (raw)
In-Reply-To: <293e7df1bffd17584b6e36d11efb097ea48cd214.1535983918.git.berto@igalia.com>

[-- Attachment #1: Type: text/plain, Size: 1668 bytes --]

On 2018-09-03 16:34, Alberto Garcia wrote:
> The bdrv_reopen_prepare() function checks all options passed to each
> BlockDriverState (in the reopen_state->options QDict) and makes all
> necessary preparations to apply the option changes requested by the
> user.
> 
> Options are removed from the QDict as they are processed, so at the
> end of bdrv_reopen_prepare() only the options that can't be changed
> are left. Then a loop goes over all remaining options and verifies
> that the old and new values are identical, returning an error if
> they're not.
> 
> The problem is that at the moment there are options that are removed
> from the QDict although they can't be changed. The consequence of this
> is any modification to any of those options is silently ignored:
> 
>    (qemu) qemu-io virtio0 "reopen -o discard=on"
> 
> This happens when all options from bdrv_runtime_opts are removed
> from the QDict but then only a few of them are processed. Since
> it's especially important that "node-name" and "driver" are not
> changed, the code puts them back into the QDict so they are checked
> at the end of the function. Instead of putting only those two options
> back into the QDict, this patch puts all unprocessed options using
> qemu_opts_to_qdict().
> 
> update_flags_from_options() also needs to be modified to prevent
> BDRV_OPT_CACHE_NO_FLUSH, BDRV_OPT_CACHE_DIRECT and BDRV_OPT_READ_ONLY
> from going back to the QDict.
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
>  block.c | 22 +++++++---------------
>  1 file changed, 7 insertions(+), 15 deletions(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-09-05 12:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03 14:33 [Qemu-devel] [PATCH v2 00/10] Misc reopen-related patches Alberto Garcia
2018-09-03 14:33 ` [Qemu-devel] [PATCH v2 01/10] qemu-io: Fix writethrough check in reopen Alberto Garcia
2018-09-03 14:34 ` [Qemu-devel] [PATCH v2 02/10] file-posix: x-check-cache-dropped should default to false on reopen Alberto Garcia
2018-09-03 14:34 ` [Qemu-devel] [PATCH v2 03/10] block: Remove child references from bs->{options, explicit_options} Alberto Garcia
2018-09-05 12:37   ` Max Reitz
2018-09-03 14:34 ` [Qemu-devel] [PATCH v2 04/10] block: Don't look for child references in append_open_options() Alberto Garcia
2018-09-03 14:34 ` [Qemu-devel] [PATCH v2 05/10] block: Allow child references on reopen Alberto Garcia
2018-09-05 12:40   ` Max Reitz
2018-09-03 14:34 ` [Qemu-devel] [PATCH v2 06/10] block: Forbid trying to change unsupported options during reopen Alberto Garcia
2018-09-05 12:48   ` Max Reitz [this message]
2018-09-03 14:34 ` [Qemu-devel] [PATCH v2 07/10] file-posix: " Alberto Garcia
2018-09-05 12:49   ` Max Reitz
2018-09-03 14:34 ` [Qemu-devel] [PATCH v2 08/10] block: Allow changing 'discard' on reopen Alberto Garcia
2018-09-05 12:50   ` Max Reitz
2018-09-05 16:53   ` Alberto Garcia
2018-09-03 14:34 ` [Qemu-devel] [PATCH v2 09/10] block: Allow changing 'detect-zeroes' " Alberto Garcia
2018-09-05 12:52   ` Max Reitz
2018-09-03 14:34 ` [Qemu-devel] [PATCH v2 10/10] block: Allow changing 'force-share' " Alberto Garcia
2018-09-05 12:56   ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ea8a9d1-eea9-5447-32ec-b2565c19287f@redhat.com \
    --to=mreitz@redhat.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).