From: Osier Yang Date: Sat, 4 Dec 2010 15:34:01 +0000 (+0800) Subject: qemu: Only build devstr when needs (attach PCI controller) X-Git-Tag: v0.8.7~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=981f7c8c9b0e70fcc1c0eef56ab5b1dc1b56a3c4;p=thirdparty%2Flibvirt.git qemu: Only build devstr when needs (attach PCI controller) - qemudDomainAttachPciControllerDevice: Don't build "devstr" if "-device" of qemu is not available, as "devstr" will only be used by "qemuMonitorAddDevice", which depends on "-device" argument of qemu is supported. - "qemudDomainSaveImageOpen": Fix indent problem. * src/qemu/qemu_driver.c --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f5164e1327..b640d23312 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6847,10 +6847,10 @@ static int qemudDomainSaveImageClose(int fd, pid_t read_pid, int *status) static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) qemudDomainSaveImageOpen(struct qemud_driver *driver, - const char *path, - virDomainDefPtr *ret_def, - struct qemud_save_header *ret_header, - pid_t *ret_read_pid) + const char *path, + virDomainDefPtr *ret_def, + struct qemud_save_header *ret_header, + pid_t *ret_read_pid) { int fd; pid_t read_pid = -1; @@ -7905,11 +7905,11 @@ static int qemudDomainAttachPciControllerDevice(struct qemud_driver *driver, goto cleanup; if (qemuAssignDeviceControllerAlias(controller) < 0) goto cleanup; - } - if (!(devstr = qemuBuildControllerDevStr(controller))) { - virReportOOMError(); - goto cleanup; + if (!(devstr = qemuBuildControllerDevStr(controller))) { + virReportOOMError(); + goto cleanup; + } } if (VIR_REALLOC_N(vm->def->controllers, vm->def->ncontrollers+1) < 0) {