Re: [libvirt] [PATCH 03/13] Introduce internal QEMU monitor APIs for drive + device hotadd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 01, 2010 at 06:39:32PM +0000, Daniel P. Berrange wrote:
> 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
> ---
[...]
> +int qemuMonitorJSONAddDrive(qemuMonitorPtr mon,
> +                            const char *drivestr)
> +{
> +    int ret;
> +    virJSONValuePtr cmd;
> +    virJSONValuePtr reply = NULL;
> +
> +    cmd = qemuMonitorJSONMakeCommand("drive_add",
> +                                     "s:pci_addr", "dummy",
> +                                     "s:opts", drivestr,
> +                                     NULL);
[...]
> +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);

  Like Matthias I'm wondering, it seems to be allowed for network and
  drive naming, but still a bit surprizing

ACK,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]