mirror of https://gitee.com/openkylin/libvirt.git
domain_conf: Add default memballoon in PostParse callbacks
This should be a no-op change for now.
This commit is contained in:
parent
a216e64872
commit
d40cde318a
|
@ -12205,19 +12205,6 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||
|
||||
def->memballoon = memballoon;
|
||||
VIR_FREE(nodes);
|
||||
} else {
|
||||
if (def->virtType == VIR_DOMAIN_VIRT_XEN ||
|
||||
def->virtType == VIR_DOMAIN_VIRT_QEMU ||
|
||||
def->virtType == VIR_DOMAIN_VIRT_KQEMU ||
|
||||
def->virtType == VIR_DOMAIN_VIRT_KVM) {
|
||||
virDomainMemballoonDefPtr memballoon;
|
||||
if (VIR_ALLOC(memballoon) < 0)
|
||||
goto error;
|
||||
memballoon->model = def->virtType == VIR_DOMAIN_VIRT_XEN ?
|
||||
VIR_DOMAIN_MEMBALLOON_MODEL_XEN :
|
||||
VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO;
|
||||
def->memballoon = memballoon;
|
||||
}
|
||||
}
|
||||
|
||||
/* Parse the RNG device */
|
||||
|
|
|
@ -784,6 +784,16 @@ qemuDomainDefPostParse(virDomainDefPtr def,
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!def->memballoon) {
|
||||
virDomainMemballoonDefPtr memballoon;
|
||||
if (VIR_ALLOC(memballoon) < 0)
|
||||
return -1;
|
||||
|
||||
memballoon->model = VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO;
|
||||
def->memballoon = memballoon;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -340,6 +340,15 @@ xenDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
|
|||
STRNEQ(def->os.type, "hvm"))
|
||||
dev->data.chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
|
||||
|
||||
if (!def->memballoon) {
|
||||
virDomainMemballoonDefPtr memballoon;
|
||||
if (VIR_ALLOC(memballoon) < 0)
|
||||
return -1;
|
||||
|
||||
memballoon->model = VIR_DOMAIN_MEMBALLOON_MODEL_XEN;
|
||||
def->memballoon = memballoon;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue