Skip to contentSkip to conversation

scsi: Report error when lun number is in use

PATCH In review Fam Zheng 2 participants 5 messages Jun 10, 2014 – Jul 14, 2014

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 scsi: Report error when lun number is in use

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.

---
 hw/scsi/scsi-bus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/scsi/scsi-bus.c +2 -1
index 06399fa..d219da3 100644
@@ -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;
         }
     }
 
Signature · 1 line
2.0.0
#1 lore raw

Il 10/06/2014 08:55, Fam Zheng ha scritto:

Quoted 14 lines

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.

---
 hw/scsi/scsi-bus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/scsi/scsi-bus.c +0 -0
index 06399fa..d219da3 100644

hw/scsi/scsi-bus.c static int scsi_qdev_init(DeviceState *qdev) · line 184

Quoted 9 lines
hw/scsi/scsi-bus.c +2 -1
@@ -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;
         }
     }
 

Thanks, applying. Would you look into converting the SCSI bus to realize?

Paolo

author
#2 lore raw
Quoted 18 lines · Paolo Bonzini

Il 10/06/2014 08:55, Fam Zheng ha scritto:

Quoted 17 lines

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.

---
hw/scsi/scsi-bus.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
hw/scsi/scsi-bus.c +0 -1
index 06399fa..d219da3 100644
@@ -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));
Quoted 8 lines

hw/scsi/scsi-bus.c static int scsi_qdev_init(DeviceState *qdev) · line 184

Quoted 6 lines
hw/scsi/scsi-bus.c +2 -0
+            error_report("lun already used by '%s'", d->qdev.id);
+            goto err;
        }
    }
 

Thanks, applying. Would you look into converting the SCSI bus to realize?

OK, will look into it!

Thanks,
Fam

author
#3 lore raw
In reply to Fam Zheng
Quoted 4 lines · Fam Zheng

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.

Do we want this in 2.1?

Fam

Quoted 22 lines
---
 hw/scsi/scsi-bus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/scsi/scsi-bus.c +2 -1
index 06399fa..d219da3 100644
@@ -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;
         }
     }
 
Signature · 1 line
2.0.0
#4 lore raw

Il 14/07/2014 04:42, Fam Zheng ha scritto:

Quoted 9 lines · Fam Zheng
Quoted 4 lines
Quoted 4 lines

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.

Do we want this in 2.1?

Fam

Yes, thanks!

Paolo