Skip to content
Snippets Groups Projects
Commit 2039511b authored by Fam Zheng's avatar Fam Zheng Committed by Paolo Bonzini
Browse files

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: default avatarFam Zheng <famz@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent ab6d3749
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment