From ca49c50e06834bbc68e21630a5552c57494f2b53 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 18 May 2009 20:22:53 +0100 Subject: [PATCH] Generated code for lvresize, resize2fs. --- daemon/actions.h | 2 + daemon/stubs.c | 56 ++++ fish/cmds.c | 44 +++ fish/completion.c | 2 + guestfish-actions.pod | 15 + guestfs-actions.pod | 22 ++ haskell/Guestfs.hs | 15 +- java/com/redhat/et/libguestfs/GuestFS.java | 37 +++ java/com_redhat_et_libguestfs_GuestFS.c | 36 +++ ocaml/guestfs.ml | 2 + ocaml/guestfs.mli | 6 + ocaml/guestfs_c_actions.c | 47 +++ perl/Guestfs.xs | 23 ++ perl/lib/Sys/Guestfs.pm | 11 + python/guestfs-py.c | 53 ++++ python/guestfs.py | 13 + ruby/ext/guestfs/_guestfs.c | 47 +++ src/guestfs-actions.c | 176 +++++++++++ src/guestfs-actions.h | 2 + src/guestfs_protocol.c | 22 ++ src/guestfs_protocol.h | 19 +- src/guestfs_protocol.x | 11 + tests.c | 451 ++++++++++++++++++++--------- 23 files changed, 975 insertions(+), 137 deletions(-) diff --git a/daemon/actions.h b/daemon/actions.h index dcffd2a..79ec62a 100644 --- a/daemon/actions.h +++ b/daemon/actions.h @@ -125,3 +125,5 @@ extern char *do_sfdisk_kernel_geometry (const char *device); extern char *do_sfdisk_disk_geometry (const char *device); extern int do_vg_activate_all (int activate); extern int do_vg_activate (int activate, char * const* const volgroups); +extern int do_lvresize (const char *device, int mbytes); +extern int do_resize2fs (const char *device); diff --git a/daemon/stubs.c b/daemon/stubs.c index 2fd2da9..2fdd5c1 100644 --- a/daemon/stubs.c +++ b/daemon/stubs.c @@ -2617,6 +2617,56 @@ done: xdr_free ((xdrproc_t) xdr_guestfs_vg_activate_args, (char *) &args); } +static void lvresize_stub (XDR *xdr_in) +{ + int r; + struct guestfs_lvresize_args args; + const char *device; + int mbytes; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_lvresize_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "lvresize"); + return; + } + device = args.device; + mbytes = args.mbytes; + + r = do_lvresize (device, mbytes); + if (r == -1) + /* do_lvresize has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_lvresize_args, (char *) &args); +} + +static void resize2fs_stub (XDR *xdr_in) +{ + int r; + struct guestfs_resize2fs_args args; + const char *device; + + memset (&args, 0, sizeof args); + + if (!xdr_guestfs_resize2fs_args (xdr_in, &args)) { + reply_with_error ("%s: daemon failed to decode procedure arguments", "resize2fs"); + return; + } + device = args.device; + + r = do_resize2fs (device); + if (r == -1) + /* do_resize2fs has already called reply_with_error */ + goto done; + + reply (NULL, NULL); +done: + xdr_free ((xdrproc_t) xdr_guestfs_resize2fs_args, (char *) &args); +} + void dispatch_incoming_message (XDR *xdr_in) { switch (proc_nr) { @@ -2932,6 +2982,12 @@ void dispatch_incoming_message (XDR *xdr_in) case GUESTFS_PROC_VG_ACTIVATE: vg_activate_stub (xdr_in); break; + case GUESTFS_PROC_LVRESIZE: + lvresize_stub (xdr_in); + break; + case GUESTFS_PROC_RESIZE2FS: + resize2fs_stub (xdr_in); + break; default: reply_with_error ("dispatch_incoming_message: unknown procedure number %d", proc_nr); } diff --git a/fish/cmds.c b/fish/cmds.c index 8d50021..77b5d43 100644 --- a/fish/cmds.c +++ b/fish/cmds.c @@ -99,6 +99,7 @@ void list_commands (void) printf ("%-20s %s\n", "lvcreate", "create an LVM volume group"); printf ("%-20s %s\n", "lvm-remove-all", "remove all LVM LVs, VGs and PVs"); printf ("%-20s %s\n", "lvremove", "remove an LVM logical volume"); + printf ("%-20s %s\n", "lvresize", "resize an LVM logical volume"); printf ("%-20s %s\n", "lvs", "list the LVM logical volumes (LVs)"); printf ("%-20s %s\n", "lvs-full", "list the LVM logical volumes (LVs)"); printf ("%-20s %s\n", "mkdir", "create a directory"); @@ -117,6 +118,7 @@ void list_commands (void) printf ("%-20s %s\n", "pvs", "list the LVM physical volumes (PVs)"); printf ("%-20s %s\n", "pvs-full", "list the LVM physical volumes (PVs)"); printf ("%-20s %s\n", "read-lines", "read file as lines"); + printf ("%-20s %s\n", "resize2fs", "resize an ext2/ext3 filesystem"); printf ("%-20s %s\n", "rm", "remove a file"); printf ("%-20s %s\n", "rm-rf", "remove a file or directory recursively"); printf ("%-20s %s\n", "rmdir", "remove a directory"); @@ -532,6 +534,12 @@ void display_command (const char *cmd) if (strcasecmp (cmd, "vg_activate") == 0 || strcasecmp (cmd, "vg-activate") == 0) pod2text ("vg-activate - activate or deactivate some volume groups", " vg-activate \n\nThis command activates or (if C is false) deactivates\nall logical volumes in the listed volume groups C.\nIf activated, then they are made known to the\nkernel, ie. they appear as C devices. If deactivated,\nthen those devices disappear.\n\nThis command is the same as running C\n\nNote that if C is an empty list then B volume groups\nare activated or deactivated."); else + if (strcasecmp (cmd, "lvresize") == 0) + pod2text ("lvresize - resize an LVM logical volume", " lvresize \n\nThis resizes (expands or shrinks) an existing LVM logical\nvolume to C. When reducing, data in the reduced part\nis lost."); + else + if (strcasecmp (cmd, "resize2fs") == 0) + pod2text ("resize2fs - resize an ext2/ext3 filesystem", " resize2fs \n\nThis resizes an ext2 or ext3 filesystem to match the size of\nthe underlying device."); + else display_builtin_command (cmd); } @@ -2603,6 +2611,36 @@ static int run_vg_activate (const char *cmd, int argc, char *argv[]) return r; } +static int run_lvresize (const char *cmd, int argc, char *argv[]) +{ + int r; + const char *device; + int mbytes; + if (argc != 2) { + fprintf (stderr, "%s should have 2 parameter(s)\n", cmd); + fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd); + return -1; + } + device = argv[0]; + mbytes = atoi (argv[1]); + r = guestfs_lvresize (g, device, mbytes); + return r; +} + +static int run_resize2fs (const char *cmd, int argc, char *argv[]) +{ + int r; + const char *device; + if (argc != 1) { + fprintf (stderr, "%s should have 1 parameter(s)\n", cmd); + fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd); + return -1; + } + device = argv[0]; + r = guestfs_resize2fs (g, device); + return r; +} + int run_action (const char *cmd, int argc, char *argv[]) { if (strcasecmp (cmd, "launch") == 0 || strcasecmp (cmd, "run") == 0) @@ -2977,6 +3015,12 @@ int run_action (const char *cmd, int argc, char *argv[]) if (strcasecmp (cmd, "vg_activate") == 0 || strcasecmp (cmd, "vg-activate") == 0) return run_vg_activate (cmd, argc, argv); else + if (strcasecmp (cmd, "lvresize") == 0) + return run_lvresize (cmd, argc, argv); + else + if (strcasecmp (cmd, "resize2fs") == 0) + return run_resize2fs (cmd, argc, argv); + else { fprintf (stderr, "%s: unknown command\n", cmd); return -1; diff --git a/fish/completion.c b/fish/completion.c index a072ce3..33a5663 100644 --- a/fish/completion.c +++ b/fish/completion.c @@ -106,6 +106,7 @@ static const char *const commands[] = { "lvcreate", "lvm-remove-all", "lvremove", + "lvresize", "lvs", "lvs-full", "mkdir", @@ -126,6 +127,7 @@ static const char *const commands[] = { "pvs-full", "qemu", "read-lines", + "resize2fs", "rm", "rm-rf", "rmdir", diff --git a/guestfish-actions.pod b/guestfish-actions.pod index 7e33cbb..3945fb1 100644 --- a/guestfish-actions.pod +++ b/guestfish-actions.pod @@ -777,6 +777,14 @@ the path to the LV, such as C. You can also remove all LVs in a volume group by specifying the VG name, C. +=head2 lvresize + + lvresize device mbytes + +This resizes (expands or shrinks) an existing LVM logical +volume to C. When reducing, data in the reduced part +is lost. + =head2 lvs lvs @@ -945,6 +953,13 @@ Note that this function cannot correctly handle binary files as end of line). For those you need to use the C function which has a more complex interface. +=head2 resize2fs + + resize2fs device + +This resizes an ext2 or ext3 filesystem to match the size of +the underlying device. + =head2 rm rm path diff --git a/guestfs-actions.pod b/guestfs-actions.pod index 9ed1cce..6f33d80 100644 --- a/guestfs-actions.pod +++ b/guestfs-actions.pod @@ -1026,6 +1026,18 @@ the VG name, C. This function returns 0 on success or -1 on error. +=head2 guestfs_lvresize + + int guestfs_lvresize (guestfs_h *handle, + const char *device, + int mbytes); + +This resizes (expands or shrinks) an existing LVM logical +volume to C. When reducing, data in the reduced part +is lost. + +This function returns 0 on success or -1 on error. + =head2 guestfs_lvs char **guestfs_lvs (guestfs_h *handle); @@ -1265,6 +1277,16 @@ This function returns a NULL-terminated array of strings (like L), or NULL if there was an error. I. +=head2 guestfs_resize2fs + + int guestfs_resize2fs (guestfs_h *handle, + const char *device); + +This resizes an ext2 or ext3 filesystem to match the size of +the underlying device. + +This function returns 0 on success or -1 on error. + =head2 guestfs_rm int guestfs_rm (guestfs_h *handle, diff --git a/haskell/Guestfs.hs b/haskell/Guestfs.hs index 170f040..8f90ee8 100644 --- a/haskell/Guestfs.hs +++ b/haskell/Guestfs.hs @@ -80,7 +80,8 @@ module Guestfs ( mv, ping_daemon, zerofree, - pvresize + pvresize, + resize2fs ) where import Foreign import Foreign.C @@ -814,3 +815,15 @@ pvresize h device = do fail err else return () +foreign import ccall unsafe "guestfs_resize2fs" c_resize2fs + :: GuestfsP -> CString -> IO (CInt) + +resize2fs :: GuestfsH -> String -> IO () +resize2fs h device = do + r <- withCString device $ \device -> withForeignPtr h (\p -> c_resize2fs p device) + if (r == -1) + then do + err <- last_error h + fail err + else return () + diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index a6d6f6d..2846a80 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -2914,4 +2914,41 @@ public class GuestFS { private native void _vg_activate (long g, boolean activate, String[] volgroups) throws LibGuestFSException; + /** + * resize an LVM logical volume + * + * This resizes (expands or shrinks) an existing LVM + * logical volume to "mbytes". When reducing, data in the + * reduced part is lost. + * + * @throws LibGuestFSException + */ + public void lvresize (String device, int mbytes) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("lvresize: handle is closed"); + _lvresize (g, device, mbytes); + } + private native void _lvresize (long g, String device, int mbytes) + throws LibGuestFSException; + + /** + * resize an ext2/ext3 filesystem + * + * This resizes an ext2 or ext3 filesystem to match the + * size of the underlying device. + * + * @throws LibGuestFSException + */ + public void resize2fs (String device) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("resize2fs: handle is closed"); + _resize2fs (g, device); + } + private native void _resize2fs (long g, String device) + throws LibGuestFSException; + } diff --git a/java/com_redhat_et_libguestfs_GuestFS.c b/java/com_redhat_et_libguestfs_GuestFS.c index 3bf5c7e..1850f21 100644 --- a/java/com_redhat_et_libguestfs_GuestFS.c +++ b/java/com_redhat_et_libguestfs_GuestFS.c @@ -2894,3 +2894,39 @@ Java_com_redhat_et_libguestfs_GuestFS__1vg_1activate } } +JNIEXPORT void JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1lvresize + (JNIEnv *env, jobject obj, jlong jg, jstring jdevice, jint jmbytes) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + int r; + const char *device; + int mbytes; + + device = (*env)->GetStringUTFChars (env, jdevice, NULL); + mbytes = jmbytes; + r = guestfs_lvresize (g, device, mbytes); + (*env)->ReleaseStringUTFChars (env, jdevice, device); + if (r == -1) { + throw_exception (env, guestfs_last_error (g)); + return ; + } +} + +JNIEXPORT void JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1resize2fs + (JNIEnv *env, jobject obj, jlong jg, jstring jdevice) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + int r; + const char *device; + + device = (*env)->GetStringUTFChars (env, jdevice, NULL); + r = guestfs_resize2fs (g, device); + (*env)->ReleaseStringUTFChars (env, jdevice, device); + if (r == -1) { + throw_exception (env, guestfs_last_error (g)); + return ; + } +} + diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml index fa60a7b..561b93c 100644 --- a/ocaml/guestfs.ml +++ b/ocaml/guestfs.ml @@ -243,3 +243,5 @@ external sfdisk_kernel_geometry : t -> string -> string = "ocaml_guestfs_sfdisk_ external sfdisk_disk_geometry : t -> string -> string = "ocaml_guestfs_sfdisk_disk_geometry" external vg_activate_all : t -> bool -> unit = "ocaml_guestfs_vg_activate_all" external vg_activate : t -> bool -> string array -> unit = "ocaml_guestfs_vg_activate" +external lvresize : t -> string -> int -> unit = "ocaml_guestfs_lvresize" +external resize2fs : t -> string -> unit = "ocaml_guestfs_resize2fs" diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli index 5ce9122..d9ce4af 100644 --- a/ocaml/guestfs.mli +++ b/ocaml/guestfs.mli @@ -508,3 +508,9 @@ val vg_activate_all : t -> bool -> unit val vg_activate : t -> bool -> string array -> unit (** activate or deactivate some volume groups *) +val lvresize : t -> string -> int -> unit +(** resize an LVM logical volume *) + +val resize2fs : t -> string -> unit +(** resize an ext2/ext3 filesystem *) + diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index f0aa7e2..c64bcf0 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -3379,3 +3379,50 @@ ocaml_guestfs_vg_activate (value gv, value activatev, value volgroupsv) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_lvresize (value gv, value devicev, value mbytesv) +{ + CAMLparam3 (gv, devicev, mbytesv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("lvresize: used handle after closing it"); + + const char *device = String_val (devicev); + int mbytes = Int_val (mbytesv); + int r; + + caml_enter_blocking_section (); + r = guestfs_lvresize (g, device, mbytes); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "lvresize"); + + rv = Val_unit; + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_resize2fs (value gv, value devicev) +{ + CAMLparam2 (gv, devicev); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("resize2fs: used handle after closing it"); + + const char *device = String_val (devicev); + int r; + + caml_enter_blocking_section (); + r = guestfs_resize2fs (g, device); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "resize2fs"); + + rv = Val_unit; + CAMLreturn (rv); +} + diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index 374a40d..5a6cf36 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -1894,3 +1894,26 @@ PREINIT: if (r == -1) croak ("vg_activate: %s", guestfs_last_error (g)); +void +lvresize (g, device, mbytes) + guestfs_h *g; + char *device; + int mbytes; +PREINIT: + int r; + PPCODE: + r = guestfs_lvresize (g, device, mbytes); + if (r == -1) + croak ("lvresize: %s", guestfs_last_error (g)); + +void +resize2fs (g, device) + guestfs_h *g; + char *device; +PREINIT: + int r; + PPCODE: + r = guestfs_resize2fs (g, device); + if (r == -1) + croak ("resize2fs: %s", guestfs_last_error (g)); + diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index 0e4dde4..62f3e7b 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -740,6 +740,12 @@ the path to the LV, such as C. You can also remove all LVs in a volume group by specifying the VG name, C. +=item $h->lvresize ($device, $mbytes); + +This resizes (expands or shrinks) an existing LVM logical +volume to C. When reducing, data in the reduced part +is lost. + =item @logvols = $h->lvs (); List all the logical volumes detected. This is the equivalent @@ -872,6 +878,11 @@ Note that this function cannot correctly handle binary files as end of line). For those you need to use the C<$h-Eread_file> function which has a more complex interface. +=item $h->resize2fs ($device); + +This resizes an ext2 or ext3 filesystem to match the size of +the underlying device. + =item $h->rm ($path); Remove the single file C. diff --git a/python/guestfs-py.c b/python/guestfs-py.c index e967bd9..cd1014f 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -3612,6 +3612,57 @@ py_guestfs_vg_activate (PyObject *self, PyObject *args) return py_r; } +static PyObject * +py_guestfs_lvresize (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + const char *device; + int mbytes; + + if (!PyArg_ParseTuple (args, (char *) "Osi:guestfs_lvresize", + &py_g, &device, &mbytes)) + return NULL; + g = get_handle (py_g); + + r = guestfs_lvresize (g, device, mbytes); + if (r == -1) { + PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g)); + return NULL; + } + + Py_INCREF (Py_None); + py_r = Py_None; + return py_r; +} + +static PyObject * +py_guestfs_resize2fs (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + const char *device; + + if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_resize2fs", + &py_g, &device)) + return NULL; + g = get_handle (py_g); + + r = guestfs_resize2fs (g, device); + if (r == -1) { + PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g)); + return NULL; + } + + Py_INCREF (Py_None); + py_r = Py_None; + return py_r; +} + static PyMethodDef methods[] = { { (char *) "create", py_guestfs_create, METH_VARARGS, NULL }, { (char *) "close", py_guestfs_close, METH_VARARGS, NULL }, @@ -3743,6 +3794,8 @@ static PyMethodDef methods[] = { { (char *) "sfdisk_disk_geometry", py_guestfs_sfdisk_disk_geometry, METH_VARARGS, NULL }, { (char *) "vg_activate_all", py_guestfs_vg_activate_all, METH_VARARGS, NULL }, { (char *) "vg_activate", py_guestfs_vg_activate, METH_VARARGS, NULL }, + { (char *) "lvresize", py_guestfs_lvresize, METH_VARARGS, NULL }, + { (char *) "resize2fs", py_guestfs_resize2fs, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; diff --git a/python/guestfs.py b/python/guestfs.py index 4a2804b..77c2989 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -1423,3 +1423,16 @@ class GuestFS: """ return libguestfsmod.vg_activate (self._o, activate, volgroups) + def lvresize (self, device, mbytes): + u"""This resizes (expands or shrinks) an existing LVM + logical volume to "mbytes". When reducing, data in the + reduced part is lost. + """ + return libguestfsmod.lvresize (self._o, device, mbytes) + + def resize2fs (self, device): + u"""This resizes an ext2 or ext3 filesystem to match the + size of the underlying device. + """ + return libguestfsmod.resize2fs (self._o, device) + diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c index c57dcb3..d7a4aa3 100644 --- a/ruby/ext/guestfs/_guestfs.c +++ b/ruby/ext/guestfs/_guestfs.c @@ -3072,6 +3072,49 @@ static VALUE ruby_guestfs_vg_activate (VALUE gv, VALUE activatev, VALUE volgroup return Qnil; } +static VALUE ruby_guestfs_lvresize (VALUE gv, VALUE devicev, VALUE mbytesv) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "lvresize"); + + const char *device = StringValueCStr (devicev); + if (!device) + rb_raise (rb_eTypeError, "expected string for parameter %s of %s", + "device", "lvresize"); + int mbytes = NUM2INT (mbytesv); + + int r; + + r = guestfs_lvresize (g, device, mbytes); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return Qnil; +} + +static VALUE ruby_guestfs_resize2fs (VALUE gv, VALUE devicev) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "resize2fs"); + + const char *device = StringValueCStr (devicev); + if (!device) + rb_raise (rb_eTypeError, "expected string for parameter %s of %s", + "device", "resize2fs"); + + int r; + + r = guestfs_resize2fs (g, device); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return Qnil; +} + /* Initialize the module. */ void Init__guestfs () { @@ -3338,4 +3381,8 @@ void Init__guestfs () ruby_guestfs_vg_activate_all, 1); rb_define_method (c_guestfs, "vg_activate", ruby_guestfs_vg_activate, 2); + rb_define_method (c_guestfs, "lvresize", + ruby_guestfs_lvresize, 2); + rb_define_method (c_guestfs, "resize2fs", + ruby_guestfs_resize2fs, 1); } diff --git a/src/guestfs-actions.c b/src/guestfs-actions.c index 41d873f..f7f0fb9 100644 --- a/src/guestfs-actions.c +++ b/src/guestfs-actions.c @@ -9533,3 +9533,179 @@ int guestfs_vg_activate (guestfs_h *g, return 0; } +struct lvresize_ctx { + /* This flag is set by the callbacks, so we know we've done + * the callbacks as expected, and in the right sequence. + * 0 = not called, 1 = reply_cb called. + */ + int cb_sequence; + struct guestfs_message_header hdr; + struct guestfs_message_error err; +}; + +static void lvresize_reply_cb (guestfs_h *g, void *data, XDR *xdr) +{ + guestfs_main_loop *ml = guestfs_get_main_loop (g); + struct lvresize_ctx *ctx = (struct lvresize_ctx *) data; + + /* This should definitely not happen. */ + if (ctx->cb_sequence != 0) { + ctx->cb_sequence = 9999; + error (g, "%s: internal error: reply callback called twice", "guestfs_lvresize"); + return; + } + + ml->main_loop_quit (ml, g); + + if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) { + error (g, "%s: failed to parse reply header", "guestfs_lvresize"); + return; + } + if (ctx->hdr.status == GUESTFS_STATUS_ERROR) { + if (!xdr_guestfs_message_error (xdr, &ctx->err)) { + error (g, "%s: failed to parse reply error", "guestfs_lvresize"); + return; + } + goto done; + } + done: + ctx->cb_sequence = 1; +} + +int guestfs_lvresize (guestfs_h *g, + const char *device, + int mbytes) +{ + struct guestfs_lvresize_args args; + struct lvresize_ctx ctx; + guestfs_main_loop *ml = guestfs_get_main_loop (g); + int serial; + + if (check_state (g, "guestfs_lvresize") == -1) return -1; + guestfs_set_busy (g); + + memset (&ctx, 0, sizeof ctx); + + args.device = (char *) device; + args.mbytes = mbytes; + serial = guestfs__send_sync (g, GUESTFS_PROC_LVRESIZE, + (xdrproc_t) xdr_guestfs_lvresize_args, (char *) &args); + if (serial == -1) { + guestfs_end_busy (g); + return -1; + } + + guestfs__switch_to_receiving (g); + ctx.cb_sequence = 0; + guestfs_set_reply_callback (g, lvresize_reply_cb, &ctx); + (void) ml->main_loop_run (ml, g); + guestfs_set_reply_callback (g, NULL, NULL); + if (ctx.cb_sequence != 1) { + error (g, "%s reply failed, see earlier error messages", "guestfs_lvresize"); + guestfs_end_busy (g); + return -1; + } + + if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LVRESIZE, serial) == -1) { + guestfs_end_busy (g); + return -1; + } + + if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { + error (g, "%s", ctx.err.error_message); + free (ctx.err.error_message); + guestfs_end_busy (g); + return -1; + } + + guestfs_end_busy (g); + return 0; +} + +struct resize2fs_ctx { + /* This flag is set by the callbacks, so we know we've done + * the callbacks as expected, and in the right sequence. + * 0 = not called, 1 = reply_cb called. + */ + int cb_sequence; + struct guestfs_message_header hdr; + struct guestfs_message_error err; +}; + +static void resize2fs_reply_cb (guestfs_h *g, void *data, XDR *xdr) +{ + guestfs_main_loop *ml = guestfs_get_main_loop (g); + struct resize2fs_ctx *ctx = (struct resize2fs_ctx *) data; + + /* This should definitely not happen. */ + if (ctx->cb_sequence != 0) { + ctx->cb_sequence = 9999; + error (g, "%s: internal error: reply callback called twice", "guestfs_resize2fs"); + return; + } + + ml->main_loop_quit (ml, g); + + if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) { + error (g, "%s: failed to parse reply header", "guestfs_resize2fs"); + return; + } + if (ctx->hdr.status == GUESTFS_STATUS_ERROR) { + if (!xdr_guestfs_message_error (xdr, &ctx->err)) { + error (g, "%s: failed to parse reply error", "guestfs_resize2fs"); + return; + } + goto done; + } + done: + ctx->cb_sequence = 1; +} + +int guestfs_resize2fs (guestfs_h *g, + const char *device) +{ + struct guestfs_resize2fs_args args; + struct resize2fs_ctx ctx; + guestfs_main_loop *ml = guestfs_get_main_loop (g); + int serial; + + if (check_state (g, "guestfs_resize2fs") == -1) return -1; + guestfs_set_busy (g); + + memset (&ctx, 0, sizeof ctx); + + args.device = (char *) device; + serial = guestfs__send_sync (g, GUESTFS_PROC_RESIZE2FS, + (xdrproc_t) xdr_guestfs_resize2fs_args, (char *) &args); + if (serial == -1) { + guestfs_end_busy (g); + return -1; + } + + guestfs__switch_to_receiving (g); + ctx.cb_sequence = 0; + guestfs_set_reply_callback (g, resize2fs_reply_cb, &ctx); + (void) ml->main_loop_run (ml, g); + guestfs_set_reply_callback (g, NULL, NULL); + if (ctx.cb_sequence != 1) { + error (g, "%s reply failed, see earlier error messages", "guestfs_resize2fs"); + guestfs_end_busy (g); + return -1; + } + + if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_RESIZE2FS, serial) == -1) { + guestfs_end_busy (g); + return -1; + } + + if (ctx.hdr.status == GUESTFS_STATUS_ERROR) { + error (g, "%s", ctx.err.error_message); + free (ctx.err.error_message); + guestfs_end_busy (g); + return -1; + } + + guestfs_end_busy (g); + return 0; +} + diff --git a/src/guestfs-actions.h b/src/guestfs-actions.h index 3c760f2..0e9be17 100644 --- a/src/guestfs-actions.h +++ b/src/guestfs-actions.h @@ -147,3 +147,5 @@ extern char *guestfs_sfdisk_kernel_geometry (guestfs_h *handle, const char *devi extern char *guestfs_sfdisk_disk_geometry (guestfs_h *handle, const char *device); extern int guestfs_vg_activate_all (guestfs_h *handle, int activate); extern int guestfs_vg_activate (guestfs_h *handle, int activate, char * const* const volgroups); +extern int guestfs_lvresize (guestfs_h *handle, const char *device, int mbytes); +extern int guestfs_resize2fs (guestfs_h *handle, const char *device); diff --git a/src/guestfs_protocol.c b/src/guestfs_protocol.c index 0a3fddc..c352cb4 100644 --- a/src/guestfs_protocol.c +++ b/src/guestfs_protocol.c @@ -1786,6 +1786,28 @@ xdr_guestfs_vg_activate_args (XDR *xdrs, guestfs_vg_activate_args *objp) } bool_t +xdr_guestfs_lvresize_args (XDR *xdrs, guestfs_lvresize_args *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, &objp->device, ~0)) + return FALSE; + if (!xdr_int (xdrs, &objp->mbytes)) + return FALSE; + return TRUE; +} + +bool_t +xdr_guestfs_resize2fs_args (XDR *xdrs, guestfs_resize2fs_args *objp) +{ + register int32_t *buf; + + if (!xdr_string (xdrs, &objp->device, ~0)) + return FALSE; + return TRUE; +} + +bool_t xdr_guestfs_procedure (XDR *xdrs, guestfs_procedure *objp) { register int32_t *buf; diff --git a/src/guestfs_protocol.h b/src/guestfs_protocol.h index 25ed352..a34395a 100644 --- a/src/guestfs_protocol.h +++ b/src/guestfs_protocol.h @@ -901,6 +901,17 @@ struct guestfs_vg_activate_args { }; typedef struct guestfs_vg_activate_args guestfs_vg_activate_args; +struct guestfs_lvresize_args { + char *device; + int mbytes; +}; +typedef struct guestfs_lvresize_args guestfs_lvresize_args; + +struct guestfs_resize2fs_args { + char *device; +}; +typedef struct guestfs_resize2fs_args guestfs_resize2fs_args; + enum guestfs_procedure { GUESTFS_PROC_MOUNT = 1, GUESTFS_PROC_SYNC = 2, @@ -1006,7 +1017,9 @@ enum guestfs_procedure { GUESTFS_PROC_SFDISK_DISK_GEOMETRY = 102, GUESTFS_PROC_VG_ACTIVATE_ALL = 103, GUESTFS_PROC_VG_ACTIVATE = 104, - GUESTFS_PROC_NR_PROCS = 104 + 1, + GUESTFS_PROC_LVRESIZE = 105, + GUESTFS_PROC_RESIZE2FS = 106, + GUESTFS_PROC_NR_PROCS = 106 + 1, }; typedef enum guestfs_procedure guestfs_procedure; #define GUESTFS_MESSAGE_MAX 4194304 @@ -1199,6 +1212,8 @@ extern bool_t xdr_guestfs_sfdisk_disk_geometry_args (XDR *, guestfs_sfdisk_disk extern bool_t xdr_guestfs_sfdisk_disk_geometry_ret (XDR *, guestfs_sfdisk_disk_geometry_ret*); extern bool_t xdr_guestfs_vg_activate_all_args (XDR *, guestfs_vg_activate_all_args*); extern bool_t xdr_guestfs_vg_activate_args (XDR *, guestfs_vg_activate_args*); +extern bool_t xdr_guestfs_lvresize_args (XDR *, guestfs_lvresize_args*); +extern bool_t xdr_guestfs_resize2fs_args (XDR *, guestfs_resize2fs_args*); extern bool_t xdr_guestfs_procedure (XDR *, guestfs_procedure*); extern bool_t xdr_guestfs_message_direction (XDR *, guestfs_message_direction*); extern bool_t xdr_guestfs_message_status (XDR *, guestfs_message_status*); @@ -1350,6 +1365,8 @@ extern bool_t xdr_guestfs_sfdisk_disk_geometry_args (); extern bool_t xdr_guestfs_sfdisk_disk_geometry_ret (); extern bool_t xdr_guestfs_vg_activate_all_args (); extern bool_t xdr_guestfs_vg_activate_args (); +extern bool_t xdr_guestfs_lvresize_args (); +extern bool_t xdr_guestfs_resize2fs_args (); extern bool_t xdr_guestfs_procedure (); extern bool_t xdr_guestfs_message_direction (); extern bool_t xdr_guestfs_message_status (); diff --git a/src/guestfs_protocol.x b/src/guestfs_protocol.x index 38bb8ea..6090810 100644 --- a/src/guestfs_protocol.x +++ b/src/guestfs_protocol.x @@ -698,6 +698,15 @@ struct guestfs_vg_activate_args { str volgroups<>; }; +struct guestfs_lvresize_args { + string device<>; + int mbytes; +}; + +struct guestfs_resize2fs_args { + string device<>; +}; + enum guestfs_procedure { GUESTFS_PROC_MOUNT = 1, GUESTFS_PROC_SYNC = 2, @@ -803,6 +812,8 @@ enum guestfs_procedure { GUESTFS_PROC_SFDISK_DISK_GEOMETRY = 102, GUESTFS_PROC_VG_ACTIVATE_ALL = 103, GUESTFS_PROC_VG_ACTIVATE = 104, + GUESTFS_PROC_LVRESIZE = 105, + GUESTFS_PROC_RESIZE2FS = 106, GUESTFS_PROC_NR_PROCS }; diff --git a/tests.c b/tests.c index b344320..f551e98 100644 --- a/tests.c +++ b/tests.c @@ -123,10 +123,185 @@ static void no_test_warnings (void) fprintf (stderr, "warning: \"guestfs_sfdisk_disk_geometry\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_vg_activate_all\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_vg_activate\" has no tests\n"); + fprintf (stderr, "warning: \"guestfs_resize2fs\" has no tests\n"); +} + +static int test_lvresize_0 (void) +{ + /* InitNone|InitEmpty for test_lvresize_0 */ + { + char device[] = "/dev/sda"; + device[5] = devchar; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } + /* TestOutput for lvresize (0) */ + char expected[] = "test content"; + { + char device[] = "/dev/sda"; + device[5] = devchar; + char lines_0[] = ","; + char *lines[] = { + lines_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_sfdisk (g, device, 0, 0, 0, lines); + if (r == -1) + return -1; + } + { + char device[] = "/dev/sda1"; + device[5] = devchar; + int r; + suppress_error = 0; + r = guestfs_pvcreate (g, device); + if (r == -1) + return -1; + } + { + char volgroup[] = "VG"; + char physvols_0[] = "/dev/sda1"; + physvols_0[5] = devchar; + char *physvols[] = { + physvols_0, + NULL + }; + int r; + suppress_error = 0; + r = guestfs_vgcreate (g, volgroup, physvols); + if (r == -1) + return -1; + } + { + char logvol[] = "LV"; + char volgroup[] = "VG"; + int r; + suppress_error = 0; + r = guestfs_lvcreate (g, logvol, volgroup, 10); + if (r == -1) + return -1; + } + { + char fstype[] = "ext2"; + char device[] = "/dev/VG/LV"; + int r; + suppress_error = 0; + r = guestfs_mkfs (g, fstype, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/VG/LV"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/new"; + char content[] = "test content"; + int r; + suppress_error = 0; + r = guestfs_write_file (g, path, content, 0); + if (r == -1) + return -1; + } + { + char pathordevice[] = "/"; + int r; + suppress_error = 0; + r = guestfs_umount (g, pathordevice); + if (r == -1) + return -1; + } + { + char device[] = "/dev/VG/LV"; + int r; + suppress_error = 0; + r = guestfs_lvresize (g, device, 20); + if (r == -1) + return -1; + } + { + char device[] = "/dev/VG/LV"; + int r; + suppress_error = 0; + r = guestfs_resize2fs (g, device); + if (r == -1) + return -1; + } + { + char device[] = "/dev/VG/LV"; + char mountpoint[] = "/"; + int r; + suppress_error = 0; + r = guestfs_mount (g, device, mountpoint); + if (r == -1) + return -1; + } + { + char path[] = "/new"; + char *r; + suppress_error = 0; + r = guestfs_cat (g, path); + if (r == NULL) + return -1; + if (strcmp (r, expected) != 0) { + fprintf (stderr, "test_lvresize_0: expected \"%s\" but got \"%s\"\n", expected, r); + return -1; + } + free (r); + } + return 0; } static int test_zerofree_0 (void) { + /* InitNone|InitEmpty for test_zerofree_0 */ + { + char device[] = "/dev/sda"; + device[5] = devchar; + int r; + suppress_error = 0; + r = guestfs_blockdev_setrw (g, device); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_umount_all (g); + if (r == -1) + return -1; + } + { + int r; + suppress_error = 0; + r = guestfs_lvm_remove_all (g); + if (r == -1) + return -1; + } /* TestOutput for zerofree (0) */ char expected[] = "test file"; { @@ -218,7 +393,7 @@ static int test_zerofree_0 (void) static int test_hexdump_0 (void) { - /* InitBasicFS for hexdump (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_hexdump_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -305,7 +480,7 @@ static int test_hexdump_0 (void) static int test_strings_e_0 (void) { - /* InitBasicFS for strings_e (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_strings_e_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -402,7 +577,7 @@ static int test_strings_e_1 (void) static int test_strings_0 (void) { - /* InitBasicFS for strings (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_strings_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -516,7 +691,7 @@ static int test_strings_0 (void) static int test_strings_1 (void) { - /* InitBasicFS for strings (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_strings_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -605,7 +780,7 @@ static int test_strings_1 (void) static int test_equal_0 (void) { - /* InitBasicFS for equal (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_equal_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -700,7 +875,7 @@ static int test_equal_0 (void) static int test_equal_1 (void) { - /* InitBasicFS for equal (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_equal_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -795,7 +970,7 @@ static int test_equal_1 (void) static int test_equal_2 (void) { - /* InitBasicFS for equal (2): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_equal_2: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -868,7 +1043,7 @@ static int test_equal_2 (void) static int test_ping_daemon_0 (void) { - /* InitEmpty for ping_daemon (0) */ + /* InitNone|InitEmpty for test_ping_daemon_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -905,7 +1080,7 @@ static int test_ping_daemon_0 (void) static int test_dmesg_0 (void) { - /* InitEmpty for dmesg (0) */ + /* InitNone|InitEmpty for test_dmesg_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -943,7 +1118,7 @@ static int test_dmesg_0 (void) static int test_drop_caches_0 (void) { - /* InitEmpty for drop_caches (0) */ + /* InitNone|InitEmpty for test_drop_caches_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -980,7 +1155,7 @@ static int test_drop_caches_0 (void) static int test_mv_0 (void) { - /* InitBasicFS for mv (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_mv_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -1076,7 +1251,7 @@ static int test_mv_0 (void) static int test_mv_1 (void) { - /* InitBasicFS for mv (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_mv_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -1170,7 +1345,7 @@ static int test_mv_1 (void) static int test_cp_a_0 (void) { - /* InitBasicFS for cp_a (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_cp_a_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -1282,7 +1457,7 @@ static int test_cp_a_0 (void) static int test_cp_0 (void) { - /* InitBasicFS for cp (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_cp_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -1378,7 +1553,7 @@ static int test_cp_0 (void) static int test_cp_1 (void) { - /* InitBasicFS for cp (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_cp_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -1472,7 +1647,7 @@ static int test_cp_1 (void) static int test_cp_2 (void) { - /* InitBasicFS for cp (2): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_cp_2: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -1576,7 +1751,7 @@ static int test_cp_2 (void) static int test_grub_install_0 (void) { - /* InitBasicFS for grub_install (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_grub_install_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -1662,7 +1837,7 @@ static int test_grub_install_0 (void) static int test_zero_0 (void) { - /* InitBasicFS for zero (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_zero_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -1759,7 +1934,7 @@ static int test_zero_0 (void) static int test_fsck_0 (void) { - /* InitBasicFS for fsck (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_fsck_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -1846,7 +2021,7 @@ static int test_fsck_0 (void) static int test_fsck_1 (void) { - /* InitBasicFS for fsck (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_fsck_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -1942,7 +2117,7 @@ static int test_fsck_1 (void) static int test_set_e2uuid_0 (void) { - /* InitBasicFS for set_e2uuid (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_set_e2uuid_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -2031,7 +2206,7 @@ static int test_set_e2uuid_0 (void) static int test_set_e2uuid_1 (void) { - /* InitBasicFS for set_e2uuid (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_set_e2uuid_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -2120,7 +2295,7 @@ static int test_set_e2uuid_1 (void) static int test_set_e2uuid_2 (void) { - /* InitBasicFS for set_e2uuid (2): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_set_e2uuid_2: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -2194,7 +2369,7 @@ static int test_set_e2uuid_2 (void) static int test_set_e2uuid_3 (void) { - /* InitBasicFS for set_e2uuid (3): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_set_e2uuid_3: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -2268,7 +2443,7 @@ static int test_set_e2uuid_3 (void) static int test_set_e2label_0 (void) { - /* InitBasicFS for set_e2label (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_set_e2label_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -2357,7 +2532,7 @@ static int test_set_e2label_0 (void) static int test_pvremove_0 (void) { - /* InitEmpty for pvremove (0) */ + /* InitNone|InitEmpty for test_pvremove_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -2461,7 +2636,7 @@ static int test_pvremove_0 (void) static int test_pvremove_1 (void) { - /* InitEmpty for pvremove (1) */ + /* InitNone|InitEmpty for test_pvremove_1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -2565,7 +2740,7 @@ static int test_pvremove_1 (void) static int test_pvremove_2 (void) { - /* InitEmpty for pvremove (2) */ + /* InitNone|InitEmpty for test_pvremove_2 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -2669,7 +2844,7 @@ static int test_pvremove_2 (void) static int test_vgremove_0 (void) { - /* InitEmpty for vgremove (0) */ + /* InitNone|InitEmpty for test_vgremove_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -2764,7 +2939,7 @@ static int test_vgremove_0 (void) static int test_vgremove_1 (void) { - /* InitEmpty for vgremove (1) */ + /* InitNone|InitEmpty for test_vgremove_1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -2859,7 +3034,7 @@ static int test_vgremove_1 (void) static int test_lvremove_0 (void) { - /* InitEmpty for lvremove (0) */ + /* InitNone|InitEmpty for test_lvremove_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -2966,7 +3141,7 @@ static int test_lvremove_0 (void) static int test_lvremove_1 (void) { - /* InitEmpty for lvremove (1) */ + /* InitNone|InitEmpty for test_lvremove_1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -3061,7 +3236,7 @@ static int test_lvremove_1 (void) static int test_lvremove_2 (void) { - /* InitEmpty for lvremove (2) */ + /* InitNone|InitEmpty for test_lvremove_2 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -3168,7 +3343,7 @@ static int test_lvremove_2 (void) static int test_mount_ro_0 (void) { - /* InitBasicFS for mount_ro (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_mount_ro_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -3258,7 +3433,7 @@ static int test_mount_ro_0 (void) static int test_mount_ro_1 (void) { - /* InitBasicFS for mount_ro (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_mount_ro_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -3363,7 +3538,7 @@ static int test_mount_ro_1 (void) static int test_tgz_in_0 (void) { - /* InitBasicFS for tgz_in (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_tgz_in_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -3449,7 +3624,7 @@ static int test_tgz_in_0 (void) static int test_tar_in_0 (void) { - /* InitBasicFS for tar_in (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_tar_in_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -3535,7 +3710,7 @@ static int test_tar_in_0 (void) static int test_checksum_0 (void) { - /* InitBasicFS for checksum (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_checksum_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -3623,7 +3798,7 @@ static int test_checksum_0 (void) static int test_checksum_1 (void) { - /* InitBasicFS for checksum (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_checksum_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -3697,7 +3872,7 @@ static int test_checksum_1 (void) static int test_checksum_2 (void) { - /* InitBasicFS for checksum (2): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_checksum_2: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -3785,7 +3960,7 @@ static int test_checksum_2 (void) static int test_checksum_3 (void) { - /* InitBasicFS for checksum (3): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_checksum_3: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -3873,7 +4048,7 @@ static int test_checksum_3 (void) static int test_checksum_4 (void) { - /* InitBasicFS for checksum (4): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_checksum_4: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -3961,7 +4136,7 @@ static int test_checksum_4 (void) static int test_checksum_5 (void) { - /* InitBasicFS for checksum (5): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_checksum_5: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4049,7 +4224,7 @@ static int test_checksum_5 (void) static int test_checksum_6 (void) { - /* InitBasicFS for checksum (6): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_checksum_6: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4137,7 +4312,7 @@ static int test_checksum_6 (void) static int test_checksum_7 (void) { - /* InitBasicFS for checksum (7): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_checksum_7: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4225,7 +4400,7 @@ static int test_checksum_7 (void) static int test_download_0 (void) { - /* InitBasicFS for download (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_download_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4328,7 +4503,7 @@ static int test_download_0 (void) static int test_upload_0 (void) { - /* InitBasicFS for upload (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_upload_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4415,7 +4590,7 @@ static int test_upload_0 (void) static int test_blockdev_rereadpt_0 (void) { - /* InitEmpty for blockdev_rereadpt (0) */ + /* InitNone|InitEmpty for test_blockdev_rereadpt_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4454,7 +4629,7 @@ static int test_blockdev_rereadpt_0 (void) static int test_blockdev_flushbufs_0 (void) { - /* InitEmpty for blockdev_flushbufs (0) */ + /* InitNone|InitEmpty for test_blockdev_flushbufs_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4493,7 +4668,7 @@ static int test_blockdev_flushbufs_0 (void) static int test_blockdev_getsize64_0 (void) { - /* InitEmpty for blockdev_getsize64 (0) */ + /* InitNone|InitEmpty for test_blockdev_getsize64_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4536,7 +4711,7 @@ static int test_blockdev_getsize64_0 (void) static int test_blockdev_getsz_0 (void) { - /* InitEmpty for blockdev_getsz (0) */ + /* InitNone|InitEmpty for test_blockdev_getsz_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4579,7 +4754,7 @@ static int test_blockdev_getsz_0 (void) static int test_blockdev_getbsz_0 (void) { - /* InitEmpty for blockdev_getbsz (0) */ + /* InitNone|InitEmpty for test_blockdev_getbsz_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4622,7 +4797,7 @@ static int test_blockdev_getbsz_0 (void) static int test_blockdev_getss_0 (void) { - /* InitEmpty for blockdev_getss (0) */ + /* InitNone|InitEmpty for test_blockdev_getss_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4665,7 +4840,7 @@ static int test_blockdev_getss_0 (void) static int test_blockdev_getro_0 (void) { - /* InitEmpty for blockdev_getro (0) */ + /* InitNone|InitEmpty for test_blockdev_getro_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4717,7 +4892,7 @@ static int test_blockdev_getro_0 (void) static int test_blockdev_setrw_0 (void) { - /* InitEmpty for blockdev_setrw (0) */ + /* InitNone|InitEmpty for test_blockdev_setrw_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4769,7 +4944,7 @@ static int test_blockdev_setrw_0 (void) static int test_blockdev_setro_0 (void) { - /* InitEmpty for blockdev_setro (0) */ + /* InitNone|InitEmpty for test_blockdev_setro_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4821,7 +4996,7 @@ static int test_blockdev_setro_0 (void) static int test_statvfs_0 (void) { - /* InitBasicFS for statvfs (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_statvfs_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4909,7 +5084,7 @@ static int test_statvfs_0 (void) static int test_lstat_0 (void) { - /* InitBasicFS for lstat (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_lstat_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -4995,7 +5170,7 @@ static int test_lstat_0 (void) static int test_stat_0 (void) { - /* InitBasicFS for stat (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_stat_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -5088,7 +5263,7 @@ static int test_command_lines_0_prereq (void) static int test_command_lines_0 (void) { if (! test_command_lines_0_prereq ()) { - /* InitBasicFS for command_lines (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_lines_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -5212,7 +5387,7 @@ static int test_command_lines_1_prereq (void) static int test_command_lines_1 (void) { if (! test_command_lines_1_prereq ()) { - /* InitBasicFS for command_lines (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_lines_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -5336,7 +5511,7 @@ static int test_command_lines_2_prereq (void) static int test_command_lines_2 (void) { if (! test_command_lines_2_prereq ()) { - /* InitBasicFS for command_lines (2): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_lines_2: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -5472,7 +5647,7 @@ static int test_command_lines_3_prereq (void) static int test_command_lines_3 (void) { if (! test_command_lines_3_prereq ()) { - /* InitBasicFS for command_lines (3): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_lines_3: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -5608,7 +5783,7 @@ static int test_command_lines_4_prereq (void) static int test_command_lines_4 (void) { if (! test_command_lines_4_prereq ()) { - /* InitBasicFS for command_lines (4): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_lines_4: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -5756,7 +5931,7 @@ static int test_command_lines_5_prereq (void) static int test_command_lines_5 (void) { if (! test_command_lines_5_prereq ()) { - /* InitBasicFS for command_lines (5): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_lines_5: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -5916,7 +6091,7 @@ static int test_command_lines_6_prereq (void) static int test_command_lines_6 (void) { if (! test_command_lines_6_prereq ()) { - /* InitBasicFS for command_lines (6): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_lines_6: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -6028,7 +6203,7 @@ static int test_command_lines_7_prereq (void) static int test_command_lines_7 (void) { if (! test_command_lines_7_prereq ()) { - /* InitBasicFS for command_lines (7): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_lines_7: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -6152,7 +6327,7 @@ static int test_command_lines_8_prereq (void) static int test_command_lines_8 (void) { if (! test_command_lines_8_prereq ()) { - /* InitBasicFS for command_lines (8): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_lines_8: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -6288,7 +6463,7 @@ static int test_command_lines_9_prereq (void) static int test_command_lines_9 (void) { if (! test_command_lines_9_prereq ()) { - /* InitBasicFS for command_lines (9): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_lines_9: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -6424,7 +6599,7 @@ static int test_command_lines_10_prereq (void) static int test_command_lines_10 (void) { if (! test_command_lines_10_prereq ()) { - /* InitBasicFS for command_lines (10): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_lines_10: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -6560,7 +6735,7 @@ static int test_command_0_prereq (void) static int test_command_0 (void) { if (! test_command_0_prereq ()) { - /* InitBasicFS for command (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -6669,7 +6844,7 @@ static int test_command_1_prereq (void) static int test_command_1 (void) { if (! test_command_1_prereq ()) { - /* InitBasicFS for command (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -6778,7 +6953,7 @@ static int test_command_2_prereq (void) static int test_command_2 (void) { if (! test_command_2_prereq ()) { - /* InitBasicFS for command (2): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_2: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -6887,7 +7062,7 @@ static int test_command_3_prereq (void) static int test_command_3 (void) { if (! test_command_3_prereq ()) { - /* InitBasicFS for command (3): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_3: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -6996,7 +7171,7 @@ static int test_command_4_prereq (void) static int test_command_4 (void) { if (! test_command_4_prereq ()) { - /* InitBasicFS for command (4): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_4: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -7105,7 +7280,7 @@ static int test_command_5_prereq (void) static int test_command_5 (void) { if (! test_command_5_prereq ()) { - /* InitBasicFS for command (5): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_5: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -7214,7 +7389,7 @@ static int test_command_6_prereq (void) static int test_command_6 (void) { if (! test_command_6_prereq ()) { - /* InitBasicFS for command (6): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_6: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -7323,7 +7498,7 @@ static int test_command_7_prereq (void) static int test_command_7 (void) { if (! test_command_7_prereq ()) { - /* InitBasicFS for command (7): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_7: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -7432,7 +7607,7 @@ static int test_command_8_prereq (void) static int test_command_8 (void) { if (! test_command_8_prereq ()) { - /* InitBasicFS for command (8): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_8: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -7541,7 +7716,7 @@ static int test_command_9_prereq (void) static int test_command_9 (void) { if (! test_command_9_prereq ()) { - /* InitBasicFS for command (9): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_9: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -7650,7 +7825,7 @@ static int test_command_10_prereq (void) static int test_command_10 (void) { if (! test_command_10_prereq ()) { - /* InitBasicFS for command (10): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_10: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -7759,7 +7934,7 @@ static int test_command_11_prereq (void) static int test_command_11 (void) { if (! test_command_11_prereq ()) { - /* InitBasicFS for command (11): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_command_11: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -7854,7 +8029,7 @@ static int test_command_11 (void) static int test_file_0 (void) { - /* InitBasicFS for file (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_file_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -7940,7 +8115,7 @@ static int test_file_0 (void) static int test_file_1 (void) { - /* InitBasicFS for file (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_file_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -8027,7 +8202,7 @@ static int test_file_1 (void) static int test_file_2 (void) { - /* InitBasicFS for file (2): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_file_2: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -8100,7 +8275,7 @@ static int test_file_2 (void) static int test_umount_all_0 (void) { - /* InitBasicFS for umount_all (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_umount_all_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -8187,7 +8362,7 @@ static int test_umount_all_0 (void) static int test_umount_all_1 (void) { - /* InitEmpty for umount_all (1) */ + /* InitNone|InitEmpty for test_umount_all_1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -8342,7 +8517,7 @@ static int test_umount_all_1 (void) static int test_mounts_0 (void) { - /* InitBasicFS for mounts (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_mounts_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -8435,7 +8610,7 @@ static int test_mounts_0 (void) static int test_umount_0 (void) { - /* InitEmpty for umount (0) */ + /* InitNone|InitEmpty for test_umount_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -8528,7 +8703,7 @@ static int test_umount_0 (void) static int test_umount_1 (void) { - /* InitEmpty for umount (1) */ + /* InitNone|InitEmpty for test_umount_1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -8616,7 +8791,7 @@ static int test_umount_1 (void) static int test_write_file_0 (void) { - /* InitBasicFS for write_file (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_write_file_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -8703,7 +8878,7 @@ static int test_write_file_0 (void) static int test_write_file_1 (void) { - /* InitBasicFS for write_file (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_write_file_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -8790,7 +8965,7 @@ static int test_write_file_1 (void) static int test_write_file_2 (void) { - /* InitBasicFS for write_file (2): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_write_file_2: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -8877,7 +9052,7 @@ static int test_write_file_2 (void) static int test_write_file_3 (void) { - /* InitBasicFS for write_file (3): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_write_file_3: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -8964,7 +9139,7 @@ static int test_write_file_3 (void) static int test_write_file_4 (void) { - /* InitBasicFS for write_file (4): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_write_file_4: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -9051,7 +9226,7 @@ static int test_write_file_4 (void) static int test_write_file_5 (void) { - /* InitBasicFS for write_file (5): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_write_file_5: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -9138,7 +9313,7 @@ static int test_write_file_5 (void) static int test_mkfs_0 (void) { - /* InitEmpty for mkfs (0) */ + /* InitNone|InitEmpty for test_mkfs_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -9225,7 +9400,7 @@ static int test_mkfs_0 (void) static int test_lvcreate_0 (void) { - /* InitEmpty for lvcreate (0) */ + /* InitNone|InitEmpty for test_lvcreate_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -9452,7 +9627,7 @@ static int test_lvcreate_0 (void) static int test_vgcreate_0 (void) { - /* InitEmpty for vgcreate (0) */ + /* InitNone|InitEmpty for test_vgcreate_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -9598,7 +9773,7 @@ static int test_vgcreate_0 (void) static int test_pvcreate_0 (void) { - /* InitEmpty for pvcreate (0) */ + /* InitNone|InitEmpty for test_pvcreate_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -9728,7 +9903,7 @@ static int test_pvcreate_0 (void) static int test_is_dir_0 (void) { - /* InitBasicFS for is_dir (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_is_dir_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -9812,7 +9987,7 @@ static int test_is_dir_0 (void) static int test_is_dir_1 (void) { - /* InitBasicFS for is_dir (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_is_dir_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -9896,7 +10071,7 @@ static int test_is_dir_1 (void) static int test_is_file_0 (void) { - /* InitBasicFS for is_file (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_is_file_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -9980,7 +10155,7 @@ static int test_is_file_0 (void) static int test_is_file_1 (void) { - /* InitBasicFS for is_file (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_is_file_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10064,7 +10239,7 @@ static int test_is_file_1 (void) static int test_exists_0 (void) { - /* InitBasicFS for exists (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_exists_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10148,7 +10323,7 @@ static int test_exists_0 (void) static int test_exists_1 (void) { - /* InitBasicFS for exists (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_exists_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10232,7 +10407,7 @@ static int test_exists_1 (void) static int test_mkdir_p_0 (void) { - /* InitBasicFS for mkdir_p (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_mkdir_p_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10316,7 +10491,7 @@ static int test_mkdir_p_0 (void) static int test_mkdir_p_1 (void) { - /* InitBasicFS for mkdir_p (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_mkdir_p_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10400,7 +10575,7 @@ static int test_mkdir_p_1 (void) static int test_mkdir_p_2 (void) { - /* InitBasicFS for mkdir_p (2): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_mkdir_p_2: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10484,7 +10659,7 @@ static int test_mkdir_p_2 (void) static int test_mkdir_0 (void) { - /* InitBasicFS for mkdir (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_mkdir_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10568,7 +10743,7 @@ static int test_mkdir_0 (void) static int test_mkdir_1 (void) { - /* InitBasicFS for mkdir (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_mkdir_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10640,7 +10815,7 @@ static int test_mkdir_1 (void) static int test_rm_rf_0 (void) { - /* InitBasicFS for rm_rf (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_rm_rf_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10748,7 +10923,7 @@ static int test_rm_rf_0 (void) static int test_rmdir_0 (void) { - /* InitBasicFS for rmdir (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_rmdir_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10828,7 +11003,7 @@ static int test_rmdir_0 (void) static int test_rmdir_1 (void) { - /* InitBasicFS for rmdir (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_rmdir_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10900,7 +11075,7 @@ static int test_rmdir_1 (void) static int test_rmdir_2 (void) { - /* InitBasicFS for rmdir (2): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_rmdir_2: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -10980,7 +11155,7 @@ static int test_rmdir_2 (void) static int test_rm_0 (void) { - /* InitBasicFS for rm (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_rm_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -11060,7 +11235,7 @@ static int test_rm_0 (void) static int test_rm_1 (void) { - /* InitBasicFS for rm (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_rm_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -11132,7 +11307,7 @@ static int test_rm_1 (void) static int test_rm_2 (void) { - /* InitBasicFS for rm (2): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_rm_2: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -11212,7 +11387,7 @@ static int test_rm_2 (void) static int test_read_lines_0 (void) { - /* InitBasicFS for read_lines (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_read_lines_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -11338,7 +11513,7 @@ static int test_read_lines_0 (void) static int test_read_lines_1 (void) { - /* InitBasicFS for read_lines (1): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_read_lines_1: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -11428,7 +11603,7 @@ static int test_read_lines_1 (void) static int test_lvs_0 (void) { - /* InitBasicFSonLVM for lvs (0): create ext2 on /dev/VG/LV */ + /* InitBasicFSonLVM for test_lvs_0: create ext2 on /dev/VG/LV */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -11550,7 +11725,7 @@ static int test_lvs_0 (void) static int test_lvs_1 (void) { - /* InitEmpty for lvs (1) */ + /* InitNone|InitEmpty for test_lvs_1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -11735,7 +11910,7 @@ static int test_lvs_1 (void) static int test_vgs_0 (void) { - /* InitBasicFSonLVM for vgs (0): create ext2 on /dev/VG/LV */ + /* InitBasicFSonLVM for test_vgs_0: create ext2 on /dev/VG/LV */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -11857,7 +12032,7 @@ static int test_vgs_0 (void) static int test_vgs_1 (void) { - /* InitEmpty for vgs (1) */ + /* InitNone|InitEmpty for test_vgs_1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -12003,7 +12178,7 @@ static int test_vgs_1 (void) static int test_pvs_0 (void) { - /* InitBasicFSonLVM for pvs (0): create ext2 on /dev/VG/LV */ + /* InitBasicFSonLVM for test_pvs_0: create ext2 on /dev/VG/LV */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -12126,7 +12301,7 @@ static int test_pvs_0 (void) static int test_pvs_1 (void) { - /* InitEmpty for pvs (1) */ + /* InitNone|InitEmpty for test_pvs_1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -12256,7 +12431,7 @@ static int test_pvs_1 (void) static int test_list_partitions_0 (void) { - /* InitBasicFS for list_partitions (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_list_partitions_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -12349,7 +12524,7 @@ static int test_list_partitions_0 (void) static int test_list_partitions_1 (void) { - /* InitEmpty for list_partitions (1) */ + /* InitNone|InitEmpty for test_list_partitions_1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -12452,7 +12627,7 @@ static int test_list_partitions_1 (void) static int test_list_devices_0 (void) { - /* InitEmpty for list_devices (0) */ + /* InitNone|InitEmpty for test_list_devices_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -12537,7 +12712,7 @@ static int test_list_devices_0 (void) static int test_ls_0 (void) { - /* InitBasicFS for ls (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_ls_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -12690,7 +12865,7 @@ static int test_ls_0 (void) static int test_cat_0 (void) { - /* InitBasicFS for cat (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_cat_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -12777,7 +12952,7 @@ static int test_cat_0 (void) static int test_touch_0 (void) { - /* InitBasicFS for touch (0): create ext2 on /dev/sda1 */ + /* InitBasicFS for test_touch_0: create ext2 on /dev/sda1 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -12861,7 +13036,7 @@ static int test_touch_0 (void) static int test_sync_0 (void) { - /* InitEmpty for sync (0) */ + /* InitNone|InitEmpty for test_sync_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -12898,7 +13073,7 @@ static int test_sync_0 (void) static int test_mount_0 (void) { - /* InitEmpty for mount (0) */ + /* InitNone|InitEmpty for test_mount_0 */ { char device[] = "/dev/sda"; device[5] = devchar; @@ -13123,9 +13298,15 @@ int main (int argc, char *argv[]) free (devs[i]); free (devs); - nr_tests = 136; + nr_tests = 137; test_num++; + printf ("%3d/%3d test_lvresize_0\n", test_num, nr_tests); + if (test_lvresize_0 () == -1) { + printf ("test_lvresize_0 FAILED\n"); + failed++; + } + test_num++; printf ("%3d/%3d test_zerofree_0\n", test_num, nr_tests); if (test_zerofree_0 () == -1) { printf ("test_zerofree_0 FAILED\n"); -- 1.8.3.1