diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-07 09:52:46 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-07 09:52:46 +0100 |
commit | 7ea56c8d0bca01a602df8e87e52d90c5b44e2cc2 (patch) | |
tree | 76c3d27ffc743dc26fcc53daa4597419dd86b115 /src | |
parent | 73d6932ab2dd3f9120a1f4a532621c07cb174705 (diff) | |
download | libguestfs-7ea56c8d0bca01a602df8e87e52d90c5b44e2cc2.tar.gz libguestfs-7ea56c8d0bca01a602df8e87e52d90c5b44e2cc2.tar.xz libguestfs-7ea56c8d0bca01a602df8e87e52d90c5b44e2cc2.zip |
Rename pvs -> pvs-full (etc), so we can add simple pvs (etc) commands.
Diffstat (limited to 'src')
-rwxr-xr-x | src/generator.ml | 20 | ||||
-rw-r--r-- | src/guestfs-actions.c | 90 | ||||
-rw-r--r-- | src/guestfs-actions.h | 6 | ||||
-rw-r--r-- | src/guestfs_protocol.c | 6 | ||||
-rw-r--r-- | src/guestfs_protocol.h | 32 | ||||
-rw-r--r-- | src/guestfs_protocol.x | 18 |
6 files changed, 96 insertions, 76 deletions
diff --git a/src/generator.ml b/src/generator.ml index 8d1dc046..69981f04 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -135,6 +135,7 @@ The full partition device names are returned, eg. C</dev/sda1> This does not return logical volumes. For that you will need to call C<guestfs_lvs>."); +(* ("pvs", (RPVList "physvols", P0), 9, [], "list the LVM physical volumes (PVs)", "\ @@ -152,6 +153,25 @@ of the L<vgs(8)> command."); "\ List all the logical volumes detected. This is the equivalent of the L<lvs(8)> command."); +*) + + ("pvs_full", (RPVList "physvols", P0), 12, [], + "list the LVM physical volumes (PVs)", + "\ +List all the physical volumes detected. This is the equivalent +of the L<pvs(8)> command."); + + ("vgs_full", (RVGList "volgroups", P0), 13, [], + "list the LVM volume groups (VGs)", + "\ +List all the volumes groups detected. This is the equivalent +of the L<vgs(8)> command."); + + ("lvs_full", (RLVList "logvols", P0), 14, [], + "list the LVM logical volumes (LVs)", + "\ +List all the logical volumes detected. This is the equivalent +of the L<lvs(8)> command."); ] (* Column names and types from LVM PVs/VGs/LVs. *) diff --git a/src/guestfs-actions.c b/src/guestfs-actions.c index 83f5ec15..e3598eb5 100644 --- a/src/guestfs-actions.c +++ b/src/guestfs-actions.c @@ -595,30 +595,30 @@ char **guestfs_list_partitions (guestfs_h *g) return rv.ret.partitions.partitions_val; } -struct pvs_rv { +struct pvs_full_rv { int cb_done; /* flag to indicate callback was called */ struct guestfs_message_header hdr; struct guestfs_message_error err; - struct guestfs_pvs_ret ret; + struct guestfs_pvs_full_ret ret; }; -static void pvs_cb (guestfs_h *g, void *data, XDR *xdr) +static void pvs_full_cb (guestfs_h *g, void *data, XDR *xdr) { - struct pvs_rv *rv = (struct pvs_rv *) data; + struct pvs_full_rv *rv = (struct pvs_full_rv *) data; if (!xdr_guestfs_message_header (xdr, &rv->hdr)) { - error (g, "guestfs_pvs: failed to parse reply header"); + error (g, "guestfs_pvs_full: failed to parse reply header"); return; } if (rv->hdr.status == GUESTFS_STATUS_ERROR) { if (!xdr_guestfs_message_error (xdr, &rv->err)) { - error (g, "guestfs_pvs: failed to parse reply error"); + error (g, "guestfs_pvs_full: failed to parse reply error"); return; } goto done; } - if (!xdr_guestfs_pvs_ret (xdr, &rv->ret)) { - error (g, "guestfs_pvs: failed to parse reply"); + if (!xdr_guestfs_pvs_full_ret (xdr, &rv->ret)) { + error (g, "guestfs_pvs_full: failed to parse reply"); return; } done: @@ -626,35 +626,35 @@ static void pvs_cb (guestfs_h *g, void *data, XDR *xdr) main_loop.main_loop_quit (g); } -struct guestfs_lvm_pv_list *guestfs_pvs (guestfs_h *g) +struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g) { - struct pvs_rv rv; + struct pvs_full_rv rv; int serial; if (g->state != READY) { - error (g, "guestfs_pvs called from the wrong state, %d != READY", + error (g, "guestfs_pvs_full called from the wrong state, %d != READY", g->state); return NULL; } memset (&rv, 0, sizeof rv); - serial = dispatch (g, GUESTFS_PROC_PVS, NULL, NULL); + serial = dispatch (g, GUESTFS_PROC_PVS_FULL, NULL, NULL); if (serial == -1) return NULL; rv.cb_done = 0; - g->reply_cb_internal = pvs_cb; + g->reply_cb_internal = pvs_full_cb; g->reply_cb_internal_data = &rv; main_loop.main_loop_run (g); g->reply_cb_internal = NULL; g->reply_cb_internal_data = NULL; if (!rv.cb_done) { - error (g, "guestfs_pvs failed, see earlier error messages"); + error (g, "guestfs_pvs_full failed, see earlier error messages"); return NULL; } - if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_PVS, serial) == -1) + if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_PVS_FULL, serial) == -1) return NULL; if (rv.hdr.status == GUESTFS_STATUS_ERROR) { @@ -666,30 +666,30 @@ struct guestfs_lvm_pv_list *guestfs_pvs (guestfs_h *g) return safe_memdup (g, &rv.ret.physvols, sizeof (rv.ret.physvols)); } -struct vgs_rv { +struct vgs_full_rv { int cb_done; /* flag to indicate callback was called */ struct guestfs_message_header hdr; struct guestfs_message_error err; - struct guestfs_vgs_ret ret; + struct guestfs_vgs_full_ret ret; }; -static void vgs_cb (guestfs_h *g, void *data, XDR *xdr) +static void vgs_full_cb (guestfs_h *g, void *data, XDR *xdr) { - struct vgs_rv *rv = (struct vgs_rv *) data; + struct vgs_full_rv *rv = (struct vgs_full_rv *) data; if (!xdr_guestfs_message_header (xdr, &rv->hdr)) { - error (g, "guestfs_vgs: failed to parse reply header"); + error (g, "guestfs_vgs_full: failed to parse reply header"); return; } if (rv->hdr.status == GUESTFS_STATUS_ERROR) { if (!xdr_guestfs_message_error (xdr, &rv->err)) { - error (g, "guestfs_vgs: failed to parse reply error"); + error (g, "guestfs_vgs_full: failed to parse reply error"); return; } goto done; } - if (!xdr_guestfs_vgs_ret (xdr, &rv->ret)) { - error (g, "guestfs_vgs: failed to parse reply"); + if (!xdr_guestfs_vgs_full_ret (xdr, &rv->ret)) { + error (g, "guestfs_vgs_full: failed to parse reply"); return; } done: @@ -697,35 +697,35 @@ static void vgs_cb (guestfs_h *g, void *data, XDR *xdr) main_loop.main_loop_quit (g); } -struct guestfs_lvm_vg_list *guestfs_vgs (guestfs_h *g) +struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g) { - struct vgs_rv rv; + struct vgs_full_rv rv; int serial; if (g->state != READY) { - error (g, "guestfs_vgs called from the wrong state, %d != READY", + error (g, "guestfs_vgs_full called from the wrong state, %d != READY", g->state); return NULL; } memset (&rv, 0, sizeof rv); - serial = dispatch (g, GUESTFS_PROC_VGS, NULL, NULL); + serial = dispatch (g, GUESTFS_PROC_VGS_FULL, NULL, NULL); if (serial == -1) return NULL; rv.cb_done = 0; - g->reply_cb_internal = vgs_cb; + g->reply_cb_internal = vgs_full_cb; g->reply_cb_internal_data = &rv; main_loop.main_loop_run (g); g->reply_cb_internal = NULL; g->reply_cb_internal_data = NULL; if (!rv.cb_done) { - error (g, "guestfs_vgs failed, see earlier error messages"); + error (g, "guestfs_vgs_full failed, see earlier error messages"); return NULL; } - if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_VGS, serial) == -1) + if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_VGS_FULL, serial) == -1) return NULL; if (rv.hdr.status == GUESTFS_STATUS_ERROR) { @@ -737,30 +737,30 @@ struct guestfs_lvm_vg_list *guestfs_vgs (guestfs_h *g) return safe_memdup (g, &rv.ret.volgroups, sizeof (rv.ret.volgroups)); } -struct lvs_rv { +struct lvs_full_rv { int cb_done; /* flag to indicate callback was called */ struct guestfs_message_header hdr; struct guestfs_message_error err; - struct guestfs_lvs_ret ret; + struct guestfs_lvs_full_ret ret; }; -static void lvs_cb (guestfs_h *g, void *data, XDR *xdr) +static void lvs_full_cb (guestfs_h *g, void *data, XDR *xdr) { - struct lvs_rv *rv = (struct lvs_rv *) data; + struct lvs_full_rv *rv = (struct lvs_full_rv *) data; if (!xdr_guestfs_message_header (xdr, &rv->hdr)) { - error (g, "guestfs_lvs: failed to parse reply header"); + error (g, "guestfs_lvs_full: failed to parse reply header"); return; } if (rv->hdr.status == GUESTFS_STATUS_ERROR) { if (!xdr_guestfs_message_error (xdr, &rv->err)) { - error (g, "guestfs_lvs: failed to parse reply error"); + error (g, "guestfs_lvs_full: failed to parse reply error"); return; } goto done; } - if (!xdr_guestfs_lvs_ret (xdr, &rv->ret)) { - error (g, "guestfs_lvs: failed to parse reply"); + if (!xdr_guestfs_lvs_full_ret (xdr, &rv->ret)) { + error (g, "guestfs_lvs_full: failed to parse reply"); return; } done: @@ -768,35 +768,35 @@ static void lvs_cb (guestfs_h *g, void *data, XDR *xdr) main_loop.main_loop_quit (g); } -struct guestfs_lvm_lv_list *guestfs_lvs (guestfs_h *g) +struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g) { - struct lvs_rv rv; + struct lvs_full_rv rv; int serial; if (g->state != READY) { - error (g, "guestfs_lvs called from the wrong state, %d != READY", + error (g, "guestfs_lvs_full called from the wrong state, %d != READY", g->state); return NULL; } memset (&rv, 0, sizeof rv); - serial = dispatch (g, GUESTFS_PROC_LVS, NULL, NULL); + serial = dispatch (g, GUESTFS_PROC_LVS_FULL, NULL, NULL); if (serial == -1) return NULL; rv.cb_done = 0; - g->reply_cb_internal = lvs_cb; + g->reply_cb_internal = lvs_full_cb; g->reply_cb_internal_data = &rv; main_loop.main_loop_run (g); g->reply_cb_internal = NULL; g->reply_cb_internal_data = NULL; if (!rv.cb_done) { - error (g, "guestfs_lvs failed, see earlier error messages"); + error (g, "guestfs_lvs_full failed, see earlier error messages"); return NULL; } - if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_LVS, serial) == -1) + if (check_reply_header (g, &rv.hdr, GUESTFS_PROC_LVS_FULL, serial) == -1) return NULL; if (rv.hdr.status == GUESTFS_STATUS_ERROR) { diff --git a/src/guestfs-actions.h b/src/guestfs-actions.h index d48cd9bf..8e73a5ea 100644 --- a/src/guestfs-actions.h +++ b/src/guestfs-actions.h @@ -27,6 +27,6 @@ extern char *guestfs_ll (guestfs_h *handle, const char *directory); extern char **guestfs_ls (guestfs_h *handle, const char *directory); extern char **guestfs_list_devices (guestfs_h *handle); extern char **guestfs_list_partitions (guestfs_h *handle); -extern struct guestfs_lvm_pv_list *guestfs_pvs (guestfs_h *handle); -extern struct guestfs_lvm_vg_list *guestfs_vgs (guestfs_h *handle); -extern struct guestfs_lvm_lv_list *guestfs_lvs (guestfs_h *handle); +extern struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *handle); +extern struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *handle); +extern struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *handle); diff --git a/src/guestfs_protocol.c b/src/guestfs_protocol.c index dfdd0d8b..a19d7a12 100644 --- a/src/guestfs_protocol.c +++ b/src/guestfs_protocol.c @@ -279,7 +279,7 @@ xdr_guestfs_list_partitions_ret (XDR *xdrs, guestfs_list_partitions_ret *objp) } bool_t -xdr_guestfs_pvs_ret (XDR *xdrs, guestfs_pvs_ret *objp) +xdr_guestfs_pvs_full_ret (XDR *xdrs, guestfs_pvs_full_ret *objp) { register int32_t *buf; @@ -289,7 +289,7 @@ xdr_guestfs_pvs_ret (XDR *xdrs, guestfs_pvs_ret *objp) } bool_t -xdr_guestfs_vgs_ret (XDR *xdrs, guestfs_vgs_ret *objp) +xdr_guestfs_vgs_full_ret (XDR *xdrs, guestfs_vgs_full_ret *objp) { register int32_t *buf; @@ -299,7 +299,7 @@ xdr_guestfs_vgs_ret (XDR *xdrs, guestfs_vgs_ret *objp) } bool_t -xdr_guestfs_lvs_ret (XDR *xdrs, guestfs_lvs_ret *objp) +xdr_guestfs_lvs_full_ret (XDR *xdrs, guestfs_lvs_full_ret *objp) { register int32_t *buf; diff --git a/src/guestfs_protocol.h b/src/guestfs_protocol.h index a168e43a..55faa85e 100644 --- a/src/guestfs_protocol.h +++ b/src/guestfs_protocol.h @@ -152,20 +152,20 @@ struct guestfs_list_partitions_ret { }; typedef struct guestfs_list_partitions_ret guestfs_list_partitions_ret; -struct guestfs_pvs_ret { +struct guestfs_pvs_full_ret { guestfs_lvm_int_pv_list physvols; }; -typedef struct guestfs_pvs_ret guestfs_pvs_ret; +typedef struct guestfs_pvs_full_ret guestfs_pvs_full_ret; -struct guestfs_vgs_ret { +struct guestfs_vgs_full_ret { guestfs_lvm_int_vg_list volgroups; }; -typedef struct guestfs_vgs_ret guestfs_vgs_ret; +typedef struct guestfs_vgs_full_ret guestfs_vgs_full_ret; -struct guestfs_lvs_ret { +struct guestfs_lvs_full_ret { guestfs_lvm_int_lv_list logvols; }; -typedef struct guestfs_lvs_ret guestfs_lvs_ret; +typedef struct guestfs_lvs_full_ret guestfs_lvs_full_ret; enum guestfs_procedure { GUESTFS_PROC_MOUNT = 1, @@ -176,10 +176,10 @@ enum guestfs_procedure { GUESTFS_PROC_LS = 6, GUESTFS_PROC_LIST_DEVICES = 7, GUESTFS_PROC_LIST_PARTITIONS = 8, - GUESTFS_PROC_PVS = 9, - GUESTFS_PROC_VGS = 10, - GUESTFS_PROC_LVS = 11, - GUESTFS_PROC_dummy = 11 + 1, + GUESTFS_PROC_PVS_FULL = 12, + GUESTFS_PROC_VGS_FULL = 13, + GUESTFS_PROC_LVS_FULL = 14, + GUESTFS_PROC_dummy = 14 + 1, }; typedef enum guestfs_procedure guestfs_procedure; #define GUESTFS_MESSAGE_MAX 4194304 @@ -234,9 +234,9 @@ extern bool_t xdr_guestfs_ls_args (XDR *, guestfs_ls_args*); extern bool_t xdr_guestfs_ls_ret (XDR *, guestfs_ls_ret*); extern bool_t xdr_guestfs_list_devices_ret (XDR *, guestfs_list_devices_ret*); extern bool_t xdr_guestfs_list_partitions_ret (XDR *, guestfs_list_partitions_ret*); -extern bool_t xdr_guestfs_pvs_ret (XDR *, guestfs_pvs_ret*); -extern bool_t xdr_guestfs_vgs_ret (XDR *, guestfs_vgs_ret*); -extern bool_t xdr_guestfs_lvs_ret (XDR *, guestfs_lvs_ret*); +extern bool_t xdr_guestfs_pvs_full_ret (XDR *, guestfs_pvs_full_ret*); +extern bool_t xdr_guestfs_vgs_full_ret (XDR *, guestfs_vgs_full_ret*); +extern bool_t xdr_guestfs_lvs_full_ret (XDR *, guestfs_lvs_full_ret*); 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*); @@ -261,9 +261,9 @@ extern bool_t xdr_guestfs_ls_args (); extern bool_t xdr_guestfs_ls_ret (); extern bool_t xdr_guestfs_list_devices_ret (); extern bool_t xdr_guestfs_list_partitions_ret (); -extern bool_t xdr_guestfs_pvs_ret (); -extern bool_t xdr_guestfs_vgs_ret (); -extern bool_t xdr_guestfs_lvs_ret (); +extern bool_t xdr_guestfs_pvs_full_ret (); +extern bool_t xdr_guestfs_vgs_full_ret (); +extern bool_t xdr_guestfs_lvs_full_ret (); 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 fedc6f2d..9bc556ba 100644 --- a/src/guestfs_protocol.x +++ b/src/guestfs_protocol.x @@ -142,21 +142,21 @@ struct guestfs_list_partitions_ret { str partitions<>; }; -/* guestfs_pvs */ +/* guestfs_pvs_full */ -struct guestfs_pvs_ret { +struct guestfs_pvs_full_ret { guestfs_lvm_int_pv_list physvols; }; -/* guestfs_vgs */ +/* guestfs_vgs_full */ -struct guestfs_vgs_ret { +struct guestfs_vgs_full_ret { guestfs_lvm_int_vg_list volgroups; }; -/* guestfs_lvs */ +/* guestfs_lvs_full */ -struct guestfs_lvs_ret { +struct guestfs_lvs_full_ret { guestfs_lvm_int_lv_list logvols; }; @@ -169,9 +169,9 @@ enum guestfs_procedure { GUESTFS_PROC_LS = 6, GUESTFS_PROC_LIST_DEVICES = 7, GUESTFS_PROC_LIST_PARTITIONS = 8, - GUESTFS_PROC_PVS = 9, - GUESTFS_PROC_VGS = 10, - GUESTFS_PROC_LVS = 11, + GUESTFS_PROC_PVS_FULL = 12, + GUESTFS_PROC_VGS_FULL = 13, + GUESTFS_PROC_LVS_FULL = 14, GUESTFS_PROC_dummy }; |