mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
Fix ID field in virDomainPtr after starting Xen VM
* src/xend_internal.c: Lookup guest after starting persistent config in order to refresh the domain ID field
This commit is contained in:
parent
91c7bf659b
commit
96f0ee85d2
@ -4535,6 +4535,8 @@ virDomainPtr xenDaemonDomainDefineXML(virConnectPtr conn, const char *xmlDesc) {
|
||||
int xenDaemonDomainCreate(virDomainPtr domain)
|
||||
{
|
||||
xenUnifiedPrivatePtr priv;
|
||||
int ret;
|
||||
virDomainPtr tmp;
|
||||
|
||||
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
|
||||
virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
|
||||
@ -4547,7 +4549,17 @@ int xenDaemonDomainCreate(virDomainPtr domain)
|
||||
if (priv->xendConfigVersion < 3)
|
||||
return(-1);
|
||||
|
||||
return xend_op(domain->conn, domain->name, "op", "start", NULL);
|
||||
ret = xend_op(domain->conn, domain->name, "op", "start", NULL);
|
||||
|
||||
if (ret != -1) {
|
||||
/* Need to force a refresh of this object's ID */
|
||||
tmp = virDomainLookupByName(domain->conn, domain->name);
|
||||
if (tmp) {
|
||||
domain->id = tmp->id;
|
||||
virDomainFree(tmp);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int xenDaemonDomainUndefine(virDomainPtr domain)
|
||||
|
Loading…
x
Reference in New Issue
Block a user