QEMU-Devel Archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Alberto Garcia <berto@igalia.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH v4 2/6] block: Allow changing bs->file on reopen
Date: Mon, 10 May 2021 12:26:16 +0300	[thread overview]
Message-ID: <6485251c-fc0a-c210-1fd0-2c74c34271ed@virtuozzo.com> (raw)
In-Reply-To: <YJVKD1Mh4ASCA1vU@merkur.fritz.box>

07.05.2021 17:09, Kevin Wolf wrote:
> Am 07.05.2021 um 09:11 hat Vladimir Sementsov-Ogievskiy geschrieben:
>> 17.03.2021 20:15, Alberto Garcia wrote:
>>> When the x-blockdev-reopen was added it allowed reconfiguring the
>>> graph by replacing backing files, but changing the 'file' option was
>>> forbidden. Because of this restriction some operations are not
>>> possible, notably inserting and removing block filters.
>>
>>
>> I now started to work on making backup-top filter public..
>>
>> And I think, we'll need separate commands to insert/remove filters
>> anyway.. As blockdev-reopen has the following problems:
>>
>> 1. It can't append filter above top node, connected to block-device.
>> (but bdrv_append() can do it)
> 
> We once had some patches that made the 'drive' qdev property runtime
> writable. What happened to them?
> 
>> 2. It can't simultaneously create new node and append it. This is
>> important for backup-top filter, which unshares write even when has no
>> writing parent. Now bdrv_append() works in a smart way for it: it
>> first do both graph modification (add child to filter, and replace
>> original node by filter) and then update graph permissions. So, we'll
>> need a command which in one roll create filter node and inserts it
>> where needed.
> 
> What backup-top could do, however, is enabling restrictions only if it
> has a parent (no matter whether that parent requires writing or not).
> 
>> 3. blockdev-reopen requires to specify all options (otherwise, they
>> will be changed to default). So it requires passing a lot of
>> information. But we don't need to touch any option of original bs
>> parent to insert a filter between parent and bs. In other words, we
>> don't want to reopen something. We want to insert filter.
> 
> Yeah, but this was a decision we made consciously because otherwise we'd
> have a hard time telling which options should be updated and which
> shouldn't, and we would need separate QAPI types for open and reopen.
> 
> If we now say that this is a reason for avoiding blockdev-reopen even
> though changing some option is the goal, that would be inconsistent.
> 
>>
>> ===
>>
>> Hmm, another mentioned use of blockdev-reopen was reopening some RO
>> node to RW, to modify bitmaps.. And here again, blockdev-reopen is not
>> very convenient:
>>
>> 1. Again, it requires to specify all options (at least, that was not
>> default on node open).. And this only to change one property:
>> read-only. Seems overcomplicated.
>>
>> 2. Bitmaps modifications are usually done in transactions. Adding a
>> clean transaction support for small command that reopens only to RW,
>> and back to RO on transaction finalization seems simpler, than for
>> entire generic blockdev-reopen.
>>
>>
>> ===
>>
>> Hmm, interesting. x-blockdev-reopen says that not specified options
>> are reset to default. x-blockdev-reopen works through
>> bdrv_reopen_multiple, so I think bdrv_reopen_mutliple should reset
>> options to default as well. Now look at bdrv_reopen_set_read_only():
>> it specifies only one option: "read-only". This means that all other
>> options will be reset to default. But for sure, callers of
>> bdrv_reopen_set_read_only() want only to change read-only status of
>> node, not all other options. Do we have a bug here?
> 
> The difference between these cases is the keep_old_opts parameter to
> bdrv_reopen_queue(). It is false for x-blockdev-reopen, but true in
> bdrv_reopen_set_read_only().
> 


Thanks for explanations, seems I panicked too early :) Will try your suggestions.


-- 
Best regards,
Vladimir


  reply	other threads:[~2021-05-10  9:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 17:15 [PATCH v4 0/6] Allow changing bs->file on reopen Alberto Garcia
2021-03-17 17:15 ` [PATCH v4 1/6] block: Add bdrv_reopen_queue_free() Alberto Garcia
2021-03-18 13:32   ` Vladimir Sementsov-Ogievskiy
2021-03-17 17:15 ` [PATCH v4 2/6] block: Allow changing bs->file on reopen Alberto Garcia
2021-03-18 14:25   ` Vladimir Sementsov-Ogievskiy
2021-03-24 12:25     ` Alberto Garcia
2021-03-24 15:08       ` Vladimir Sementsov-Ogievskiy
2021-05-05 13:58   ` Kevin Wolf
2021-05-07  7:11   ` Vladimir Sementsov-Ogievskiy
2021-05-07 14:09     ` Kevin Wolf
2021-05-10  9:26       ` Vladimir Sementsov-Ogievskiy [this message]
2021-03-17 17:15 ` [PATCH v4 3/6] iotests: Test replacing files with x-blockdev-reopen Alberto Garcia
2021-05-05 15:57   ` Kevin Wolf
2021-03-17 17:15 ` [PATCH v4 4/6] block: Support multiple reopening " Alberto Garcia
2021-03-18 14:45   ` Vladimir Sementsov-Ogievskiy
2021-05-05 16:18     ` Kevin Wolf
2021-05-06  9:21       ` Vladimir Sementsov-Ogievskiy
2021-03-17 17:15 ` [PATCH v4 5/6] iotests: Test reopening multiple devices at the same time Alberto Garcia
2021-03-17 17:15 ` [PATCH v4 6/6] block: Make blockdev-reopen stable API Alberto Garcia
2021-05-14 15:53 ` [PATCH v4 0/6] Allow changing bs->file on reopen Vladimir Sementsov-Ogievskiy
2021-06-09 15:53   ` Kevin Wolf
2021-06-09 16:40     ` Vladimir Sementsov-Ogievskiy
2021-06-10 12:10       ` Vladimir Sementsov-Ogievskiy

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=6485251c-fc0a-c210-1fd0-2c74c34271ed@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@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 read-only IMAP folder(s) and NNTP newsgroup(s).