tests: Use null-co:// instead of /dev/null as the dummy image

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Fam Zheng 2017-05-03 00:35:49 +08:00 committed by Kevin Wolf
parent 7ceb4fc114
commit 2420d369a2
6 changed files with 8 additions and 7 deletions

View File

@ -92,7 +92,7 @@ static void test_after_failed_device_add(void)
static void test_drive_del_device_del(void) static void test_drive_del_device_del(void)
{ {
/* Start with a drive used by a device that unplugs instantaneously */ /* 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 virtio-scsi-pci"
" -device scsi-hd,drive=drive0,id=dev0"); " -device scsi-hd,drive=drive0,id=dev0");

View File

@ -22,7 +22,7 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL); g_test_init(&argc, &argv, NULL);
qtest_add_func("/nvme/nop", nop); 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"); "-device nvme,drive=drv0,serial=foo");
ret = g_test_run(); ret = g_test_run();

View File

@ -79,7 +79,7 @@ int main(int argc, char **argv)
{ {
const char *arch = qtest_get_arch(); const char *arch = qtest_get_arch();
const char *cmd = "-device piix3-usb-uhci,id=uhci,addr=1d.0" const char *cmd = "-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"; " -device usb-tablet,bus=uhci.0,port=1";
int ret; int ret;

View File

@ -89,7 +89,7 @@ int main(int argc, char **argv)
qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug); qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug);
qtest_start("-device nec-usb-xhci,id=xhci" 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(); ret = g_test_run();
qtest_end(); qtest_end();

View File

@ -63,7 +63,7 @@ static QOSState *pci_test_start(void)
const char *arch = qtest_get_arch(); const char *arch = qtest_get_arch();
char *tmp_path; char *tmp_path;
const char *cmd = "-drive if=none,id=drive0,file=%s,format=raw " const char *cmd = "-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," "-device virtio-blk-pci,id=drv0,drive=drive0,"
"addr=%x.%x"; "addr=%x.%x";

View File

@ -35,7 +35,7 @@ typedef struct {
static QOSState *qvirtio_scsi_start(const char *extra_opts) static QOSState *qvirtio_scsi_start(const char *extra_opts)
{ {
const char *arch = qtest_get_arch(); const char *arch = qtest_get_arch();
const char *cmd = "-drive id=drv0,if=none,file=/dev/null,format=raw " const char *cmd = "-drive id=drv0,if=none,file=null-co://,format=raw "
"-device virtio-scsi-pci,id=vs0 " "-device virtio-scsi-pci,id=vs0 "
"-device scsi-hd,bus=vs0.0,drive=drv0 %s"; "-device scsi-hd,bus=vs0.0,drive=drv0 %s";
@ -195,7 +195,8 @@ static void hotplug(void)
QDict *response; QDict *response;
QOSState *qs; QOSState *qs;
qs = qvirtio_scsi_start("-drive id=drv1,if=none,file=/dev/null,format=raw"); qs = qvirtio_scsi_start(
"-drive id=drv1,if=none,file=null-co://,format=raw");
response = qmp("{\"execute\": \"device_add\"," response = qmp("{\"execute\": \"device_add\","
" \"arguments\": {" " \"arguments\": {"
" \"driver\": \"scsi-hd\"," " \"driver\": \"scsi-hd\","