mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
maint: Clean up coding style and fix error message spelling
This patch cleans up coding style breaks some long lines and fixes error message spelling on various places in domain_conf.c and in the qemu driver.
This commit is contained in:
parent
d57e17d583
commit
8e0f7faf56
@ -8609,11 +8609,12 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
|
||||
}
|
||||
|
||||
/* analysis of the disk devices */
|
||||
if ((n = virXPathNodeSet("./devices/disk", ctxt, &nodes)) < 0) {
|
||||
if ((n = virXPathNodeSet("./devices/disk", ctxt, &nodes)) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (n && VIR_ALLOC_N(def->disks, n) < 0)
|
||||
goto no_memory;
|
||||
|
||||
for (i = 0 ; i < n ; i++) {
|
||||
virDomainDiskDefPtr disk = virDomainDiskDefParseXML(caps,
|
||||
nodes[i],
|
||||
@ -8629,11 +8630,12 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
|
||||
VIR_FREE(nodes);
|
||||
|
||||
/* analysis of the controller devices */
|
||||
if ((n = virXPathNodeSet("./devices/controller", ctxt, &nodes)) < 0) {
|
||||
if ((n = virXPathNodeSet("./devices/controller", ctxt, &nodes)) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (n && VIR_ALLOC_N(def->controllers, n) < 0)
|
||||
goto no_memory;
|
||||
|
||||
for (i = 0 ; i < n ; i++) {
|
||||
virDomainControllerDefPtr controller = virDomainControllerDefParseXML(nodes[i],
|
||||
flags);
|
||||
@ -8755,9 +8757,9 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
|
||||
if ((n = virXPathNodeSet("./devices/serial", ctxt, &nodes)) < 0) {
|
||||
if ((n = virXPathNodeSet("./devices/serial", ctxt, &nodes)) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (n && VIR_ALLOC_N(def->serials, n) < 0)
|
||||
goto no_memory;
|
||||
|
||||
@ -9051,8 +9053,8 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
|
||||
goto error;
|
||||
}
|
||||
if (n > 1) {
|
||||
virReportError (VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("only a single watchdog device is supported"));
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("only a single watchdog device is supported"));
|
||||
goto error;
|
||||
}
|
||||
if (n > 0) {
|
||||
@ -9071,8 +9073,8 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
|
||||
goto error;
|
||||
}
|
||||
if (n > 1) {
|
||||
virReportError (VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("only a single memory balloon device is supported"));
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("only a single memory balloon device is supported"));
|
||||
goto error;
|
||||
}
|
||||
if (n > 0) {
|
||||
|
@ -4789,25 +4789,28 @@ qemuBuildCommandLine(virConnectPtr conn,
|
||||
/* Only recent QEMU implements a SATA (AHCI) controller */
|
||||
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) {
|
||||
if (!qemuCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("SATA is not supported with this QEMU binary"));
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("SATA is not supported with this "
|
||||
"QEMU binary"));
|
||||
goto error;
|
||||
} else {
|
||||
char *devstr;
|
||||
|
||||
virCommandAddArg(cmd, "-device");
|
||||
if (!(devstr = qemuBuildControllerDevStr(def, cont, qemuCaps, NULL)))
|
||||
if (!(devstr = qemuBuildControllerDevStr(def, cont,
|
||||
qemuCaps, NULL)))
|
||||
goto error;
|
||||
|
||||
virCommandAddArg(cmd, devstr);
|
||||
VIR_FREE(devstr);
|
||||
}
|
||||
} else if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
|
||||
def->controllers[i]->model == -1 &&
|
||||
!qemuCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) {
|
||||
} else if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
|
||||
cont->model == -1 &&
|
||||
!qemuCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) {
|
||||
if (usblegacy) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Multiple legacy USB controller not supported"));
|
||||
_("Multiple legacy USB controllers are "
|
||||
"not supported"));
|
||||
goto error;
|
||||
}
|
||||
usblegacy = true;
|
||||
@ -4815,7 +4818,7 @@ qemuBuildCommandLine(virConnectPtr conn,
|
||||
virCommandAddArg(cmd, "-device");
|
||||
|
||||
char *devstr;
|
||||
if (!(devstr = qemuBuildControllerDevStr(def, def->controllers[i], qemuCaps,
|
||||
if (!(devstr = qemuBuildControllerDevStr(def, cont, qemuCaps,
|
||||
&usbcontroller)))
|
||||
goto error;
|
||||
|
||||
|
@ -5803,8 +5803,7 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
|
||||
flags |= VIR_DOMAIN_AFFECT_CONFIG;
|
||||
/* check consistency between flags and the vm state */
|
||||
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s",
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("cannot do live update a device on "
|
||||
"inactive domain"));
|
||||
goto endjob;
|
||||
@ -5812,8 +5811,8 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
|
||||
}
|
||||
|
||||
if ((flags & VIR_DOMAIN_AFFECT_CONFIG) && !vm->persistent) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("cannot modify device on transient domain"));
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("cannot modify device on transient domain"));
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user