Add a debug message to the library cancellation path.
[libguestfs.git] / src / guestfs.c
index 350d848..c15a360 100644 (file)
@@ -667,6 +667,17 @@ guestfs_get_memsize (guestfs_h *g)
   return g->memsize;
 }
 
+int
+guestfs_get_pid (guestfs_h *g)
+{
+  if (g->pid > 0)
+    return g->pid;
+  else {
+    error (g, "get_pid: no qemu subprocess");
+    return -1;
+  }
+}
+
 /* Add a string to the current command line. */
 static void
 incr_cmdline_size (guestfs_h *g)
@@ -2276,6 +2287,10 @@ guestfs__receive_file_sync (guestfs_h *g, const char *filename)
   char fbuf[4];
   uint32_t flag = GUESTFS_CANCEL_FLAG;
 
+  if (g->verbose)
+    fprintf (stderr, "%s: waiting for daemon to acknowledge cancellation\n",
+            __func__);
+
   xdrmem_create (&xdr, fbuf, sizeof fbuf, XDR_ENCODE);
   xdr_uint32_t (&xdr, &flag);
   xdr_destroy (&xdr);