[libvirt] [PATCH v2 06/10] qemu: Extract qemuGetHostdevPath from qemuGetSharedHostdevKey

Peter Krempa pkrempa at redhat.com
Wed Jul 8 12:46:35 UTC 2015


On Mon, Jul 06, 2015 at 13:08:34 -0400, John Ferlan wrote:
> The device path will be necessary for any future patch to allow sgio
> settings on a hostdev
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/qemu/qemu_conf.c | 22 +++++++++++++---------
>  1 file changed, 13 insertions(+), 9 deletions(-)
> 
> diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
> index 8afbddc..80b8926 100644
> --- a/src/qemu/qemu_conf.c
> +++ b/src/qemu/qemu_conf.c
> @@ -1263,20 +1263,14 @@ qemuGetHostdevPath(virDomainHostdevDefPtr hostdev)
>  
>  
>  static char *
> -qemuGetSharedHostdevKey(virDomainHostdevDefPtr hostdev)
> +qemuGetSharedHostdevKey(const char *dev_path)
>  {
>      char *key = NULL;
> -    char *dev_path = NULL;
> -
> -    if (!(dev_path = qemuGetHostdevPath(hostdev)))
> -        goto cleanup;
>  
>      if (!(key = qemuGetSharedDeviceKey(dev_path)))
>          goto cleanup;
>  
>   cleanup:
> -    VIR_FREE(dev_path);
> -

This function ends up as a no-value-added wrapper on top of
qemuGetSharedDeviceKey. The callers might as well as call
qemuGetSharedDeviceKey directly rather than this wrapper.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150708/f509c6a2/attachment-0001.sig>


More information about the libvir-list mailing list