[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 34/36] machine: Use DEFINE_PROP_STRING for string properties
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 34/36] machine: Use DEFINE_PROP_STRING for string properties |
Date: |
Fri, 30 Oct 2020 18:10:34 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 |
On 29/10/20 23:02, Eduardo Habkost wrote:
> +static Property machine_props[] = {
> + DEFINE_PROP_STRING("kernel", MachineState, kernel_filename),
> + DEFINE_PROP_STRING("initrd", MachineState, initrd_filename),
> + DEFINE_PROP_STRING("append", MachineState, kernel_cmdline),
> + DEFINE_PROP_STRING("dtb", MachineState, dtb),
> + DEFINE_PROP_STRING("dumpdtb", MachineState, dumpdtb),
> + DEFINE_PROP_STRING("dt-compatible", MachineState, dt_compatible),
> + DEFINE_PROP_STRING("firmware", MachineState, firmware),
> + DEFINE_PROP_STRING("memory-backend", MachineState, ram_memdev_id),
> + DEFINE_PROP_END_OF_LIST(),
> +};
> +
While I think generalizing the _code_ for static properties is obviously
a good idea, I am not sure about generalizing the interface for adding them.
The reason is that we already have a place for adding properties in
class_init, and having a second makes things "less local", so to speak.
What do you think about adding macros like
OBJECT_CLASS_PROPERTY_ADD_STR(oc, MachineState, kernel_filename,
"kernel", prop_allow_set_always);
?
Paolo
- Re: [PATCH 26/36] qdev: Move softmmu properties to qdev-properties-system.h, (continued)
- [PATCH 31/36] qdev: Stop using error_set_from_qdev_prop_error() for UUID property, Eduardo Habkost, 2020/10/29
- [PATCH 25/36] qdev: Rename qdev_get_prop_ptr() to object_static_prop_ptr(), Eduardo Habkost, 2020/10/29
- [PATCH 28/36] qdev: Move core static property code to QOM, Eduardo Habkost, 2020/10/29
- [PATCH 30/36] qdev: Rename qdev_prop_* to prop_info_*, Eduardo Habkost, 2020/10/29
- [PATCH 34/36] machine: Use DEFINE_PROP_STRING for string properties, Eduardo Habkost, 2020/10/29
- Re: [PATCH 34/36] machine: Use DEFINE_PROP_STRING for string properties,
Paolo Bonzini <=
[PATCH 27/36] qdev: Reuse DEFINE_PROP in all DEFINE_PROP_* macros, Eduardo Habkost, 2020/10/29
[PATCH 29/36] qdev: Move qdev_prop_tpm declaration to tpm_prop.h, Eduardo Habkost, 2020/10/29
[PATCH 32/36] qdev: Move base property types to qom/property-types.c, Eduardo Habkost, 2020/10/29