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

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

 



Hi,

 

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;

 

    virObjectRef(vm);

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

        ignore_value(virObjectUnref(vm));

        VIR_FREE(processEvent);

        goto cleanup;

    }

 

    /* We don't want this EOF handler to be called over and over while the

     * thread is waiting for a job.

     */

qemuMonitorUnregister(mon);

...

}

 

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)

        return;

      ...

}

 

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?

 

 

Thanks,

Zongyong Wu

 

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