[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 11/53] qdev: Make check_prop_still_unset() get Object* argumen
From: |
Eduardo Habkost |
Subject: |
[PATCH v3 11/53] qdev: Make check_prop_still_unset() get Object* argument |
Date: |
Thu, 12 Nov 2020 16:43:08 -0500 |
Make the code more generic and not specific to TYPE_DEVICE.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org
---
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 af1339e562..85dd38db0f 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
- [PATCH v3 00/53] Make qdev static property API usable by any QOM type, Eduardo Habkost, 2020/11/12
- [PATCH v3 01/53] cs4231: Get rid of empty property array, Eduardo Habkost, 2020/11/12
- [PATCH v3 02/53] cpu: Move cpu_common_props to hw/core/cpu.c, Eduardo Habkost, 2020/11/12
- [PATCH v3 03/53] qdev: Move property code to qdev-properties.[ch], Eduardo Habkost, 2020/11/12
- [PATCH v3 04/53] qdev: Check dev->realized at set_size(), Eduardo Habkost, 2020/11/12
- [PATCH v3 08/53] qdev: Make bit_prop_set() get Object* argument, Eduardo Habkost, 2020/11/12
- [PATCH v3 07/53] qdev: Make PropertyInfo.print method get Object* argument, Eduardo Habkost, 2020/11/12
- [PATCH v3 05/53] sparc: Check dev->realized at sparc_set_nwindows(), Eduardo Habkost, 2020/11/12
- [PATCH v3 06/53] qdev: Don't use dev->id on set_size32() error message, Eduardo Habkost, 2020/11/12
- [PATCH v3 10/53] qdev: Make qdev_find_global_prop() get Object* argument, Eduardo Habkost, 2020/11/12
- [PATCH v3 11/53] qdev: Make check_prop_still_unset() get Object* argument,
Eduardo Habkost <=
- [PATCH v3 09/53] qdev: Make qdev_get_prop_ptr() get Object* arg, Eduardo Habkost, 2020/11/12
- [PATCH v3 12/53] qdev: Make error_set_from_qdev_prop_error() get Object* argument, Eduardo Habkost, 2020/11/12
- [PATCH v3 13/53] qdev: Make qdev_propinfo_get_uint16() static, Eduardo Habkost, 2020/11/12
- [PATCH v3 14/53] qdev: Move UUID property to qdev-properties-system.c, Eduardo Habkost, 2020/11/12
- [PATCH v3 17/53] sparc: Use DEFINE_PROP for nwindows property, Eduardo Habkost, 2020/11/12
- [PATCH v3 16/53] qdev: Reuse DEFINE_PROP in all DEFINE_PROP_* macros, Eduardo Habkost, 2020/11/12
- [PATCH v3 15/53] qdev: Move softmmu properties to qdev-properties-system.h, Eduardo Habkost, 2020/11/12
- [PATCH v3 18/53] qdev: Get just property name at error_set_from_qdev_prop_error(), Eduardo Habkost, 2020/11/12