[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v3 25/27] tests: Use null-co:// instead of /dev/null
From: |
Fam Zheng |
Subject: |
[Qemu-block] [PATCH v3 25/27] tests: Use null-co:// instead of /dev/null |
Date: |
Thu, 28 Apr 2016 20:57:44 +0800 |
With image locking, opening /dev/null can fail when multiple tests run
in parallel (make -j2, for example). Use null-co:// as the null protocol
doesn't do image locking.
While it's arguable we could special-case /dev/null, /dev/zero,
/dev/urandom etc in raw-posix driver, it is not really necessary because
user can always specify lock-image=off when it is appropriate. So let's
write sensible testing code too.
Signed-off-by: Fam Zheng <address@hidden>
---
tests/drive_del-test.c | 2 +-
tests/nvme-test.c | 2 +-
tests/usb-hcd-uhci-test.c | 2 +-
tests/usb-hcd-xhci-test.c | 2 +-
tests/virtio-blk-test.c | 2 +-
tests/virtio-scsi-test.c | 4 ++--
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/drive_del-test.c b/tests/drive_del-test.c
index fe03236..b9a6036 100644
--- a/tests/drive_del-test.c
+++ b/tests/drive_del-test.c
@@ -93,7 +93,7 @@ static void test_after_failed_device_add(void)
static void test_drive_del_device_del(void)
{
/* Start with a drive used by a device that unplugs instantaneously */
- qtest_start("-drive if=none,id=drive0,file=/dev/null,format=raw"
+ qtest_start("-drive if=none,id=drive0,file=null-co://,format=raw"
" -device virtio-scsi-pci"
" -device scsi-hd,drive=drive0,id=dev0");
diff --git a/tests/nvme-test.c b/tests/nvme-test.c
index ec06893..60734e8 100644
--- a/tests/nvme-test.c
+++ b/tests/nvme-test.c
@@ -23,7 +23,7 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
qtest_add_func("/nvme/nop", nop);
- qtest_start("-drive id=drv0,if=none,file=/dev/null,format=raw "
+ qtest_start("-drive id=drv0,if=none,file=null-co://,format=raw "
"-device nvme,drive=drv0,serial=foo");
ret = g_test_run();
diff --git a/tests/usb-hcd-uhci-test.c b/tests/usb-hcd-uhci-test.c
index 71ff2ea..4a2f3ad 100644
--- a/tests/usb-hcd-uhci-test.c
+++ b/tests/usb-hcd-uhci-test.c
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
qtest_add_func("/uhci/pci/hotplug/usb-storage", test_usb_storage_hotplug);
qtest_start("-device piix3-usb-uhci,id=uhci,addr=1d.0"
- " -drive id=drive0,if=none,file=/dev/null,format=raw"
+ " -drive id=drive0,if=none,file=null-co://,format=raw"
" -device usb-tablet,bus=uhci.0,port=1");
ret = g_test_run();
qtest_end();
diff --git a/tests/usb-hcd-xhci-test.c b/tests/usb-hcd-xhci-test.c
index 7e2e212..5e96bec 100644
--- a/tests/usb-hcd-xhci-test.c
+++ b/tests/usb-hcd-xhci-test.c
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug);
qtest_start("-device nec-usb-xhci,id=xhci"
- " -drive id=drive0,if=none,file=/dev/null,format=raw");
+ " -drive id=drive0,if=none,file=null-co://,format=raw");
ret = g_test_run();
qtest_end();
diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index 3a66630..7c21938 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -81,7 +81,7 @@ static QPCIBus *pci_test_start(void)
tmp_path = drive_create();
cmdline = g_strdup_printf("-drive if=none,id=drive0,file=%s,format=raw "
- "-drive if=none,id=drive1,file=/dev/null,format=raw "
+ "-drive if=none,id=drive1,file=null-co://,format=raw "
"-device virtio-blk-pci,id=drv0,drive=drive0,"
"addr=%x.%x",
tmp_path, PCI_SLOT, PCI_FN);
diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c
index d78747a..74f85a8 100644
--- a/tests/virtio-scsi-test.c
+++ b/tests/virtio-scsi-test.c
@@ -57,7 +57,7 @@ static void qvirtio_scsi_start(const char *extra_opts)
char *cmdline;
cmdline = g_strdup_printf(
- "-drive id=drv0,if=none,file=/dev/null,format=raw "
+ "-drive id=drv0,if=none,file=null-co://,format=raw "
"-device virtio-scsi-pci,id=vs0 "
"-device scsi-hd,bus=vs0.0,drive=drv0 %s",
extra_opts ? : "");
@@ -208,7 +208,7 @@ static void hotplug(void)
{
QDict *response;
- qvirtio_scsi_start("-drive id=drv1,if=none,file=/dev/null,format=raw");
+ qvirtio_scsi_start("-drive id=drv1,if=none,file=null-co://,format=raw");
response = qmp("{\"execute\": \"device_add\","
" \"arguments\": {"
" \"driver\": \"scsi-hd\","
--
2.8.0
- [Qemu-block] [PATCH v3 15/27] qemu-img: Update documentation of "-L" option, (continued)
- [Qemu-block] [PATCH v3 15/27] qemu-img: Update documentation of "-L" option, Fam Zheng, 2016/04/28
- [Qemu-block] [PATCH v3 16/27] qemu-nbd: Add "--no-lock/-L" option, Fam Zheng, 2016/04/28
- [Qemu-block] [PATCH v3 17/27] block: Don't lock drive-backup target image in none mode, Fam Zheng, 2016/04/28
- [Qemu-block] [PATCH v3 19/27] qemu-iotests: 140: Disable image lock for qemu-io access, Fam Zheng, 2016/04/28
- [Qemu-block] [PATCH v3 18/27] mirror: Disable image locking on target backing chain, Fam Zheng, 2016/04/28
- [Qemu-block] [PATCH v3 20/27] qemu-iotests: 046: Move version detection out from verify_io, Fam Zheng, 2016/04/28
- [Qemu-block] [PATCH v3 21/27] qemu-iotests: Wait for QEMU processes before checking image in 091, Fam Zheng, 2016/04/28
- [Qemu-block] [PATCH v3 22/27] qemu-iotests: 030: Disable image lock when checking test image, Fam Zheng, 2016/04/28
- [Qemu-block] [PATCH v3 23/27] iotests: 087: Disable image lock in cases where file is shared, Fam Zheng, 2016/04/28
- [Qemu-block] [PATCH v3 24/27] iotests: Disable image locking in 085, Fam Zheng, 2016/04/28
- [Qemu-block] [PATCH v3 25/27] tests: Use null-co:// instead of /dev/null,
Fam Zheng <=
- [Qemu-block] [PATCH v3 26/27] block: Turn on image locking by default, Fam Zheng, 2016/04/28
- [Qemu-block] [PATCH v3 27/27] qemu-iotests: Add test case 153 for image locking, Fam Zheng, 2016/04/28