Re: [libvirt] [PATCH 4/4] Fix CDROM media change for QEMU when using -device syntax

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

 



On Thu, Apr 15, 2010 at 11:43:11AM +0100, Daniel P. Berrange wrote:
> Disk devices in QEMU have two parts, the guest device and the host
> backend driver. Historically these two parts have had the same
> "unique" name. With the switch to using -device though, they now
> have separate names. Thus when changing CDROM media, for guests
> using -device syntax, we need to prepend the QEMU_DRIVE_HOST_PREFIX
> constant
> 
> * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add helper function
>   qemuDeviceDriveHostAlias() for building a host backend alias
> * src/qemu/qemu_driver.c: Use qemuDeviceDriveHostAlias() to determine
>   the host backend alias for performing eject/change commands in the
>   monitor
> ---
>  src/qemu/qemu_conf.c   |   20 ++++++++++++++++++++
>  src/qemu/qemu_conf.h   |    3 +++
>  src/qemu/qemu_driver.c |   18 +++++++++++++-----
>  3 files changed, 36 insertions(+), 5 deletions(-)
[...]
> @@ -7443,7 +7451,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
>          switch (dev->data.disk->device) {
>          case VIR_DOMAIN_DISK_DEVICE_CDROM:
>          case VIR_DOMAIN_DISK_DEVICE_FLOPPY:
> -            ret = qemudDomainChangeEjectableMedia(driver, vm, dev->data.disk);
> +            ret = qemudDomainChangeEjectableMedia(driver, vm, dev->data.disk, qemuCmdFlags);
>              if (ret == 0)
>                  dev->data.disk = NULL;
>              break;
> @@ -7688,7 +7696,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
>          switch (dev->data.disk->device) {
>          case VIR_DOMAIN_DISK_DEVICE_CDROM:
>          case VIR_DOMAIN_DISK_DEVICE_FLOPPY:
> -            ret = qemudDomainChangeEjectableMedia(driver, vm, dev->data.disk);
> +            ret = qemudDomainChangeEjectableMedia(driver, vm, dev->data.disk, qemuCmdFlags);
>              if (ret == 0)
>                  dev->data.disk = NULL;
>              break;

  small nit, can we keep those two lines on 80 chars ?

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]