1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

Initialization error of controller in QEmu SCSI hotplug

Bug manifests itself by:

1. # virsh attach-disk --target sdb ...
2. # virsh attach-disk --target sdh ...
   error: Failed to attach disk
   error: operation failed: target scsi:0 already exists

sdh uses scsi:1, rather than scsi:0.

* src/qemu/qemu_hotplug.c: properly set controller idx in
  qemuDomainFindOrCreateSCSIDiskController()
This commit is contained in:
Wen Congyang 2011-01-31 15:55:40 +08:00 committed by Daniel Veillard
parent 53258f3e7f
commit 7ca5765b91

View File

@ -321,7 +321,7 @@ qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver,
return NULL;
}
cont->type = VIR_DOMAIN_CONTROLLER_TYPE_SCSI;
cont->idx = 0;
cont->idx = controller;
cont->model = -1;
VIR_INFO0("No SCSI controller present, hotplugging one");