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:04:12PM +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);

You steal 'sockname' here ...

+
         VIR_DEBUG("Missing sock %s for driver %s", sockname, drivers[i]);

... and here it's still used.

For making the code future proof, it'll be most likely better to simply
copy the string instead of rearranging it to be able to steal it.


Yup, makes sense, thanks.

     }


With the bug above addressed:

Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>

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