X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=src%2Fguestfs.c;h=c3bce0b8416b9c16780fc28003b4c2814a016976;hp=5743a07181f9e4887f0e8589bd2725ac68d2bdbc;hb=6fb57e430c8daa06d8d938ac02a104c8aadbbda5;hpb=3d15f7e652340777514ff30c3cfc560a90b612ec diff --git a/src/guestfs.c b/src/guestfs.c index 5743a07..c3bce0b 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -404,9 +404,11 @@ guestfs_error (guestfs_h *g, const char *fs, ...) char *msg; va_start (args, fs); - vasprintf (&msg, fs, args); + int err = vasprintf (&msg, fs, args); va_end (args); + if (err < 0) return; + if (g->error_cb) g->error_cb (g, g->error_cb_data, msg); set_last_error (g, msg); @@ -706,7 +708,7 @@ guestfs_add_drive (guestfs_h *g, const char *filename) } /* cache=off improves reliability in the event of a host crash. */ - snprintf (buf, len, "file=%s,cache=off", filename); + snprintf (buf, len, "file=%s,cache=off,if=%s", filename, DRIVE_IF); return guestfs_config (g, "-drive", buf); } @@ -727,7 +729,7 @@ guestfs_add_drive_ro (guestfs_h *g, const char *filename) return -1; } - snprintf (buf, len, "file=%s,snapshot=on", filename); + snprintf (buf, len, "file=%s,snapshot=on,if=%s", filename, DRIVE_IF); return guestfs_config (g, "-drive", buf); } @@ -1471,6 +1473,13 @@ guestfs_free_lvm_lv_list (struct guestfs_lvm_lv_list *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.