X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=java%2Fcom%2Fredhat%2Fet%2Flibguestfs%2FGuestFS.java;h=1d00547cd235b196c39607642b10d4ff28f07ff5;hp=d340b8cbf77c6000e0ab5b813088a3628eb3cb06;hb=d1a1ab972bb22f4c38a21fcc73f81650aaa03b4e;hpb=bfdc03be234d6d95f18450846433bce4f97e184c diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index d340b8c..1d00547 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -429,6 +429,12 @@ public HashMap test0rhashtableerr () * This is equivalent to the qemu parameter "-drive * file=filename". *

+ * Note that this call checks for the existence of + * "filename". This stops you from specifying other types + * of drive which are supported by qemu such as "nbd:" and + * "http:" URLs. To specify those, use the general + * "g.config" call instead. + *

* @throws LibGuestFSException */ public void add_drive (String filename) @@ -450,6 +456,12 @@ public HashMap test0rhashtableerr () * This is equivalent to the qemu parameter "-cdrom * filename". *

+ * Note that this call checks for the existence of + * "filename". This stops you from specifying other types + * of drive which are supported by qemu such as "nbd:" and + * "http:" URLs. To specify those, use the general + * "g.config" call instead. + *

* @throws LibGuestFSException */ public void add_cdrom (String filename) @@ -463,6 +475,40 @@ public HashMap test0rhashtableerr () throws LibGuestFSException; /** + * add a drive in snapshot mode (read-only) + *

+ * This adds a drive in snapshot mode, making it + * effectively read-only. + *

+ * Note that writes to the device are allowed, and will be + * seen for the duration of the guestfs handle, but they + * are written to a temporary file which is discarded as + * soon as the guestfs handle is closed. We don't currently + * have any method to enable changes to be committed, + * although qemu can support this. + *

+ * This is equivalent to the qemu parameter "-drive + * file=filename,snapshot=on". + *

+ * Note that this call checks for the existence of + * "filename". This stops you from specifying other types + * of drive which are supported by qemu such as "nbd:" and + * "http:" URLs. To specify those, use the general + * "g.config" call instead. + *

+ * @throws LibGuestFSException + */ + public void add_drive_ro (String filename) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("add_drive_ro: handle is closed"); + _add_drive_ro (g, filename); + } + private native void _add_drive_ro (long g, String filename) + throws LibGuestFSException; + + /** * add qemu parameters *

* This can be used to add arbitrary qemu command line