diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index 7e3e99efcb1132940820e20a79b77c528e75bcc4..9219cd7a60052e4b8b1ea3f5d95d4cefedbfe5d5 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -633,6 +633,11 @@ void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyT qdev_prop_cpy(dev, prop, src); } +void qdev_prop_set_bit(DeviceState *dev, const char *name, bool value) +{ + qdev_prop_set(dev, name, &value, PROP_TYPE_BIT); +} + void qdev_prop_set_uint8(DeviceState *dev, const char *name, uint8_t value) { qdev_prop_set(dev, name, &value, PROP_TYPE_UINT8); diff --git a/hw/qdev.h b/hw/qdev.h index 3e22eecc062899031d4fc71b823401bfe2ab9484..678f8b7d1d3d8193f5c3cf7178cdc1a61e078604 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -269,6 +269,7 @@ 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_bit(DeviceState *dev, const char *name, bool value); void qdev_prop_set_uint8(DeviceState *dev, const char *name, uint8_t value); void qdev_prop_set_uint16(DeviceState *dev, const char *name, uint16_t value); void qdev_prop_set_uint32(DeviceState *dev, const char *name, uint32_t value);