diff options
author | Peter Maydell | 2021-01-01 23:57:15 +0100 |
---|---|---|
committer | Peter Maydell | 2021-01-01 23:57:15 +0100 |
commit | 41192db338588051f21501abc13743e62b0a5605 (patch) | |
tree | 683166575873af292daedaf30177919856ffbfc6 /hw/s390x | |
parent | Merge remote-tracking branch 'remotes/cohuck-gitlab/tags/s390x-20201222' into... (diff) | |
parent | bugfix: hostmem: Free host_nodes list right after visited (diff) | |
download | qemu-41192db338588051f21501abc13743e62b0a5605.tar.gz qemu-41192db338588051f21501abc13743e62b0a5605.tar.xz qemu-41192db338588051f21501abc13743e62b0a5605.zip |
Merge remote-tracking branch 'remotes/ehabkost-gl/tags/machine-next-pull-request' into staging
Machine queue, 2020-12-23
Cleanup:
* qdev code cleanup (Eduardo Habkost)
Bug fix:
* hostmem: Free host_nodes list right after visited (Keqian Zhu)
# gpg: Signature made Wed 23 Dec 2020 21:25:58 GMT
# gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
# gpg: issuer "ehabkost@redhat.com"
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6
* remotes/ehabkost-gl/tags/machine-next-pull-request:
bugfix: hostmem: Free host_nodes list right after visited
qdev: Avoid unnecessary DeviceState* variable at set_prop_arraylen()
qdev: Rename qdev_get_prop_ptr() to object_field_prop_ptr()
qdev: Move qdev_prop_tpm declaration to tpm_prop.h
qdev: Make qdev_class_add_property() more flexible
qdev: Make PropertyInfo.create return ObjectProperty*
qdev: Move dev->realized check to qdev_property_set()
qdev: Wrap getters and setters in separate helpers
qdev: Add name argument to PropertyInfo.create method
qdev: Add name parameter to qdev_class_add_property()
qdev: Avoid using prop->name unnecessarily
qdev: Get just property name at error_set_from_qdev_prop_error()
sparc: Use DEFINE_PROP for nwindows property
qdev: Reuse DEFINE_PROP in all DEFINE_PROP_* macros
qdev: Move softmmu properties to qdev-properties-system.h
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/s390x')
-rw-r--r-- | hw/s390x/css.c | 12 | ||||
-rw-r--r-- | hw/s390x/s390-pci-bus.c | 10 |
2 files changed, 5 insertions, 17 deletions
diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 38fd46b9a9..fe47751df4 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -2344,7 +2344,7 @@ static void get_css_devid(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { Property *prop = opaque; - CssDevId *dev_id = qdev_get_prop_ptr(obj, prop); + CssDevId *dev_id = object_field_prop_ptr(obj, prop); char buffer[] = "xx.x.xxxx"; char *p = buffer; int r; @@ -2372,25 +2372,19 @@ static void get_css_devid(Object *obj, Visitor *v, const char *name, static void set_css_devid(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { - DeviceState *dev = DEVICE(obj); Property *prop = opaque; - CssDevId *dev_id = qdev_get_prop_ptr(obj, prop); + CssDevId *dev_id = object_field_prop_ptr(obj, prop); char *str; int num, n1, n2; unsigned int cssid, ssid, devid; - if (dev->realized) { - qdev_prop_set_after_realize(dev, name, errp); - return; - } - if (!visit_type_str(v, name, &str, errp)) { return; } num = sscanf(str, "%2x.%1x%n.%4x%n", &cssid, &ssid, &n1, &devid, &n2); if (num != 3 || (n2 - n1) != 5 || strlen(str) != n2) { - error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str); + error_set_from_qdev_prop_error(errp, EINVAL, obj, name, str); goto out; } if ((cssid > MAX_CSSID) || (ssid > MAX_SSID)) { diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 8b6be1197b..dd138dae94 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -1330,7 +1330,7 @@ static void s390_pci_get_fid(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { Property *prop = opaque; - uint32_t *ptr = qdev_get_prop_ptr(obj, prop); + uint32_t *ptr = object_field_prop_ptr(obj, prop); visit_type_uint32(v, name, ptr, errp); } @@ -1338,15 +1338,9 @@ static void s390_pci_get_fid(Object *obj, Visitor *v, const char *name, static void s390_pci_set_fid(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { - DeviceState *dev = DEVICE(obj); S390PCIBusDevice *zpci = S390_PCI_DEVICE(obj); Property *prop = opaque; - uint32_t *ptr = qdev_get_prop_ptr(obj, prop); - - if (dev->realized) { - qdev_prop_set_after_realize(dev, name, errp); - return; - } + uint32_t *ptr = object_field_prop_ptr(obj, prop); if (!visit_type_uint32(v, name, ptr, errp)) { return; |