On 03/09/2018 10:07 AM, Andrea Bolognani wrote:
> Querying properties for devices and objects is identical except
> for the specific QMP command that needs to be called.
> 
> Take the existing qemuMonitorJSONGetDeviceProps(), scrub all the
> device-specific parts, thus turning it into the generic helper
> qemuMonitorJSONGetProps(), which is then used to reimplement the
> original function and will be used again once object properties
> are needed.
> 
> Signed-off-by: Andrea Bolognani <abolo...@redhat.com>
> ---
>  src/qemu/qemu_monitor_json.c | 30 ++++++++++++++++++++++--------
>  1 file changed, 22 insertions(+), 8 deletions(-)
> 
> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index eb32811cd1..141873a705 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -6058,9 +6058,11 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr 
> mon,
>  #undef MAKE_SET_CMD
>  
>  
> -int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon,
> -                                  const char *type,
> -                                  char ***props)
> +static int
> +qemuMonitorJSONGetProps(qemuMonitorPtr mon,

Is perhaps this name too generic?  How about JSONGetListProps where
currently it's "device-list-properties", but shortly there will be
"qom-list-properties".

With some sort of API name adjustment,

Reviewed-by: John Ferlan <jfer...@redhat.com>

John


> +                        const char *type,
> +                        char ***props,
> +                        const char *impl)
>  {
>      int ret = -1;
>      virJSONValuePtr cmd;

[...]

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to