summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorEduardo Habkost2020-12-11 23:05:08 +0100
committerEduardo Habkost2020-12-15 16:02:07 +0100
commit381481597c3027854fa72c6a31477622eddb545a (patch)
treec5680bdd70957bad3ae6a952012115dc81fa947f /hw
parentqdev: Make qdev_find_global_prop() get Object* argument (diff)
downloadqemu-381481597c3027854fa72c6a31477622eddb545a.tar.gz
qemu-381481597c3027854fa72c6a31477622eddb545a.tar.xz
qemu-381481597c3027854fa72c6a31477622eddb545a.zip
qdev: Make check_prop_still_unset() get Object* argument
Make the code more generic and not specific to TYPE_DEVICE. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20201211220529.2290218-12-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/core/qdev-properties-system.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 57e63c6949..58bb129bbe 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -32,11 +32,11 @@
#include "hw/pci/pci.h"
#include "util/block-helpers.h"
-static bool check_prop_still_unset(DeviceState *dev, const char *name,
+static bool check_prop_still_unset(Object *obj, const char *name,
const void *old_val, const char *new_val,
Error **errp)
{
- const GlobalProperty *prop = qdev_find_global_prop(OBJECT(dev), name);
+ const GlobalProperty *prop = qdev_find_global_prop(obj, name);
if (!old_val) {
return true;
@@ -105,7 +105,7 @@ static void set_drive_helper(Object *obj, Visitor *v, const char *name,
* TODO Should this really be an error? If no, the old value
* needs to be released before we store the new one.
*/
- if (!check_prop_still_unset(dev, name, *ptr, str, errp)) {
+ if (!check_prop_still_unset(obj, name, *ptr, str, errp)) {
return;
}
@@ -247,7 +247,7 @@ static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque,
* TODO Should this really be an error? If no, the old value
* needs to be released before we store the new one.
*/
- if (!check_prop_still_unset(dev, name, be->chr, str, errp)) {
+ if (!check_prop_still_unset(obj, name, be->chr, str, errp)) {
return;
}
@@ -429,7 +429,7 @@ static void set_netdev(Object *obj, Visitor *v, const char *name,
* TODO Should this really be an error? If no, the old value
* needs to be released before we store the new one.
*/
- if (!check_prop_still_unset(dev, name, ncs[i], str, errp)) {
+ if (!check_prop_still_unset(obj, name, ncs[i], str, errp)) {
goto out;
}