]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
scsi: Report error when lun number is in use
authorFam Zheng <famz@redhat.com>
Tue, 10 Jun 2014 06:55:58 +0000 (14:55 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 14 Jul 2014 09:54:57 +0000 (11:54 +0200)
In the case that the lun number is taken by another scsi device, don't
release the existing device siliently, but report an error to user.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/scsi-bus.c

index ea1ac09c8aaccb9da097282e682e93d07d40c49e..43417542536d75b1a75112fcc2871b2ef1d294bc 100644 (file)
@@ -177,7 +177,8 @@ static int scsi_qdev_init(DeviceState *qdev)
         d = scsi_device_find(bus, dev->channel, dev->id, dev->lun);
         assert(d);
         if (d->lun == dev->lun && dev != d) {
-            object_unparent(OBJECT(d));
+            error_report("lun already used by '%s'", d->qdev.id);
+            goto err;
         }
     }