mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
New API: vgscan
Implement vgscan to allow for a full rescan of all LVM PVs, VGs and LVs.
This commit is contained in:
18
daemon/lvm.c
18
daemon/lvm.c
@@ -594,3 +594,21 @@ do_vglvuuids (const char *vgname)
|
||||
{
|
||||
return get_lvm_fields ("vgs", "lv_uuid", vgname);
|
||||
}
|
||||
|
||||
int
|
||||
do_vgscan (void)
|
||||
{
|
||||
char *err;
|
||||
int r;
|
||||
|
||||
r = command (NULL, &err,
|
||||
"lvm", "vgscan", NULL);
|
||||
if (r == -1) {
|
||||
reply_with_error ("%s", err);
|
||||
free (err);
|
||||
return -1;
|
||||
}
|
||||
|
||||
free (err);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4381,6 +4381,14 @@ This command resizes an NTFS filesystem, expanding or
|
||||
shrinking it to the size of the underlying device.
|
||||
See also L<ntfsresize(8)>.");
|
||||
|
||||
("vgscan", (RErr, []), 232, [],
|
||||
[InitEmpty, Always, TestRun (
|
||||
[["vgscan"]])],
|
||||
"rescan for LVM physical volumes, volume groups and logical volumes",
|
||||
"\
|
||||
This rescans all block devices and rebuilds the list of LVM
|
||||
physical volumes, volume groups and logical volumes.");
|
||||
|
||||
]
|
||||
|
||||
let all_functions = non_daemon_functions @ daemon_functions
|
||||
|
||||
Reference in New Issue
Block a user