From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-block@nongnu.org, zhang.zhanghailiang@huawei.com,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/1] HMP: Add equivalent to x-blockdev-change
Date: Mon, 18 Jan 2016 13:11:38 +0000 [thread overview]
Message-ID: <20160118131138.GB2399@work-vm> (raw)
In-Reply-To: <87egdfnik0.fsf@blackfin.pond.sub.org>
* Markus Armbruster (armbru@redhat.com) wrote:
> "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> writes:
>
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> > x-blockdev-change has no HMP equivalent, so add x_block_change.
>
> Uh, I can find neither QMP command x-blockdev-change nor
> qmp_x_blockdev_change() in master.
It's not in master yet; it's in Wen Congyang's 'child add/delete support'
series; which I've got running with COLO.
Dave
>
> > Example useages are:
> > x_block_change foo -a bah
> > to add the node bah to the parent foo
> >
> > x_block_change foo -d bah
> > to delete the node bah from the parent foo
> [...]
> > diff --git a/hmp.c b/hmp.c
> > index dc6dc30..631dacb 100644
> > --- a/hmp.c
> > +++ b/hmp.c
> > @@ -1042,6 +1042,26 @@ void hmp_balloon(Monitor *mon, const QDict *qdict)
> > }
> > }
> >
> > +void hmp_block_change(Monitor *mon, const QDict *qdict)
> > +{
> > + const char *parent = qdict_get_str(qdict, "parent");
> > + const char *child = qdict_get_str(qdict, "child");
> > + bool add = qdict_get_try_bool(qdict, "add", false);
> > + bool del = qdict_get_try_bool(qdict, "del", false);
> > + Error *err = NULL;
> > +
> > + if (add == del) {
> > + error_setg(&err, "One of -a or -d must be set");
> > + hmp_handle_error(mon, &err);
> > + return;
> > + }
> > +
> > + qmp_x_blockdev_change(parent,
> > + del, child,
> > + add, child, &err);
> > + hmp_handle_error(mon, &err);
> > +}
> > +
> > void hmp_block_resize(Monitor *mon, const QDict *qdict)
> > {
> > const char *device = qdict_get_str(qdict, "device");
> [...]
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
prev parent reply other threads:[~2016-01-18 13:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 10:47 [Qemu-devel] [PATCH 1/1] HMP: Add equivalent to x-blockdev-change Dr. David Alan Gilbert (git)
2015-12-17 16:43 ` Eric Blake
2015-12-17 16:48 ` Dr. David Alan Gilbert
2016-01-18 13:06 ` Markus Armbruster
2016-01-18 13:11 ` Dr. David Alan Gilbert [this message]
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=20160118131138.GB2399@work-vm \
--to=dgilbert@redhat.com \
--cc=armbru@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=zhang.zhanghailiang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.