Add tests/virscsidata/sg0 and tests/virscsidata/sg8 as the test input for constructing scsi->sg_path. And change the scsi generic number of "1:0:0:0", because it's easy to hide the problem (assuming most machines have a CDROM drive). Signed-off-by: Osier Yang <jyang@xxxxxxxxxx> --- tests/virscsidata/1:0:0:0/block/sdh/dev | 1 + tests/virscsidata/1:0:0:0/block/sr0/dev | 1 - tests/virscsidata/1:0:0:0/scsi_generic/sg1/dev | 1 - tests/virscsidata/1:0:0:0/scsi_generic/sg8/dev | 1 + tests/virscsidata/sg0 | 0 tests/virscsidata/sg8 | 0 tests/virscsitest.c | 4 ++-- 7 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 tests/virscsidata/1:0:0:0/block/sdh/dev delete mode 100644 tests/virscsidata/1:0:0:0/block/sr0/dev delete mode 100644 tests/virscsidata/1:0:0:0/scsi_generic/sg1/dev create mode 100644 tests/virscsidata/1:0:0:0/scsi_generic/sg8/dev create mode 100644 tests/virscsidata/sg0 create mode 100644 tests/virscsidata/sg8 diff --git a/tests/virscsidata/1:0:0:0/block/sdh/dev b/tests/virscsidata/1:0:0:0/block/sdh/dev new file mode 100644 index 0000000..3d33f0f --- /dev/null +++ b/tests/virscsidata/1:0:0:0/block/sdh/dev @@ -0,0 +1 @@ +11:0 diff --git a/tests/virscsidata/1:0:0:0/block/sr0/dev b/tests/virscsidata/1:0:0:0/block/sr0/dev deleted file mode 100644 index 3d33f0f..0000000 --- a/tests/virscsidata/1:0:0:0/block/sr0/dev +++ /dev/null @@ -1 +0,0 @@ -11:0 diff --git a/tests/virscsidata/1:0:0:0/scsi_generic/sg1/dev b/tests/virscsidata/1:0:0:0/scsi_generic/sg1/dev deleted file mode 100644 index bd84814..0000000 --- a/tests/virscsidata/1:0:0:0/scsi_generic/sg1/dev +++ /dev/null @@ -1 +0,0 @@ -21:1 diff --git a/tests/virscsidata/1:0:0:0/scsi_generic/sg8/dev b/tests/virscsidata/1:0:0:0/scsi_generic/sg8/dev new file mode 100644 index 0000000..bd84814 --- /dev/null +++ b/tests/virscsidata/1:0:0:0/scsi_generic/sg8/dev @@ -0,0 +1 @@ +21:1 diff --git a/tests/virscsidata/sg0 b/tests/virscsidata/sg0 new file mode 100644 index 0000000..e69de29 diff --git a/tests/virscsidata/sg8 b/tests/virscsidata/sg8 new file mode 100644 index 0000000..e69de29 diff --git a/tests/virscsitest.c b/tests/virscsitest.c index d256a0e..d4b3e4a 100644 --- a/tests/virscsitest.c +++ b/tests/virscsitest.c @@ -43,7 +43,7 @@ test1(const void *data ATTRIBUTE_UNUSED) "scsi_host1", 0, 0, 0))) return -1; - if (STRNEQ(name, "sr0")) + if (STRNEQ(name, "sdh")) goto cleanup; ret = 0; @@ -72,7 +72,7 @@ test2(const void *data ATTRIBUTE_UNUSED) sgname = virSCSIDeviceGetSgName(virscsi_prefix, "scsi_host1", 0, 0, 0); - if (!sgname || STRNEQ(sgname, "sg1")) + if (!sgname || STRNEQ(sgname, "sg8")) goto cleanup; if (!(dev = virSCSIDeviceNew(virscsi_prefix, "scsi_host1", -- 1.8.1.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list