Re: [PATCH 5/8] qemu: Extract generic part from qemuMonitorJSONGetDeviceProps()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 <abologna@xxxxxxxxxx>
> ---
>  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 <jferlan@xxxxxxxxxx>

John


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

[...]

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux