Skip to content
  • Andrew Deason's avatar
    59e35c7b
    qga/commands-posix: Use getifaddrs when available · 59e35c7b
    Andrew Deason authored
    
    
    Currently, commands-posix.c assumes that getifaddrs() is only
    available on Linux, and so the related guest agent command
    guest-network-get-interfaces is only implemented for #ifdef __linux__.
    This function does exist on other platforms, though, such as Solaris.
    So, add a meson check for getifaddrs(), and move the code for
    guest-network-get-interfaces to be built whenever getifaddrs() is
    available.
    
    The implementation for guest-network-get-interfaces still has some
    Linux-specific code, which is not fixed in this commit. This commit
    moves the relevant big chunks of code around without changing them, so
    a future commit can change the code in place.
    
    Signed-off-by: default avatarAndrew Deason <adeason@sinenomine.net>
    Reviewed-by: default avatarMichal Privoznik <mprivozn@redhat.com>
    Message-Id: <20220426195526.7699-2-adeason@sinenomine.net>
    59e35c7b
    qga/commands-posix: Use getifaddrs when available
    Andrew Deason authored
    
    
    Currently, commands-posix.c assumes that getifaddrs() is only
    available on Linux, and so the related guest agent command
    guest-network-get-interfaces is only implemented for #ifdef __linux__.
    This function does exist on other platforms, though, such as Solaris.
    So, add a meson check for getifaddrs(), and move the code for
    guest-network-get-interfaces to be built whenever getifaddrs() is
    available.
    
    The implementation for guest-network-get-interfaces still has some
    Linux-specific code, which is not fixed in this commit. This commit
    moves the relevant big chunks of code around without changing them, so
    a future commit can change the code in place.
    
    Signed-off-by: default avatarAndrew Deason <adeason@sinenomine.net>
    Reviewed-by: default avatarMichal Privoznik <mprivozn@redhat.com>
    Message-Id: <20220426195526.7699-2-adeason@sinenomine.net>
Loading