From: Paul Durrant Date: Thu, 22 Oct 2015 11:24:41 +0000 (+0100) Subject: Add missing parameterization of vendor device X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=323718230d9cbda576bcebda90fe0410ee41d01c;p=people%2Fpauldu%2Fxenbus.git Add missing parameterization of vendor device The vendor device check in XENFILT was incorrectly hard-coded to C000 rather than the prevailing vendor device id set at build time. Signed-off-by: Paul Durrant --- diff --git a/src/xenfilt/pvdevice.c b/src/xenfilt/pvdevice.c index 04d8193..179dc3d 100644 --- a/src/xenfilt/pvdevice.c +++ b/src/xenfilt/pvdevice.c @@ -72,6 +72,7 @@ __PvdeviceFree( static const CHAR *PvdeviceLegacyPrefix[] = { "PCI\\VEN_5853&DEV_0001", "PCI\\VEN_5853&DEV_0002", + NULL }; static BOOLEAN @@ -84,7 +85,7 @@ PvdeviceIsLegacy( UNREFERENCED_PARAMETER(Context); - for (Index = 0; Index < ARRAYSIZE(PvdeviceLegacyPrefix); Index++) { + for (Index = 0; PvdeviceLegacyPrefix[Index] != NULL; Index++) { const CHAR *Prefix = PvdeviceLegacyPrefix[Index]; if (_strnicmp(DeviceID, Prefix, strlen(Prefix)) == 0) @@ -95,7 +96,10 @@ PvdeviceIsLegacy( } static const CHAR *PvdeviceVendorDeviceID[] = { - "PCI\\VEN_5853&DEV_C000&SUBSYS_C0005853&REV_01", // XenServer +#ifdef VENDOR_DEVICE_ID_STR + "PCI\\VEN_5853&DEV_" VENDOR_DEVICE_ID_STR "&SUBSYS_C0005853&REV_01", +#endif + NULL }; static BOOLEAN @@ -105,7 +109,7 @@ PvdeviceIsVendorPresent( { ULONG Index; - for (Index = 0; Index < ARRAYSIZE(PvdeviceVendorDeviceID); Index++) { + for (Index = 0; PvdeviceVendorDeviceID[Index] != NULL; Index++) { const CHAR *DeviceID = PvdeviceVendorDeviceID[Index]; if (XENFILT_EMULATED(IsDevicePresent,