From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkxEa-0000ed-8V for qemu-devel@nongnu.org; Fri, 07 Jun 2013 10:01:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkxEV-00053d-6k for qemu-devel@nongnu.org; Fri, 07 Jun 2013 10:01:40 -0400 Received: from mail-ob0-x232.google.com ([2607:f8b0:4003:c01::232]:34401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkxEV-00052k-0k for qemu-devel@nongnu.org; Fri, 07 Jun 2013 10:01:35 -0400 Received: by mail-ob0-f178.google.com with SMTP id fb19so6589558obc.37 for ; Fri, 07 Jun 2013 07:01:34 -0700 (PDT) From: Anthony Liguori In-Reply-To: <51B1904E.3090605@suse.de> References: <1370371954-8479-1-git-send-email-pbonzini@redhat.com> <1370371954-8479-2-git-send-email-pbonzini@redhat.com> <51B1904E.3090605@suse.de> Date: Fri, 07 Jun 2013 09:01:32 -0500 Message-ID: <874ndauiir.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 01/39] scsi: keep device alive while it has requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= , Paolo Bonzini Cc: qemu-devel@nongnu.org, mst@redhat.com Andreas F=C3=A4rber writes: > Am 04.06.2013 20:51, schrieb Paolo Bonzini: >> Signed-off-by: Paolo Bonzini >> --- >> hw/scsi/scsi-bus.c | 4 ++++ >> 1 file changed, 4 insertions(+) >>=20 >> diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c >> index 53ea906..e443193 100644 >> --- a/hw/scsi/scsi-bus.c >> +++ b/hw/scsi/scsi-bus.c >> @@ -516,6 +516,8 @@ SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops= , SCSIDevice *d, >> req->status =3D -1; >> req->sense_len =3D 0; >> req->ops =3D reqops; >> + object_ref(OBJECT(d)); >> + object_ref(OBJECT(req->bus->qbus.parent)); > > BusState *bus =3D BUS(req->bus); > ... > object_ref(OBJECT(bus->parent)); > > Same below. If Paolo has to respin, ack. But for both ways: Reviewed-by: Anthony Liguori Regards, Anthony Liguori > > Andreas > >> trace_scsi_req_alloc(req->dev->id, req->lun, req->tag); >> return req; >> } >> @@ -1505,6 +1507,8 @@ void scsi_req_unref(SCSIRequest *req) >> if (req->ops->free_req) { >> req->ops->free_req(req); >> } >> + object_unref(OBJECT(req->dev)); >> + object_unref(OBJECT(bus->qbus.parent)); >> g_free(req); >> } >> } >>=20 > > > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3= =BCrnberg