master - pvscan: use major:minor as short form of --major and --minor arg for pvscan --cache
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0a48137d39c51163ee29608c8c7ccbeecb4a7815 Commit: 0a48137d39c51163ee29608c8c7ccbeecb4a7815 Parent: 65456a4a29d8f25ab75af2145b8a6b2a9ff391e5 Author: Peter Rajnoha <[email protected]> AuthorDate: Tue Oct 22 13:52:18 2013 +0200 Committer: Peter Rajnoha <[email protected]> CommitterDate: Tue Oct 22 13:52:18 2013 +0200
pvscan: use major:minor as short form of --major and --minor arg for pvscan --cache
Before, pvscan recognized either:
pvscan --cache --major <major> --minor <minor>
or
pvscan --cache <DevicePath>
When the device is gone and we need to notify lvmetad about device removal, only --major/--minor works as we can't translate DevicePath into major/minor pair anymore. The device does not exist in the system and we don't keep DevicePath index in lvmetad cache to make the translation internally into original major/minor pair. It would be useless to keep this index just for this one exact case.
There's nothing bad about using "--major <major> --minor <minor>", but it makes our life a bit harder when trying to make an interconnection with systemd units, mainly with instantiated services where only one and only one arg can be passed (which is encoded in the service name).
This patch tries to make this easier by adding support for recognizing the "<major>:<minor>" as a shortcut for the longer form "--major <major> --minor <minor>". The rule here is simple: if the argument starts with "/", it's a DevicePath, otherwise it's a <major>:<minor> pair.
--- WHATS_NEW | 1 + man/pvscan.8.in | 4 ++- tools/pvscan.c | 61 +++++++++++++++++++++++++++++++++++++++++------------- 3 files changed, 50 insertions(+), 16 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.104 =================================== + Use major:minor as short form of --major and --minor arg for pvscan --cache. Remove 2>/dev/null from three lvm commands executed by vgimportclone. Add configure --enable-udev-systemd-background-jobs. Add lvm2-pvscan at .service to run pvscan as a service for lvmetad/autoactivation.
man/pvscan.8.in +3 -1
@@ -25,7 +25,9 @@ pvscan \- scan all disks for physical volumes .B \-\-minor .I minor | -.IR DevicePath ]... +.IR DevicePath +| +.IR major:minor ]... .SH DESCRIPTION pvscan scans all supported LVM block devices in the system for physical volumes.
tools/pvscan.c +46 -15
89 lines not on this page · raw message