diff: Set different identifiers on the two handles.

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
This commit is contained in:
Richard W.M. Jones
2018-01-09 11:01:43 +00:00
parent ab0a3e0276
commit 0a9a3d62d9

View File

@@ -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);