[libvirt] [PATCH v2 3/8] qemu: Don't store disk alias in qemuAgentDiskInfo

Michal Privoznik mprivozn at redhat.com
Thu Jan 16 15:38:43 UTC 2020


On 1/11/20 12:32 AM, Jonathon Jongsma wrote:
> The qemuAgentDiskInfo structure is filled with information received from
> the agent command response, except for the 'alias' field, which is
> retrieved from the vm definition. Limit this structure only to data that
> was received from the agent message.
> 
> This is another intermediate step in moving the responsibility for
> searching the vmdef from qemu_agent.c to qemu_driver.c so that we can
> avoid holding an agent job and a normal job at the same time.
> 
> Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
> ---
>   src/qemu/qemu_agent.c | 63 ++++++++++++++++++++++++-------------------
>   1 file changed, 35 insertions(+), 28 deletions(-)
> 
> diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
> index fa55ff0a57..b250077f0a 100644
> --- a/src/qemu/qemu_agent.c
> +++ b/src/qemu/qemu_agent.c
> @@ -1851,7 +1851,6 @@ qemuAgentSetTime(qemuAgentPtr mon,
>   typedef struct _qemuAgentDiskInfo qemuAgentDiskInfo;
>   typedef qemuAgentDiskInfo *qemuAgentDiskInfoPtr;
>   struct _qemuAgentDiskInfo {
> -    char *alias;
>       char *serial;
>       virPCIDeviceAddress pci_controller;
>       char *bus_type;
> @@ -1880,7 +1879,6 @@ qemuAgentDiskInfoFree(qemuAgentDiskInfoPtr info)
>           return;
>   
>       VIR_FREE(info->serial);
> -    VIR_FREE(info->alias);
>       VIR_FREE(info->bus_type);
>       VIR_FREE(info->devnode);
>       VIR_FREE(info);
> @@ -1906,10 +1904,12 @@ qemuAgentFSInfoFree(qemuAgentFSInfoPtr info)
>   }
>   
>   static virDomainFSInfoPtr
> -qemuAgentFSInfoToPublic(qemuAgentFSInfoPtr agent)
> +qemuAgentFSInfoToPublic(qemuAgentFSInfoPtr agent,
> +                        virDomainDefPtr vmdef)
>   {
>       virDomainFSInfoPtr ret = NULL;
>       size_t i;
> +    virDomainDiskDefPtr diskDef;

This can go into the for() loop.

>   
>       if (VIR_ALLOC(ret) < 0)
>           goto error;

Michal




More information about the libvir-list mailing list