提交 bf5fbf8f 编写于 作者: O Osier Yang

nodedev_udev: changes missed by commit 1aa0ba3c

上级 1aa0ba3c
...@@ -1122,16 +1122,13 @@ out: ...@@ -1122,16 +1122,13 @@ out:
} }
static bool static bool
udevDeviceHasProperty(struct udev_device *dev, udevHasDeviceProperty(struct udev_device *dev,
const char *key) const char *key)
{ {
const char *value = NULL; if (udev_device_get_property_value(dev, key))
bool ret = false; return true;
if ((value = udev_device_get_property_value(dev, key))) return false;
ret = true;
return ret;
} }
static int static int
...@@ -1161,14 +1158,14 @@ udevGetDeviceType(struct udev_device *device, ...@@ -1161,14 +1158,14 @@ udevGetDeviceType(struct udev_device *device,
*type = VIR_NODE_DEV_CAP_NET; *type = VIR_NODE_DEV_CAP_NET;
} else { } else {
/* PCI devices don't set the DEVTYPE property. */ /* PCI devices don't set the DEVTYPE property. */
if (udevDeviceHasProperty(device, "PCI_CLASS")) if (udevHasDeviceProperty(device, "PCI_CLASS"))
*type = VIR_NODE_DEV_CAP_PCI_DEV; *type = VIR_NODE_DEV_CAP_PCI_DEV;
/* Wired network interfaces don't set the DEVTYPE property, /* Wired network interfaces don't set the DEVTYPE property,
* USB devices also have an INTERFACE property, but they do * USB devices also have an INTERFACE property, but they do
* set DEVTYPE, so if devtype is NULL and the INTERFACE * set DEVTYPE, so if devtype is NULL and the INTERFACE
* property exists, we have a network device. */ * property exists, we have a network device. */
if (udevDeviceHasProperty(device, "INTERFACE")) if (udevHasDeviceProperty(device, "INTERFACE"))
*type = VIR_NODE_DEV_CAP_NET; *type = VIR_NODE_DEV_CAP_NET;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册