From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuHGI-0002Rg-K5 for qemu-devel@nongnu.org; Tue, 10 Jun 2014 04:18:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuHG9-0003a1-TE for qemu-devel@nongnu.org; Tue, 10 Jun 2014 04:18:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuHG9-0003Zg-JB for qemu-devel@nongnu.org; Tue, 10 Jun 2014 04:18:21 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5A8ILsQ018404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 10 Jun 2014 04:18:21 -0400 Message-ID: <5396BF48.5020109@redhat.com> Date: Tue, 10 Jun 2014 10:18:16 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1402383358-24079-1-git-send-email-famz@redhat.com> In-Reply-To: <1402383358-24079-1-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] scsi: Report error when lun number is in use List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: stefanha@redhat.com Il 10/06/2014 08:55, Fam Zheng ha scritto: > 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 > --- > hw/scsi/scsi-bus.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c > index 06399fa..d219da3 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; > } > } > > Thanks, applying. Would you look into converting the SCSI bus to realize? Paolo