X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fguestfs.c;h=66ab12af0438960f63bd597a5cd2c2eb3992e8f6;hb=35c646965a21d452cf74ef3683612210a653c36d;hp=350d84817157a25f61f2dbc5bdac0688063d1902;hpb=447dae7df43e8a98da59d94f1aef9895e087aa13;p=libguestfs.git diff --git a/src/guestfs.c b/src/guestfs.c index 350d848..66ab12a 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -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) @@ -1479,44 +1490,6 @@ guestfs_end_busy (guestfs_h *g) return 0; } -/* Structure-freeing functions. These rely on the fact that the - * structure format is identical to the XDR format. See note in - * generator.ml. - */ -void -guestfs_free_int_bool (struct guestfs_int_bool *x) -{ - free (x); -} - -void -guestfs_free_lvm_pv_list (struct guestfs_lvm_pv_list *x) -{ - xdr_free ((xdrproc_t) xdr_guestfs_lvm_int_pv_list, (char *) x); - free (x); -} - -void -guestfs_free_lvm_vg_list (struct guestfs_lvm_vg_list *x) -{ - xdr_free ((xdrproc_t) xdr_guestfs_lvm_int_vg_list, (char *) x); - free (x); -} - -void -guestfs_free_lvm_lv_list (struct guestfs_lvm_lv_list *x) -{ - xdr_free ((xdrproc_t) xdr_guestfs_lvm_int_lv_list, (char *) x); - free (x); -} - -void -guestfs_free_dirent_list (struct guestfs_dirent_list *x) -{ - xdr_free ((xdrproc_t) xdr_guestfs_int_dirent_list, (char *) x); - free (x); -} - /* We don't know if stdout_event or sock_read_event will be the * first to receive EOF if the qemu process dies. This function * has the common cleanup code for both. @@ -2276,6 +2249,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);