Fixed handling of unsupported machine types

This commit is contained in:
Daniel P. Berrange 2007-07-30 18:50:07 +00:00
parent 86d352d4fe
commit f7dd6b4d6f
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Mon Jul 30 14:40:23 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/qemu_conf.c: Validate requested architecture and reject
unsupported ones
Mon Jul 30 12:15:43 CEST 2007 Daniel Veillard <veillard@redhat.com>
* src/xen_internal.c: add report of ACPI/APIC for Xen fully virt,

View File

@ -1102,6 +1102,10 @@ static struct qemud_vm_def *qemudParseXML(virConnectPtr conn,
if ((obj == NULL) || (obj->type != XPATH_STRING) ||
(obj->stringval == NULL) || (obj->stringval[0] == 0)) {
const char *defaultMachine = qemudDefaultMachineForArch(def->os.arch);
if (!defaultMachine) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "unsupported arch %s", def->os.arch);
goto error;
}
if (strlen(defaultMachine) >= (QEMUD_OS_MACHINE_MAX_LEN-1)) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s", "machine type too long");
goto error;