[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] HMP: Add equivalent to x-block
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] HMP: Add equivalent to x-blockdev-change |
Date: |
Mon, 18 Jan 2016 13:11:38 +0000 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
* Markus Armbruster (address@hidden) wrote:
> "Dr. David Alan Gilbert (git)" <address@hidden> writes:
>
> > From: "Dr. David Alan Gilbert" <address@hidden>
> >
> > 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 / address@hidden / Manchester, UK