qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Alberto Garcia <berto@igalia.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 3/4] block: add a 'blockdev-snapshot' QMP command
Date: Wed, 7 Oct 2015 09:34:21 +0200	[thread overview]
Message-ID: <20151007073421.GB4337@noname.redhat.com> (raw)
In-Reply-To: <w5137xoj8t4.fsf@maestria.local.igalia.com>

Am 06.10.2015 um 17:49 hat Alberto Garcia geschrieben:
> On Tue 06 Oct 2015 05:30:07 PM CEST, Kevin Wolf wrote:
> >> -    options = qdict_new();
> >> -    if (has_snapshot_node_name) {
> >> -        qdict_put(options, "node-name",
> >> -                  qstring_from_str(snapshot_node_name));
> >> +        if (snapshot_node_name && bdrv_find_node(snapshot_node_name)) {
> >> +            error_setg(errp, "New snapshot node name already exists");
> >> +            return;
> >> +        }
> >
> > Preexisting, but shouldn't we use bdrv_lookup_bs() here (because devices
> > and node names share a namespace)?
> 
> I think you're right, good catch!
> 
> >> +    if (state->new_bs->blk != NULL) {
> >> +        error_setg(errp, "The snapshot is already in use by %s",
> >> +                   blk_name(state->new_bs->blk));
> >> +        return;
> >> +    }
> >
> > Is it even possible yet to create a root BDS without a BB?
> 
> It is possible with Max's series, on which mine depends.
> 
>    http://patchwork.ozlabs.org/patch/519375/

Okay. I missed this dependency, it doesn't seem to be very explicit in
the cover letter.

> >> +    if (bdrv_op_is_blocked(state->new_bs, BLOCK_OP_TYPE_EXTERNAL_SNAPSHOT,
> >> +                           errp)) {
> >> +        return;
> >> +    }
> >> +
> >> +    if (state->new_bs->backing_hd != NULL) {
> >> +        error_setg(errp, "The snapshot already has a backing image");
> >>      }
> >
> > The error cases after bdrv_open() should probably bdrv_unref() the
> > node.
> 
> I don't think it's necessary, external_snapshot_abort() already takes
> care of that.

Sorry for the noise, you're right. I was confused by bdrv_reopen()
transactions working differently: There, abort isn't called for the
queue entry that has failed prepare, but here it is.

Kevin

  reply	other threads:[~2015-10-07  7:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 13:28 [Qemu-devel] [PATCH v6 0/4] Add 'blockdev-snapshot' command Alberto Garcia
2015-09-22 13:28 ` [Qemu-devel] [PATCH v6 1/4] block: rename BlockdevSnapshot to BlockdevSnapshotSync Alberto Garcia
2015-10-06 15:31   ` Kevin Wolf
2015-09-22 13:28 ` [Qemu-devel] [PATCH v6 2/4] block: support passing 'backing': '' to 'blockdev-add' Alberto Garcia
2015-10-06 15:31   ` Kevin Wolf
2015-09-22 13:28 ` [Qemu-devel] [PATCH v6 3/4] block: add a 'blockdev-snapshot' QMP command Alberto Garcia
2015-09-22 16:38   ` Max Reitz
2015-09-23  8:59     ` Alberto Garcia
2015-10-06 15:30   ` Kevin Wolf
2015-10-06 15:49     ` Alberto Garcia
2015-10-07  7:34       ` Kevin Wolf [this message]
2015-09-22 13:28 ` [Qemu-devel] [PATCH v6 4/4] block: add tests for the 'blockdev-snapshot' command Alberto Garcia
2015-09-22 16:54   ` 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=20151007073421.GB4337@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=berto@igalia.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).