From 4b527c1acfa79b21242d339b33d23f0cff1f772f Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 23 Mar 2016 09:57:06 +0100 Subject: [PATCH] qemuxml2argv: Mock virSCSIDeviceGetSgName When constructing SCSI hostdev command line for qemu, the /sys/bus/scsi/devices/... dir is scanned. Unfortunately, even in the tests. This is needed to determine the name of SCSI device to passthrough to qemu, because in the domain XML we were given its address instead. Anyway, we should not be touching live system data in our test suite as it produced unpredictable results. The test is regressing from 1e9a083742efe on. Signed-off-by: Michal Privoznik --- tests/qemuxml2argvmock.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c index 8426108b29..b7dfebba29 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -26,6 +26,7 @@ #include "virutil.h" #include "virstring.h" #include "virtpm.h" +#include "virscsi.h" #include #include @@ -84,3 +85,16 @@ virMemoryMaxValue(bool capped ATTRIBUTE_UNUSED) { return LLONG_MAX; } + +char * +virSCSIDeviceGetSgName(const char *sysfs_prefix ATTRIBUTE_UNUSED, + const char *adapter ATTRIBUTE_UNUSED, + unsigned int bus ATTRIBUTE_UNUSED, + unsigned int target ATTRIBUTE_UNUSED, + unsigned long long unit ATTRIBUTE_UNUSED) +{ + char *ret; + + ignore_value(VIR_STRDUP(ret, "sg0")); + return ret; +} -- 2.39.5