From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, eblake@redhat.com, mreitz@redhat.com,
stefanha@redhat.com, jcody@redhat.com
Subject: [Qemu-devel] blockdev-commit design
Date: Tue, 26 Sep 2017 19:59:42 +0200 [thread overview]
Message-ID: <20170926175942.GE14717@localhost.localdomain> (raw)
Hi,
as the next step after my commit block job fixes, I'm trying to
implement a new, clean version of the QMP command, which I'm calling
blockdev-commit for consistency with all the other "modern" QMP
commands.
I'll start with the schema that I have so far:
{ 'command': 'blockdev-commit',
'data': { 'job-id': 'str', 'top': 'str', '*base': 'str'
'*backing-file': 'str', '*speed': 'int',
'*filter-node-name': 'str' } }
In comparison with the old command, the important changes are:
* top/base are node names instead of file names.
* You don't need to specify the active layer any more (not the least
because there could very well be more than one of them), but top
becomes mandatory instead.
* top/base don't accept device (BlockBackend) names, so for
consistency with other block jobs, job-id becomes mandatory.
Possible alternative: Accept device names and make them the default
for job-id. This is more consistent with existing blockdev-*
commands, but I consider BlockBackend names deprecated, so I prefer
not adding them here.
* filer-node-name is kept optional for now. Should we make it
mandatory, too?
This was the easy part. Then I started looking at the code and found a
few a bit more interesting questions:
* The old block-commit command decides between an "actual" commit job
and the mirror-based active commit based on whether top is the
active layer.
We don't get an option for the active layer any more now, so this
isn't how things can work for blockdev-commit. We could probably
check whether top has a BlockBackend parent, but that's not really
what we're interested in anyway. Maybe the best we could do to
decide this automatically is to check whether there is any parent of
top that requires write permissions. If there is, we need active
commit, otherwise the "normal" one is good enough.
However, who says that the intentions of the user stay as we deduce
them at the start of the block job? Who says that the user doesn't
want to add a writable disk as a user of the node while the block
job is running?
The optimal solution to this would be that the commit filter node
responds to permission requests and switches between active and
"normal" commit mode. I'm not sure how hard this would be to
implement.
As long as we don't have the automatic switch, do we have to allow
the user to specify explicitly which mode they want instead of
automatically choosing one?
* The 'backing-file' option (which specifies the new backing file
string for parents after the commit job completes) is currently not
allowed if top is the active layer. If we allow graph changes, this
doesn't seem to make sense to me because even if top doesn't have a
parent node when the job starts, it could have one when it's
completed.
Any opinions on this, especially the active/normal commit thing?
Kevin
next reply other threads:[~2017-09-26 17:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-26 17:59 Kevin Wolf [this message]
2017-09-26 18:29 ` [Qemu-devel] blockdev-commit design Eric Blake
2017-09-26 19:11 ` Kevin Wolf
2017-09-27 16:29 ` Max Reitz
2017-10-02 15:01 ` [Qemu-devel] [Qemu-block] " Kashyap Chamarthy
2017-10-02 15:32 ` Kevin Wolf
2017-10-03 8:00 ` Kashyap Chamarthy
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=20170926175942.GE14717@localhost.localdomain \
--to=kwolf@redhat.com \
--cc=eblake@redhat.com \
--cc=jcody@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).