]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix off-by-1 in SCSI drive hotplug
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 20 Jan 2010 14:53:30 +0000 (14:53 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 21 Jan 2010 14:00:17 +0000 (14:00 +0000)
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

index 6ee3aef6f0837b23346c6a5fcc4a525551a4e9db..370b7ff5930ffba049afeb0c8f92018e8eb96e42 100644 (file)
@@ -5345,7 +5345,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;