[libvirt] [PATCH 03/13] Introduce internal QEMU monitor APIs for drive + device hotadd
Daniel P. Berrange
berrange at redhat.com
Tue Feb 2 16:14:51 UTC 2010
On Tue, Feb 02, 2010 at 10:12:08AM +0100, Matthias Bolte wrote:
> 2010/2/1 Daniel P. Berrange <berrange at redhat.com>:
> > The way QEMU is started has been changed to use '-device' and
> > the new style '-drive' syntax. This needs to be mirrored in
> > the hotplug code, requiring addition of two new APIs.
> >
> > * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Define APIs
> > qemuMonitorAddDevice() and qemuMonitorAddDrive()
> > * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
> > src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
> > Implement the new monitor APIs
> > ---
>
> > diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
> > index 380bcdc..b2a0c53 100644
> > --- a/src/qemu/qemu_monitor_text.c
> > +++ b/src/qemu/qemu_monitor_text.c
> > @@ -2029,3 +2029,80 @@ error:
>
> > +int qemuMonitorTextAddDrive(qemuMonitorPtr mon,
> > + const char *drivestr)
> > +{
> > + char *cmd = NULL;
> > + char *reply = NULL;
> > + int ret = -1;
> > + char *safe_str;
> > +
> > + safe_str = qemuMonitorEscapeArg(drivestr);
> > + if (!safe_str) {
> > + virReportOOMError(NULL);
> > + return -1;
> > + }
> > +
> > + ret = virAsprintf(&cmd, "drive_add dummy %s", safe_str);
>
> dummy looks like a leftover from debugging to me, or does it belong there?
I'm adding a comment about this before committing
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the libvir-list
mailing list