mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 11:52:20 +00:00
Fix missing jump to error cleanup in qemuParseCommandLineDisk
In a number of places in qemuParseCommandLineDisk, an error is reported, but no 'goto error' jump is used. This causes failure to report OOM conditions to the caller. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
fbf82783e8
commit
6bb7f19eb1
@ -10163,6 +10163,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
|
|||||||
if ((def->iomode = virDomainDiskIoTypeFromString(values[i])) < 0) {
|
if ((def->iomode = virDomainDiskIoTypeFromString(values[i])) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse io mode '%s'"), values[i]);
|
_("cannot parse io mode '%s'"), values[i]);
|
||||||
|
goto error;
|
||||||
}
|
}
|
||||||
} else if (STREQ(keywords[i], "cyls")) {
|
} else if (STREQ(keywords[i], "cyls")) {
|
||||||
if (virStrToLong_ui(values[i], NULL, 10,
|
if (virStrToLong_ui(values[i], NULL, 10,
|
||||||
@ -10172,6 +10173,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
|
|||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse cylinders value'%s'"),
|
_("cannot parse cylinders value'%s'"),
|
||||||
values[i]);
|
values[i]);
|
||||||
|
goto error;
|
||||||
}
|
}
|
||||||
} else if (STREQ(keywords[i], "heads")) {
|
} else if (STREQ(keywords[i], "heads")) {
|
||||||
if (virStrToLong_ui(values[i], NULL, 10,
|
if (virStrToLong_ui(values[i], NULL, 10,
|
||||||
@ -10181,6 +10183,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
|
|||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse heads value'%s'"),
|
_("cannot parse heads value'%s'"),
|
||||||
values[i]);
|
values[i]);
|
||||||
|
goto error;
|
||||||
}
|
}
|
||||||
} else if (STREQ(keywords[i], "secs")) {
|
} else if (STREQ(keywords[i], "secs")) {
|
||||||
if (virStrToLong_ui(values[i], NULL, 10,
|
if (virStrToLong_ui(values[i], NULL, 10,
|
||||||
@ -10190,6 +10193,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
|
|||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse sectors value'%s'"),
|
_("cannot parse sectors value'%s'"),
|
||||||
values[i]);
|
values[i]);
|
||||||
|
goto error;
|
||||||
}
|
}
|
||||||
} else if (STREQ(keywords[i], "trans")) {
|
} else if (STREQ(keywords[i], "trans")) {
|
||||||
def->geometry.trans =
|
def->geometry.trans =
|
||||||
@ -10201,6 +10205,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
|
|||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse translation value'%s'"),
|
_("cannot parse translation value'%s'"),
|
||||||
values[i]);
|
values[i]);
|
||||||
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user