diff options
author | Fam Zheng <famz@redhat.com> | 2014-06-10 14:55:58 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-07-14 11:54:57 +0200 |
commit | 2039511b8f573165420c86380762ae829dc398d9 (patch) | |
tree | 7612c5fdb304b8baf20ea1ce583dd32837a818d0 /hw | |
parent | ab6d3749c4915cd5692633e321f7745dce06fe77 (diff) |
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.
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/scsi/scsi-bus.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index ea1ac09c8a..4341754253 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -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; } } |