From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnqIE-0007x4-Dj for qemu-devel@nongnu.org; Tue, 03 Dec 2013 08:45:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnqI4-0003I9-KT for qemu-devel@nongnu.org; Tue, 03 Dec 2013 08:45:38 -0500 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:60970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnqI4-0003HR-Du for qemu-devel@nongnu.org; Tue, 03 Dec 2013 08:45:28 -0500 Received: by mail-wi0-f171.google.com with SMTP id ca18so6542146wib.4 for ; Tue, 03 Dec 2013 05:45:27 -0800 (PST) Date: Tue, 3 Dec 2013 14:45:23 +0100 From: Stefan Hajnoczi Message-ID: <20131203134523.GC24604@stefanha-thinkpad.muc.redhat.com> References: <1385094432-1655-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1385094432-1655-4-git-send-email-xiawenc@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385094432-1655-4-git-send-email-xiawenc@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH V6 3/6] qemu-iotests: add 058 internal snapshot export with qemu-nbd case List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, pbonzini@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Fri, Nov 22, 2013 at 12:27:09PM +0800, Wenchao Xia wrote: > +nbd_snapshot_port=10850 > +nbd_snapshot_img="nbd:127.0.0.1:$nbd_snapshot_port" > + > +_export_nbd_snapshot() > +{ > + $QEMU_NBD -v -t -b 127.0.0.1 -p $nbd_snapshot_port "$TEST_IMG" -l $1 & Please use a UNIX domain socket so that multiple qemu-iotests instances can run on the same host in parallel. The socket should be in the scratch directory just like the temporary image files. > + NBD_SNAPSHOT_PID=$! > + sleep 1 qemu-nbd might not start within 1 second on a heavily loaded host. To make this test case reliable please use a loop (e.g. wait for UNIX domain socket to appear for up to 30 seconds). If you feel qemu-nbd doesn't offer a good interface for reliable startup, feel free to extend it. Test cases must be reliable and ideally shouldn't waste time sleeping.