提交 e64a08fb 编写于 作者: D Daniel P. Berrangé

lxc, libxl: save domain status after reconnect

The various steps involved in reconnecting to a domain may cause updates
to the virDomainObj struct that need to be reflected in the saved status
file.
Reviewed-by: NLaine Stump <laine@laine.org>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 729a06c4
...@@ -454,6 +454,9 @@ libxlReconnectDomain(virDomainObjPtr vm, ...@@ -454,6 +454,9 @@ libxlReconnectDomain(virDomainObjPtr vm,
libxlReconnectNotifyNets(vm->def); libxlReconnectNotifyNets(vm->def);
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
VIR_WARN("Cannot update XML for running Xen guest %s", vm->def->name);
/* now that we know it's reconnected call the hook if present */ /* now that we know it's reconnected call the hook if present */
if (virHookPresent(VIR_HOOK_DRIVER_LIBXL) && if (virHookPresent(VIR_HOOK_DRIVER_LIBXL) &&
STRNEQ("Domain-0", vm->def->name)) { STRNEQ("Domain-0", vm->def->name)) {
......
...@@ -1680,6 +1680,7 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm, ...@@ -1680,6 +1680,7 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm,
{ {
virLXCDriverPtr driver = opaque; virLXCDriverPtr driver = opaque;
virLXCDomainObjPrivatePtr priv; virLXCDomainObjPrivatePtr priv;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
int ret = -1; int ret = -1;
virObjectLock(vm); virObjectLock(vm);
...@@ -1722,6 +1723,9 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm, ...@@ -1722,6 +1723,9 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm,
virLXCProcessReconnectNotifyNets(vm->def); virLXCProcessReconnectNotifyNets(vm->def);
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
VIR_WARN("Cannot update XML for running LXC guest %s", vm->def->name);
/* now that we know it's reconnected call the hook if present */ /* now that we know it's reconnected call the hook if present */
if (virHookPresent(VIR_HOOK_DRIVER_LXC)) { if (virHookPresent(VIR_HOOK_DRIVER_LXC)) {
char *xml = virDomainDefFormat(vm->def, driver->caps, 0); char *xml = virDomainDefFormat(vm->def, driver->caps, 0);
...@@ -1742,6 +1746,7 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm, ...@@ -1742,6 +1746,7 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm,
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(cfg);
virObjectUnlock(vm); virObjectUnlock(vm);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册