Re: [PATCH] qemu: Add flag to force a CDROM eject

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

 



On 11/08/2010 11:07 AM, Cole Robinson wrote:
>  static int qemudDomainChangeEjectableMedia(struct qemud_driver *driver,
>                                             virDomainObjPtr vm,
>                                             virDomainDiskDefPtr disk,
> -                                           unsigned long long qemuCmdFlags)
> +                                           unsigned long long qemuCmdFlags,
> +                                           bool force)

Since this is bool...

> @@ -8719,7 +8720,8 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
>          case VIR_DOMAIN_DISK_DEVICE_FLOPPY:
>              ret = qemudDomainChangeEjectableMedia(driver, vm,
>                                                    dev->data.disk,
> -                                                  qemuCmdFlags);
> +                                                  qemuCmdFlags,
> +                                                  0);

...this should be false, not 0...

> @@ -8964,7 +8967,8 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
>          case VIR_DOMAIN_DISK_DEVICE_FLOPPY:
>              ret = qemudDomainChangeEjectableMedia(driver, vm,
>                                                    dev->data.disk,
> -                                                  qemuCmdFlags);
> +                                                  qemuCmdFlags,
> +                                                  flags & VIR_DOMAIN_DEVICE_EJECT_FORCE);

...and, per the limitations of gnulib's <stdbool.h> replacement on C89
compilers, this must be (flags & VIR_DOMAIN_DEVICE_EJECT_FORCE) != 0,
since you can't rely on the compiler auto-converting non-zero to true.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]