From 0a9a3d62d93f4bc13b3181ab7544571b97c82317 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 9 Jan 2018 11:01:43 +0000 Subject: [PATCH] diff: Set different identifiers on the two handles. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows us to easily see from trace output (‘virt-diff -x’) which handle is being used for each call. Otherwise you get meaningless output such as: libguestfs: trace: download "/Windows/WindowsUpdate.log" "/tmp/virtdiffy9m5YW/a" libguestfs: trace: download = 0 libguestfs: trace: download "/Windows/WindowsUpdate.log" "/tmp/virtdiffy9m5YW/b" libguestfs: trace: download = 0 Thanks: Xiang Hua Chen --- diff/diff.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/diff/diff.c b/diff/diff.c index c11576077..ebbce8212 100644 --- a/diff/diff.c +++ b/diff/diff.c @@ -206,10 +206,12 @@ main (int argc, char *argv[]) g = guestfs_create (); if (g == NULL) error (EXIT_FAILURE, errno, "guestfs_create"); + guestfs_set_identifier (g, "g1"); g2 = guestfs_create (); if (g2 == NULL) error (EXIT_FAILURE, errno, "guestfs_create"); + guestfs_set_identifier (g2, "g2"); for (;;) { c = getopt_long (argc, argv, options, long_options, &option_index);