mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
vz: fixes: snapshot: Factor out virDomainMomentDef class
Fix for commit ffc0fbebe
refactoring snapshot code.
Reviewed-by: Cole Robinson <crobinso@redhat.com>
ACKed-by: Maxim Nestratov <mnestratov@virtuozzo.com>
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
This commit is contained in:
parent
17b9149b33
commit
e149443b8b
@ -2619,7 +2619,7 @@ vzDomainSnapshotCreateXML(virDomainPtr domain,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* snaphot name is ignored, it will be set to auto generated by sdk uuid */
|
/* snaphot name is ignored, it will be set to auto generated by sdk uuid */
|
||||||
if (prlsdkCreateSnapshot(dom, def->description) < 0)
|
if (prlsdkCreateSnapshot(dom, def->common.description) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(snapshots = prlsdkLoadSnapshots(dom)))
|
if (!(snapshots = prlsdkLoadSnapshots(dom)))
|
||||||
|
@ -4696,14 +4696,14 @@ prlsdkParseSnapshotTree(const char *treexml)
|
|||||||
|
|
||||||
ctxt->node = nodes[i];
|
ctxt->node = nodes[i];
|
||||||
|
|
||||||
def->name = virXPathString("string(./@guid)", ctxt);
|
def->common.name = virXPathString("string(./@guid)", ctxt);
|
||||||
if (!def->name) {
|
if (!def->common.name) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("missing 'guid' attribute"));
|
_("missing 'guid' attribute"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
def->parent = virXPathString("string(../@guid)", ctxt);
|
def->common.parent = virXPathString("string(../@guid)", ctxt);
|
||||||
|
|
||||||
xmlstr = virXPathString("string(./DateTime)", ctxt);
|
xmlstr = virXPathString("string(./DateTime)", ctxt);
|
||||||
if (!xmlstr) {
|
if (!xmlstr) {
|
||||||
@ -4711,11 +4711,11 @@ prlsdkParseSnapshotTree(const char *treexml)
|
|||||||
_("missing 'DateTime' element"));
|
_("missing 'DateTime' element"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if ((def->creationTime = prlsdkParseDateTime(xmlstr)) < 0)
|
if ((def->common.creationTime = prlsdkParseDateTime(xmlstr)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
VIR_FREE(xmlstr);
|
VIR_FREE(xmlstr);
|
||||||
|
|
||||||
def->description = virXPathString("string(./Description)", ctxt);
|
def->common.description = virXPathString("string(./Description)", ctxt);
|
||||||
|
|
||||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
|
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
|
||||||
xmlstr = virXPathString("string(./@state)", ctxt);
|
xmlstr = virXPathString("string(./@state)", ctxt);
|
||||||
|
Loading…
Reference in New Issue
Block a user