mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
phyp: Checking for NULL values when building new guest
When creating a new gust, the function phypBuildLpar() was not checking for NULL values src/phyp/phyp_driver.c: check the definition arguments to avoid a segmentation fault in phypBuildLpar()
This commit is contained in:
parent
8bd11f37c4
commit
ee2cb9835f
@ -3701,6 +3701,29 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def)
|
||||
int exit_status = 0;
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
if (!def->memory) {
|
||||
PHYP_ERROR(VIR_ERR_XML_ERROR,"%s",
|
||||
_("Field \"<memory>\" on the domain XML file is missing or has "
|
||||
"invalid value."));
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!def->maxmem) {
|
||||
PHYP_ERROR(VIR_ERR_XML_ERROR,"%s",
|
||||
_("Field \"<currentMemory>\" on the domain XML file is missing or"
|
||||
" has invalid value."));
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (def->ndisks > 0) {
|
||||
if (!def->disks[0]->src) {
|
||||
PHYP_ERROR(VIR_ERR_XML_ERROR,"%s",
|
||||
_("Field \"<src>\" under \"<disk>\" on the domain XML file is "
|
||||
"missing."));
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
virBufferAddLit(&buf, "mksyscfg");
|
||||
if (system_type == HMC)
|
||||
virBufferVSprintf(&buf, " -m %s", managed_system);
|
||||
|
Loading…
x
Reference in New Issue
Block a user