[libvirt] [Question]Libvirt doesn't care about qemu monitor event if fail to destroy qemu process

Wuzongyong (Euler Dept) cordius.wu at huawei.com
Mon Mar 5 02:20:07 UTC 2018


We unregister qemu monitor after sending QEMU_PROCESS_EVENT_MONITOR_EOF to workerPool:

static void
qemuProcessHandleMonitorEOF(qemuMonitorPtr mon,
                            virDomainObjPtr vm,
                            void *opaque)
    virQEMUDriverPtr driver = opaque;
    qemuDomainObjPrivatePtr priv;
struct qemuProcessEvent *processEvent;
processEvent->eventType = QEMU_PROCESS_EVENT_MONITOR_EOF;
    processEvent->vm = vm;

    if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
        goto cleanup;

    /* We don't want this EOF handler to be called over and over while the
     * thread is waiting for a job.

Then we handle QEMU_PROCESS_EVENT_MONITOR_EOF in processMonitorEOFEvent function:

static void
processMonitorEOFEvent(virQEMUDriverPtr driver,
                       virDomainObjPtr vm)
      if (qemuProcessBeginStopJob(driver, vm, QEMU_JOB_DESTROY, true) < 0)

Here,  libvirt will show that the vm state is running all the time if qemuProcessBeginStopJob return -1
even though qemu may terminate or be killed later.

So, may be we should re-register the monitor when qemuProcessBeginStopJob failed?

Zongyong Wu

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

More information about the libvir-list mailing list