yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-scsi-Report-error-when-lun-number-is-in-use.patch

9ae3a8
From dcbbbce1a1315b8baf85e10f43ee8355b34314cf Mon Sep 17 00:00:00 2001
9ae3a8
From: Fam Zheng <famz@redhat.com>
9ae3a8
Date: Tue, 15 Jul 2014 15:54:03 -0500
9ae3a8
Subject: [CHANGE 24/29] scsi: Report error when lun number is in use
9ae3a8
To: rhvirt-patches@redhat.com,
9ae3a8
    jen@redhat.com
9ae3a8
9ae3a8
RH-Author: Fam Zheng <famz@redhat.com>
9ae3a8
Message-id: <1405439643-14545-1-git-send-email-famz@redhat.com>
9ae3a8
Patchwork-id: 59914
9ae3a8
O-Subject: [RHEL-7 qemu-kvm PATCH] scsi: Report error when lun number is in use
9ae3a8
Bugzilla: 1096576
9ae3a8
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Amos Kong <akong@redhat.com>
9ae3a8
9ae3a8
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1096576
9ae3a8
Brew:     http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7702061
9ae3a8
9ae3a8
In the case that the lun number is taken by another scsi device, don't
9ae3a8
release the existing device siliently, but report an error to user.
9ae3a8
9ae3a8
Signed-off-by: Fam Zheng <famz@redhat.com>
9ae3a8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
(cherry picked from commit 2039511b8f573165420c86380762ae829dc398d9)
9ae3a8
Signed-off-by: Fam Zheng <famz@redhat.com>
9ae3a8
---
9ae3a8
 hw/scsi/scsi-bus.c | 3 ++-
9ae3a8
 1 file changed, 2 insertions(+), 1 deletion(-)
9ae3a8
9ae3a8
Signed-off-by: jen <jen@redhat.com>
9ae3a8
---
9ae3a8
 hw/scsi/scsi-bus.c | 3 ++-
9ae3a8
 1 file changed, 2 insertions(+), 1 deletion(-)
9ae3a8
9ae3a8
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
9ae3a8
index 77e0c10..7e25c62 100644
9ae3a8
--- a/hw/scsi/scsi-bus.c
9ae3a8
+++ b/hw/scsi/scsi-bus.c
9ae3a8
@@ -178,7 +178,8 @@ static int scsi_qdev_init(DeviceState *qdev)
9ae3a8
         d = scsi_device_find(bus, dev->channel, dev->id, dev->lun);
9ae3a8
         assert(d);
9ae3a8
         if (d->lun == dev->lun && dev != d) {
9ae3a8
-            object_unparent(OBJECT(d));
9ae3a8
+            error_report("lun already used by '%s'", d->qdev.id);
9ae3a8
+            goto err;
9ae3a8
         }
9ae3a8
     }
9ae3a8
 
9ae3a8
-- 
9ae3a8
1.9.3
9ae3a8