[libvirt] [PATCH 12/12] Fix off-by-1 in SCSI drive hotplug

Daniel P. Berrange berrange at redhat.com
Wed Jan 20 15:15:09 UTC 2010


The loop looking for the controller associated with a SCI drive had
an off by one, causing it to miss the last controller.

* src/qemu/qemu_driver.c: Fix off-by-1 in searching for SCSI
  drive hotplug
---
 src/qemu/qemu_driver.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index cb6fe86..d546975 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5346,7 +5346,7 @@ static int qemudDomainAttachSCSIDisk(virConnectPtr conn,
         goto error;
     }
 
-    for (i = 0 ; i < disk->info.addr.drive.controller ; i++) {
+    for (i = 0 ; i <= disk->info.addr.drive.controller ; i++) {
         cont = qemuDomainFindOrCreateSCSIDiskController(conn, driver, vm, i);
         if (!cont)
             goto error;
-- 
1.6.5.2




More information about the libvir-list mailing list