From: Jim Fehlig Date: Wed, 12 Feb 2014 21:59:13 +0000 (-0700) Subject: libxl: always set vm id to -1 on shutdown X-Git-Tag: v1.2.2-rc1~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=219d34cfe280da7674ab91a8d2be7a1aa67cec37;p=thirdparty%2Flibvirt.git libxl: always set vm id to -1 on shutdown Once a domain has reached the shutdown state, set its ID to -1. Signed-off-by: Jim Fehlig --- diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 8e4242aad4..0cd0ec893e 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -266,15 +266,15 @@ libxlVmCleanup(libxlDriverPrivatePtr driver, char *file; size_t i; + vm->def->id = -1; + if (priv->deathW) { libxl_evdisable_domain_death(priv->ctx, priv->deathW); priv->deathW = NULL; } - if (vm->persistent) { - vm->def->id = -1; + if (vm->persistent) virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, reason); - } if (virAtomicIntDecAndTest(&driver->nactive) && driver->inhibitCallback) driver->inhibitCallback(false, driver->inhibitOpaque);