[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/25] qdev: Make check_prop_still_unset() get Object* argument
From: |
Eduardo Habkost |
Subject: |
[PULL 21/25] qdev: Make check_prop_still_unset() get Object* argument |
Date: |
Tue, 15 Dec 2020 10:19:38 -0500 |
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>
---
hw/core/qdev-properties-system.c | 10 +++++-----
1 file 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;
}
--
2.28.0
- [PULL 00/25] Machine queue, 2020-12-15, Eduardo Habkost, 2020/12/15
- [PULL 02/25] vexpress-a15: Register "virtualization" as class property, Eduardo Habkost, 2020/12/15
- [PULL 09/25] netfilter: Reorder functions, Eduardo Habkost, 2020/12/15
- [PULL 18/25] qdev: Make bit_prop_set() get Object* argument, Eduardo Habkost, 2020/12/15
- [PULL 03/25] tmp421: Register properties as class properties, Eduardo Habkost, 2020/12/15
- [PULL 10/25] netfilter: Use class properties, Eduardo Habkost, 2020/12/15
- [PULL 05/25] arm/virt: Register most properties as class properties, Eduardo Habkost, 2020/12/15
- [PULL 22/25] qdev: Make error_set_from_qdev_prop_error() get Object* argument, Eduardo Habkost, 2020/12/15
- [PULL 14/25] qdev: Check dev->realized at set_size(), Eduardo Habkost, 2020/12/15
- [PULL 21/25] qdev: Make check_prop_still_unset() get Object* argument,
Eduardo Habkost <=
- [PULL 15/25] sparc: Check dev->realized at sparc_set_nwindows(), Eduardo Habkost, 2020/12/15
- [PULL 01/25] vexpress: Register "secure" as class property, Eduardo Habkost, 2020/12/15
- [PULL 16/25] qdev: Don't use dev->id on set_size32() error message, Eduardo Habkost, 2020/12/15
- [PULL 11/25] cs4231: Get rid of empty property array, Eduardo Habkost, 2020/12/15
- [PULL 07/25] arm/cpu64: Register "aarch64" as class property, Eduardo Habkost, 2020/12/15
- [PULL 04/25] i386: Register feature bit properties as class properties, Eduardo Habkost, 2020/12/15
- [PULL 13/25] qdev: Move property code to qdev-properties.[ch], Eduardo Habkost, 2020/12/15
- [PULL 12/25] cpu: Move cpu_common_props to hw/core/cpu.c, Eduardo Habkost, 2020/12/15
- [PULL 08/25] can_host: Use class properties, Eduardo Habkost, 2020/12/15
- [PULL 25/25] MAINTAINERS: Update my git repository URLs, Eduardo Habkost, 2020/12/15