From: Alasdair G Kergon <agk@redhat.com>
To: Martin Papik <mp6058@gmail.com>
Cc: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] pvmove
Date: Sat, 20 Jul 2013 00:20:53 +0100 [thread overview]
Message-ID: <20130719232052.GB23574@agk-dp.fab.redhat.com> (raw)
In-Reply-To: <51E9BD58.4030301@gmail.com>
It uses lists of ranges separated by colons.
:x-y
If x is missing, 0 is inserted; if y is missing, the last extent on the device
is inserted.
Man pages can always be improved with more examples!
For +length, try the patch below.
Alasdair
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1001,7 +1001,7 @@ static int _parse_pes(struct dm_pool *mem, char *c, struct dm_list *pe_ranges,
const char *pvname, uint32_t size)
{
char *endptr;
- uint32_t start, end;
+ uint32_t start, end, len;
/* Default to whole PV */
if (!c) {
@@ -1041,7 +1041,16 @@ static int _parse_pes(struct dm_pool *mem, char *c, struct dm_list *pe_ranges,
goto error;
c = endptr;
}
+ } else if (*c == '+') { /* Length? */
+ c++;
+ if (isdigit(*c)) {
+ if (!xstrtouint32(c, &endptr, 10, &len))
+ goto error;
+ c = endptr;
+ end = start + (len ? (len - 1) : 0);
+ }
}
+
if (*c && *c != ':')
goto error;
next prev parent reply other threads:[~2013-07-19 23:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-19 18:14 [linux-lvm] pvmove Martin Papik
2013-07-19 19:59 ` Zdenek Kabelac
2013-07-19 22:27 ` Martin Papik
2013-07-19 23:20 ` Alasdair G Kergon [this message]
2013-07-23 2:45 ` Martin Papik
2013-07-24 3:33 ` [linux-lvm] pvmove ==> segfault: pvs --all -o +vg_fmt Martin Papik
2013-09-23 20:38 ` [linux-lvm] pvmove Alasdair G Kergon
2013-09-23 20:56 ` Alasdair G Kergon
2013-09-23 21:10 ` Alasdair G Kergon
-- strict thread matches above, loose matches on Subject: below --
2003-07-12 7:44 Juan Pablo Giménez
2003-07-12 8:29 ` Joe Thornber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130719232052.GB23574@agk-dp.fab.redhat.com \
--to=agk@redhat.com \
--cc=linux-lvm@redhat.com \
--cc=mp6058@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).