mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
generator: Use new FDevice type for the pvs-full pv_name field
Remove the code which did explicit reverse device name translation, and use the generator's code instead.
This commit is contained in:
29
daemon/lvm.c
29
daemon/lvm.c
@@ -146,34 +146,7 @@ do_vgs (void)
|
||||
guestfs_int_lvm_pv_list *
|
||||
do_pvs_full (void)
|
||||
{
|
||||
guestfs_int_lvm_pv_list *r;
|
||||
size_t i;
|
||||
char *din, *dout;
|
||||
|
||||
r = parse_command_line_pvs ();
|
||||
if (r == NULL)
|
||||
/* parse_command_line_pvs has already called reply_with_error */
|
||||
return NULL;
|
||||
|
||||
/* The pv_name fields contain device names which must be reverse
|
||||
* translated. The problem here is that the generator does not have
|
||||
* a "FMountable" field type in types.mli.
|
||||
*/
|
||||
for (i = 0; i < r->guestfs_int_lvm_pv_list_len; ++i) {
|
||||
din = r->guestfs_int_lvm_pv_list_val[i].pv_name;
|
||||
if (din) {
|
||||
dout = reverse_device_name_translation (din);
|
||||
if (!dout) {
|
||||
/* reverse_device_name_translation has already called reply_with_error*/
|
||||
/* XXX memory leak here */
|
||||
return NULL;
|
||||
}
|
||||
r->guestfs_int_lvm_pv_list_val[i].pv_name = dout;
|
||||
free (din);
|
||||
}
|
||||
}
|
||||
|
||||
return r;
|
||||
return parse_command_line_pvs ();
|
||||
}
|
||||
|
||||
guestfs_int_lvm_vg_list *
|
||||
|
||||
@@ -35,7 +35,7 @@ type struc = {
|
||||
* we have to pull out the LVM columns separately here.
|
||||
*)
|
||||
let lvm_pv_cols = [
|
||||
"pv_name", FString;
|
||||
"pv_name", FDevice;
|
||||
"pv_uuid", FUUID;
|
||||
"pv_fmt", FString;
|
||||
"pv_size", FBytes;
|
||||
|
||||
Reference in New Issue
Block a user