于 2013/10/1 22:53, Eric Blake 写道:
On 09/25/2013 06:16 PM, Wenchao Xia wrote:
Signed-off-by: Wenchao Xia<xiaw...@linux.vnet.ibm.com>
---
+_export_nbd_snapshot()
+{
+    eval "$QEMU_NBD -v -t -b 127.0.0.1 -p $nbd_snapshot_port $TEST_IMG -l $1&"
Uggh.  Why do you need an eval here?  Especially given that there was
recently a patch to properly quote $TEST_IMG in case the tests are run
inside a directory whose absolute name included a space.  What's wrong
with just directly:

$QEMU_NBD -v -t -b 127.0.0.1 -p $nbd_snapshot_port "$TEST_IMG" -l $1 $

  Just a copy and paste for "eval", will remove it.

+    NBD_SNAPSHOT_PID=$!
+    sleep 1
+}
+
+_export_nbd_snapshot1()
+{
+    eval "$QEMU_NBD -v -t -b 127.0.0.1 -p $nbd_snapshot_port $TEST_IMG -L 
snapshot.name=$1&"
Likewise; and given my complaint on 2-3/7, it would be nicer to support
this with only one option name spelling.

+_cleanup()
+{
+    if [ -n "$NBD_SNAPSHOT_PID" ]; then
+        kill $NBD_SNAPSHOT_PID
+    fi
+       _cleanup_test_img
Kill the TAB, fix the indentation.

  Will fix.

+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.pattern
+
+# Any format supporting intenal snapshots
s/intenal/internal/

 will fix.

+_supported_fmt qcow2
+_supported_proto generic
+_supported_os Linux
Is this test truly Linux-only?
  I think it is generic, will remove it.



Reply via email to