Re: [PATCH 12/12] qemu: implement input device hotunplug

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

 




On 10/17/2017 11:04 AM, Ján Tomko wrote:
> Allow unplugging USB and virtio USB devices.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1379603
> ---
>  src/qemu/qemu_driver.c  |  4 ++-
>  src/qemu/qemu_hotplug.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++
>  src/qemu/qemu_hotplug.h |  3 ++
>  3 files changed, 82 insertions(+), 1 deletion(-)
> 

Another aha moment ;-)... No issue here...

> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 75a0e42aa..a9d3ba778 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -7764,9 +7764,11 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
>      case VIR_DOMAIN_DEVICE_WATCHDOG:
>          ret = qemuDomainDetachWatchdog(driver, vm, dev->data.watchdog);
>          break;
> +    case VIR_DOMAIN_DEVICE_INPUT:
> +        ret = qemuDomainDetachInputDevice(vm, dev->data.input);
> +        break;
>  
>      case VIR_DOMAIN_DEVICE_FS:
> -    case VIR_DOMAIN_DEVICE_INPUT:
>      case VIR_DOMAIN_DEVICE_SOUND:
>      case VIR_DOMAIN_DEVICE_VIDEO:
>      case VIR_DOMAIN_DEVICE_GRAPHICS:
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index b32acb71e..85faa2a46 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -4430,6 +4430,31 @@ qemuDomainRemoveWatchdog(virQEMUDriverPtr driver,
>  }
>  
>  
> +static int
> +qemuDomainRemoveInputDevice(virDomainObjPtr vm,
> +                            virDomainInputDefPtr dev)
> +{
> +    qemuDomainObjPrivatePtr priv = vm->privateData;
> +    virQEMUDriverPtr driver = priv->driver;

So none of the Remove* API's need to pass @driver... doh! Never even
considered that - the first non-lemming ;-)!

John

[...]

--
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]
  Powered by Linux