- Acquires the virDomainObj *lock
These functions must not be used by an asynchronous job.
- Note that the virDomainObj is unlocked during the time in
- monitor and it can be changed, e.g. if QEMU dies, qemuProcessStop
- may free the live domain definition and put the persistent
- definition back in vm->def. The callers should check the return
- value of ExitMonitor to see if the domain is still alive.
To acquire the QEMU monitor lock as part of an asynchronous job
/* obj must NOT be locked before calling
*
* Should be paired with an earlier qemuDomainObjEnterMonitor() call
- *
- * Returns -1 if the domain is no longer alive after exiting the monitor.
- * In that case, the caller should be careful when using obj's data,
- * e.g. the live definition in vm->def has been freed by qemuProcessStop
- * and replaced by the persistent definition, so pointers stolen
- * from the live definition could no longer be valid.
*/
-int qemuDomainObjExitMonitor(virQEMUDriver *driver,
- virDomainObj *obj)
+void qemuDomainObjExitMonitor(virQEMUDriver *driver,
+ virDomainObj *obj)
{
qemuDomainObjExitMonitorInternal(driver, obj);
- if (!virDomainObjIsActive(obj)) {
- if (virGetLastErrorCode() == VIR_ERR_OK)
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("domain is no longer running"));
- return -1;
- }
- return 0;
}
/*
void qemuDomainObjEnterMonitor(virQEMUDriver *driver,
virDomainObj *obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-int qemuDomainObjExitMonitor(virQEMUDriver *driver,
- virDomainObj *obj)
+void qemuDomainObjExitMonitor(virQEMUDriver *driver,
+ virDomainObj *obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuDomainObjEnterMonitorAsync(virQEMUDriver *driver,
virDomainObj *obj,