Re: [PATCH v2 9/9] qemu: Update domain state when reconnecting monitor

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

 



On 05/10/2011 07:39 AM, Jiri Denemark wrote:
> A qemu domain can get paused when libvirtd is stopped (e.g., because of
> I/O error) so we should check its current state when reconnecting to it.
> ---
> Notes:
>     Version 2:
>     - new patch

Good catch.  I see danpb reviewed the rest of the series, but missed
this one.

> +++ b/src/qemu/qemu_process.c
> @@ -1881,6 +1881,37 @@ qemuProcessFiltersInstantiate(virConnectPtr conn,
>      return err;
>  }
>  
> +static int
> +qemuProcessUpdateState(struct qemud_driver *driver, virDomainObjPtr vm)
> +{
> +    qemuDomainObjPrivatePtr priv = vm->privateData;
> +    virDomainState state;
> +    bool running;
> +    int ret;
> +
> +    qemuDomainObjEnterMonitorWithDriver(driver, vm);
> +    ret = qemuMonitorGetStatus(priv->mon, &running);
> +    qemuDomainObjExitMonitorWithDriver(driver, vm);
> +
> +    if (ret < 0 || !virDomainObjIsActive(vm))
> +        return -1;

I half debated about whether virDomainObjIsActive returning fals can
still successfully result in a state update; but I convinced myself that
this is tied to a qemu process, and if the process goes away, then
elsewhere in the code correctly changes the state, and that this only
needs to probe the monitor for a live qemu process.

ACK.

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