[PATCH 5/6] qemu: Add infrastructure for 'block-export-add' to export NBD

Peter Krempa pkrempa at redhat.com
Mon Oct 19 20:25:42 UTC 2020


On Mon, Oct 19, 2020 at 13:32:32 -0500, Eric Blake wrote:
> On 10/14/20 5:04 AM, Peter Krempa wrote:
> > Add the monitor code, corresponding generator of properties for NBD and
> > tests validating it against the schema.
> > 
> > Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> > ---
> >   src/qemu/qemu_block.c        | 25 +++++++++++++++++++++++++
> >   src/qemu/qemu_block.h        |  7 +++++++
> >   src/qemu/qemu_monitor.c      | 10 ++++++++++
> >   src/qemu/qemu_monitor.h      |  4 ++++
> >   src/qemu/qemu_monitor_json.c | 21 +++++++++++++++++++++
> >   src/qemu/qemu_monitor_json.h |  4 ++++
> >   tests/qemumonitorjsontest.c  | 23 +++++++++++++++++++++++
> >   7 files changed, 94 insertions(+)
> > 
> 
> > 
> > +virJSONValuePtr
> > +qemuBlockExportGetNBDProps(const char *nodename,
> > +                           const char *exportname,
> > +                           bool writable,
> > +                           const char *bitmap)
> > +{
> > +    g_autofree char *exportid = NULL;
> > +    virJSONValuePtr ret = NULL;
> > +
> > +    exportid = g_strdup_printf("libvirt-nbd-%s", nodename);
> > +
> > +    if (virJSONValueObjectCreate(&ret,
> > +                                 "s:type", "nbd",
> > +                                 "s:id", exportid,
> > +                                 "s:node-name", nodename,
> > +                                 "b:writable", writable,
> > +                                 "s:name", exportname,
> > +                                 "S:bitmap", bitmap,
> > +                                 NULL) < 0)
> 
> The plan is to upgrade to '*bitmaps':['str'], and retiring '*bitmap':'str'
> when nbd-server-add goes away:
> https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg02713.html
> 
> so you'll need to tweak this to match.

Uhh, okay, make sure to get that in before the libvirt release so that
we don't have a broken libvirt version. I'll fix libvirt ASAP. 




More information about the libvir-list mailing list