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.