From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpv9f-0008IX-46 for qemu-devel@nongnu.org; Fri, 30 Sep 2016 06:35:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpv9a-00025h-2P for qemu-devel@nongnu.org; Fri, 30 Sep 2016 06:34:58 -0400 Received: from 10.mo177.mail-out.ovh.net ([46.105.73.133]:49790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpv9Z-00025W-Tc for qemu-devel@nongnu.org; Fri, 30 Sep 2016 06:34:54 -0400 Received: from player779.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo177.mail-out.ovh.net (Postfix) with ESMTP id 0D022FF970F for ; Fri, 30 Sep 2016 12:34:53 +0200 (CEST) Date: Fri, 30 Sep 2016 12:34:46 +0200 From: Greg Kurz Message-ID: <20160930123446.480322e7@bahia> In-Reply-To: <0ee7d079-1a51-841a-bf83-29037628f021@redhat.com> References: <1475169307-1510-1-git-send-email-lvivier@redhat.com> <1475169307-1510-2-git-send-email-lvivier@redhat.com> <20160930103341.3b2bee36@bahia> <0ee7d079-1a51-841a-bf83-29037628f021@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] tests: use qtest_pc_boot()/qtest_pc_shutdown() in virtio tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: qemu-devel@nongnu.org, dgibson@redhat.com, thuth@redhat.com, qemu-ppc@nongnu.org On Fri, 30 Sep 2016 11:56:50 +0200 Laurent Vivier wrote: > On 30/09/2016 10:33, Greg Kurz wrote: > > On Thu, 29 Sep 2016 19:15:05 +0200 > > Laurent Vivier wrote: > ... > >> @@ -230,9 +227,6 @@ static void test_unaligned_write_same(void) > >> 0x41, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x33, 0x00, 0x00 > >> }; > >> > >> - qvirtio_scsi_start("-drive file=blkdebug::null-co://,if=none,id=dr1" > >> - ",format=raw,file.align=4k " > >> - "-device scsi-disk,drive=dr1,lun=0,scsi-id=1"); > >> vs = qvirtio_scsi_pci_init(PCI_SLOT); > >> > >> g_assert_cmphex(0, ==, > >> @@ -242,7 +236,7 @@ static void test_unaligned_write_same(void) > >> virtio_scsi_do_command(vs, write_same_cdb_2, NULL, 0, buf2, 512, NULL)); > >> > >> qvirtio_scsi_pci_free(vs); > >> - qvirtio_scsi_stop(); > >> + qvirtio_scsi_stop(vs->qs); > > > > Is still vs->qs still valid ? Also it looks wrong to call qvirtio_scsi_stop() > > without any prior call to qvirtio_scsi_start()... > > The qvirtio_scsi_start() is called by qvirtio_scsi_pci_init(). > > Laurent I guess qvirtio_scsi_pci_free() should call qvirtio_scsi_stop() as well then. Also, it looks like vs is leaked, but this is already the case with the current code. Maybe worth fixing that first. Cheers. -- Greg