Re: [PATCH 1/5] tests: qemuxml2argvmock: Don't mock virCommandPassFD

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

 



On 08/14/2018 03:21 PM, Peter Krempa wrote:
> This function does not modify the host. It merely puts the file
> descriptor into a list in virCommandPtr.
> 
> Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
> ---
>  tests/qemuxml2argvmock.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
> index 4df92cf396..c8a5f186d5 100644
> --- a/tests/qemuxml2argvmock.c
> +++ b/tests/qemuxml2argvmock.c
> @@ -184,14 +184,6 @@ virNetDevRunEthernetScript(const char *ifname ATTRIBUTE_UNUSED,
>      return 0;
>  }
> 
> -void
> -virCommandPassFD(virCommandPtr cmd ATTRIBUTE_UNUSED,
> -                 int fd ATTRIBUTE_UNUSED,
> -                 unsigned int flags ATTRIBUTE_UNUSED)
> -{
> -    /* nada */
> -}
> -
>  int
>  virNetDevOpenvswitchGetVhostuserIfname(const char *path ATTRIBUTE_UNUSED,
>                                         char **ifname)
> 

NACK, this indeed causes caller to close wrong FD:


libvirt.git/tests $ ../run valgrind --trace-children=yes ./qemuxml2argvtest

==210382== Warning: invalid file descriptor 1729 in syscall close()


Michal

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