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

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



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 redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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