Re: [PATCH 1/2] Report first tried socket from remoteProbeSystemDriverFromSocket

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

 



On Tue, Nov 28, 2023 at 02:15:59PM +0100, Peter Krempa wrote:
On Tue, Nov 28, 2023 at 14:04:12 +0100, Peter Krempa wrote:
On Tue, Nov 28, 2023 at 13:02:39 +0100, Martin Kletzander wrote:
> This will improve an error message later on.
>
> Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
> ---
>  src/remote/remote_daemon_dispatch.c |  2 +-
>  src/remote/remote_sockets.c         | 11 +++++++++--
>  src/remote/remote_sockets.h         |  2 +-
>  3 files changed, 11 insertions(+), 4 deletions(-)

[...]

> diff --git a/src/remote/remote_sockets.c b/src/remote/remote_sockets.c
> index 4ab3d72933e2..c21970cd31e7 100644
> --- a/src/remote/remote_sockets.c
> +++ b/src/remote/remote_sockets.c

[...]

> @@ -243,6 +246,9 @@ remoteProbeSystemDriverFromSocket(bool readonly, char **driver)
>              return 0;
>          }
>
> +        if (first_socket && !*first_socket)
> +            *first_socket = g_steal_pointer(&sockname);

Actually, the commit message seems to imply that you want the first
probed socket to be here, but if the socket file exists, this code won't
be reached. This is fine for the usage though I suppose.


Yes, that's the point, enhance the error message.  If any socket is
found, there is no error message from this particular function.

I'll also have to see how this is used, because based on the logic, the
first_socket, value will be set to whatever was frist compiled from the
following list:

const char *drivers[] = {
#ifdef WITH_LIBXL
       "xen",
#endif
#ifdef WITH_QEMU
       "qemu",
#endif
#ifdef WITH_LXC
       "lxc",
#endif
#ifdef WITH_VBOX
       "vbox",
#endif
#ifdef WITH_BHYVE
       "bhyve",
#endif
#ifdef WITH_VZ
       "vz",
#endif
   };


Thus reallistically after this patch it will return the first missing
socket from the above list whichever got compiled in given version.


Yes, exactly my point.  I had various patches suggesting all the sockets
etc., but when someone is using neither uri_default nor
VIRSH_DEFAULT_CONNECT_URI nor LIBVIRT_DEFAULT_URI nor -c (some of them
of course only in the virsh case) then constructing a paragraph of
suggestions in a convoluted way seems more gross than this patch, which
strictly enhances the error message users see.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx

[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