Received: from eggs.gnu.org ([2001:4830:134:3::10]:40122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wubnd-0001ns-Jj for qemu-devel@nongnu.org; Wed, 11 Jun 2014 02:14:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WubnV-0003Ow-DD for qemu-devel@nongnu.org; Wed, 11 Jun 2014 02:14:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WubnV-0003OY-60 for qemu-devel@nongnu.org; Wed, 11 Jun 2014 02:14:09 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5B6E79M019000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 11 Jun 2014 02:14:08 -0400 Date: Wed, 11 Jun 2014 14:14:22 +0800 From: Fam Zheng Message-ID: <20140611061422.GC5448@T430.nay.redhat.com> References: <1402383358-24079-1-git-send-email-famz@redhat.com> <5396BF48.5020109@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5396BF48.5020109@redhat.com> 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: Paolo Bonzini Cc: qemu-devel@nongnu.org, stefanha@redhat.com On Tue, 06/10 10:18, Paolo Bonzini wrote: > 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? OK, will look into it! Thanks, Fam