提交 981f7c8c 编写于 作者: O Osier Yang 提交者: Eric Blake

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
上级 e8785146
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册