Richard W.M. Jones
2015-Nov-10 12:06 UTC
[Libguestfs] [PATCH] daemon: lvm: Only return public LVs from guestfs_lvs API (RHBZ#1278878).
When a disk image uses LVM thinp (thin provisioning), the guestfs_lvs API would return the thinp pools. This confused other APIs because thinp pools don't have corresponding /dev/VG/LV device nodes. Filter the LVs that are returned using "lv_role=public". Thanks: Fabian Deutsch --- daemon/lvm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/lvm.c b/daemon/lvm.c index d989986..6e201e3 100644 --- a/daemon/lvm.c +++ b/daemon/lvm.c @@ -148,7 +148,9 @@ do_lvs (void) r = command (&out, &err, str_lvm, "lvs", - "-o", "vg_name,lv_name", "--noheadings", + "-o", "vg_name,lv_name", + "-S", "lv_role=public", + "--noheadings", "--separator", "/", NULL); if (r == -1) { reply_with_error ("%s", err); -- 2.5.0
Pino Toscano
2015-Nov-10 12:18 UTC
Re: [Libguestfs] [PATCH] daemon: lvm: Only return public LVs from guestfs_lvs API (RHBZ#1278878).
On Tuesday 10 November 2015 12:06:21 Richard W.M. Jones wrote:> When a disk image uses LVM thinp (thin provisioning), the guestfs_lvs > API would return the thinp pools. This confused other APIs because > thinp pools don't have corresponding /dev/VG/LV device nodes. > > Filter the LVs that are returned using "lv_role=public". > > Thanks: Fabian Deutsch > --- > daemon/lvm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/daemon/lvm.c b/daemon/lvm.c > index d989986..6e201e3 100644 > --- a/daemon/lvm.c > +++ b/daemon/lvm.c > @@ -148,7 +148,9 @@ do_lvs (void) > > r = command (&out, &err, > str_lvm, "lvs", > - "-o", "vg_name,lv_name", "--noheadings", > + "-o", "vg_name,lv_name", > + "-S", "lv_role=public", > + "--noheadings", > "--separator", "/", NULL); > if (r == -1) { > reply_with_error ("%s", err);Should the additional parameter passed also when calling `lvs` in parse_command_line_lvs (which implements lvs_full)? -- Pino Toscano
Richard W.M. Jones
2015-Nov-10 12:35 UTC
Re: [Libguestfs] [PATCH] daemon: lvm: Only return public LVs from guestfs_lvs API (RHBZ#1278878).
On Tue, Nov 10, 2015 at 01:18:59PM +0100, Pino Toscano wrote:> On Tuesday 10 November 2015 12:06:21 Richard W.M. Jones wrote: > > When a disk image uses LVM thinp (thin provisioning), the guestfs_lvs > > API would return the thinp pools. This confused other APIs because > > thinp pools don't have corresponding /dev/VG/LV device nodes. > > > > Filter the LVs that are returned using "lv_role=public". > > > > Thanks: Fabian Deutsch > > --- > > daemon/lvm.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/daemon/lvm.c b/daemon/lvm.c > > index d989986..6e201e3 100644 > > --- a/daemon/lvm.c > > +++ b/daemon/lvm.c > > @@ -148,7 +148,9 @@ do_lvs (void) > > > > r = command (&out, &err, > > str_lvm, "lvs", > > - "-o", "vg_name,lv_name", "--noheadings", > > + "-o", "vg_name,lv_name", > > + "-S", "lv_role=public", > > + "--noheadings", > > "--separator", "/", NULL); > > if (r == -1) { > > reply_with_error ("%s", err); > > Should the additional parameter passed also when calling `lvs` in > parse_command_line_lvs (which implements lvs_full)?I don't think so. See my comment here for my thinking behind that: https://bugzilla.redhat.com/show_bug.cgi?id=1278878#c11 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Maybe Matching Threads
- Re: [PATCH] daemon: lvm: Only return public LVs from guestfs_lvs API (RHBZ#1278878).
- [PATCH] daemon: lvm: Ignore LVs with the activationskip flag set (RHBZ#1306666).
- [PATCH] lvm: support lvm2 older than 2.02.107
- [PATCH 0/5] Improve LVM handling in the appliance
- [PATCH 14/27] daemon: Reimplement ‘lvs’ API in OCaml.