提交 d8ed79ae 编写于 作者: G Gerd Hoffmann 提交者: Anthony Liguori

qdev: add qdev_prop_exists()

Function test whenever a driver has a specific property.
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 93db6685
......@@ -480,6 +480,11 @@ static Property *qdev_prop_find(DeviceState *dev, const char *name)
return NULL;
}
int qdev_prop_exists(DeviceState *dev, const char *name)
{
return qdev_prop_find(dev, name) ? true : false;
}
int qdev_prop_parse(DeviceState *dev, const char *name, const char *value)
{
Property *prop;
......
......@@ -249,6 +249,7 @@ extern PropertyInfo qdev_prop_pci_devfn;
/* Set properties between creation and init. */
void *qdev_get_prop_ptr(DeviceState *dev, Property *prop);
int qdev_prop_exists(DeviceState *dev, const char *name);
int qdev_prop_parse(DeviceState *dev, const char *name, const char *value);
void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyType type);
void qdev_prop_set_uint8(DeviceState *dev, const char *name, uint8_t value);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册