Re: [PATCH 08/15] util: Reduce complexity of virVHBAGetParent

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

 



On Wed, Jan 25, 2017 at 03:27:34PM -0500, John Ferlan wrote:
> Rather that getting the XML, parsing it, and grabbing the parent name
> field, just call the virNodeDeviceGetParent which is far more efficient.

ACK, this is unrelated to this series so you can push it as a fix for the
code in src/conf/storage_conf.c.

> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/util/virvhba.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/src/util/virvhba.c b/src/util/virvhba.c
> index 8c4da3a..2ad3520 100644
> --- a/src/util/virvhba.c
> +++ b/src/util/virvhba.c
> @@ -577,16 +577,10 @@ virVHBAGetParent(virConnectPtr conn,
>          goto cleanup;
>      }
>  
> -    if (!(xml = virNodeDeviceGetXMLDesc(device, 0)))
> -        goto cleanup;
> -
> -    if (!(def = virNodeDeviceDefParseString(xml, EXISTING_DEVICE, NULL)))
> -        goto cleanup;
> -
>      /* The caller checks whether the returned value is NULL or not
>       * before continuing
>       */
> -    ignore_value(VIR_STRDUP(vhba_parent, def->parent));
> +    ignore_value(VIR_STRDUP(vhba_parent, virNodeDeviceGetParent(device)));
>  
>   cleanup:
>      VIR_FREE(nodedev_name);
> -- 
> 2.7.4
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: Digital signature

--
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