[libvirt] Is it a problem that "a vm has been shutdown, but its pidfile has not been removed"

Wangyufei (A) james.wangyufei at huawei.com
Thu Aug 22 09:34:55 UTC 2013


Hello,
when do steps as follows:

1.  start a vm

2.  restart libvirtd service

3.  shutdown the vm
I found the pidfile associated with the vm has not been removed.

    Analyzing related piece of code, I found when libvirtd service restarted, the vm's _virDomainObj structure(named dom here) in libvirtd will be re-established according to the vm's state-file or config-file, but its member of privateData.pidfile will not be reassigned value. By the way, qemudriver is used in my libvirt.

So when the vm is shutdown, its pidfile will not be removed, because the member of privateData.pidfile is NULL.

My questions are :

1.  Do you think it is a problem when a vm has been shutdown, but its pidfile has not been removed ?

2.  Do you think it is expected that the member of privateData.pidfile's value missed after libvirtd restart?

    If it's a bug then I'll submit the patch to fix it.

    Also list the related piece of code about removing the vm's pidfile in libvirt for your information:
             if (priv->pidfile &&
                    unlink(priv->pidfile) < 0 &&
                    errno != ENOENT)
                    VIR_WARN("Failed to remove PID file for %s: %s",
                 vm->def->name, virStrerror(errno, ebuf, sizeof(ebuf)));

Best Regards,
-WangYufei

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130822/17479d62/attachment-0001.htm>


More information about the libvir-list mailing list