<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
于 2011年09月22日 16:41, Eli 写道:
<blockquote cite="mid:4E7AF4C3.4030500@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
hi Osier:<br>
于 2011年09月22日 15:08, Osier Yang 写道:
<blockquote cite="mid:4E7ADEE5.1060101@redhat.com" type="cite">于
2011年09月22日 14:31, Eli 写道: <br>
<blockquote type="cite">hi Osier : <br>
于 2011年09月21日 17:07, Osier Yang 写道: <br>
<blockquote type="cite">*
src/storage/storage_backend_logical.c: <br>
<br>
If a logical vol is created with multiple stripes. (e.g.
--stripes 3), <br>
the "device" field of lvs output will have multiple fileds
which are <br>
seperated by comma. It means the RE we write in the codes
will not <br>
work well anymore. E.g. (lvs output for a stripped vol, uses
"#" as <br>
seperator here): <br>
<br>
test_stripes##fSLSZH-zAS2-yAIb-n4mV-Al9u-HA3V-oo9K1B#\ <br>
/dev/sdc1(10240),/dev/sdd1(0)#42949672960#4194304 <br>
<br>
The RE we uses: <br>
<br>
const char *regexes[] = { <br>
"^\\s*(\\S+),(\\S*),(\\S+),(\\S+)\\((\\S+)\\),(\\S+),([0-9]+),?\\s*$"
<br>
}; <br>
<br>
This patch changes the seperator into "#" to fix the
problem. <br>
<br>
Related RHBZ: <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="https://bugzilla.redhat.com/show_bug.cgi?id=727474">https://bugzilla.redhat.com/show_bug.cgi?id=727474</a>
<br>
--- <br>
src/storage/storage_backend_logical.c | 7 ++++--- <br>
1 files changed, 4 insertions(+), 3 deletions(-) <br>
<br>
diff --git a/src/storage/storage_backend_logical.c
b/src/storage/storage_backend_logical.c <br>
index 4f42047..45f77ad 100644 <br>
--- a/src/storage/storage_backend_logical.c <br>
+++ b/src/storage/storage_backend_logical.c <br>
@@ -187,19 +187,20 @@
virStorageBackendLogicalFindLVs(virStoragePoolObjPtr pool, <br>
* <br>
* NB can be multiple rows per volume if they have
many extents <br>
* <br>
- * NB lvs from some distros (e.g. SLES10 SP2) outputs
trailing "," on each line <br>
+ * NB lvs from some distros (e.g. SLES10 SP2) outputs
trailing <br>
+ * @separator on each line <br>
* <br>
* NB Encrypted logical volumes can print ':' in their
name, so it is <br>
* not a suitable separator (rhbz 470693). <br>
*/ <br>
const char *regexes[] = { <br>
-
"^\\s*(\\S+),(\\S*),(\\S+),(\\S+)\\((\\S+)\\),(\\S+),([0-9]+),?\\s*$"
<br>
+
"^\\s*(\\S+)#(\\S*)#(\\S+)#(\\S+)\\((\\S+)\\)#(\\S+)#([0-9]+)#?\\s*$"
<br>
}; <br>
int vars[] = { <br>
7 <br>
}; <br>
const char *prog[] = { <br>
- LVS, "--separator", ",", "--noheadings", "--units",
"b", <br>
+ LVS, "--separator", "#", "--noheadings", "--units",
"b", <br>
"--unbuffered", "--nosuffix", "--options", <br>
"lv_name,origin,uuid,devices,seg_size,vg_extent_size", <br>
pool->def->source.name, NULL <br>
</blockquote>
<br>
I reproduced the bug : <br>
<br>
[root@localhost bin]# ./virsh -d 5 pool-create-as vg_ssd
logical --target /dev/vg_ssd <br>
error: Failed to create pool vg_ssd <br>
error: cannot open volume '/dev/vg_ssd/test_stripes,': No such
file or directory <br>
<br>
and then I tested this patch , it seems work well. <br>
<br>
[root@localhost bin]# ./virsh -d 5 pool-create-as vg_ssd
logical --target /dev/vg_ssd <br>
Pool vg_ssd created <br>
<br>
[root@localhost bin]# ./virsh pool-info vg_ssd <br>
Name: vg_ssd <br>
UUID: c45cc84e-7879-cc15-ee78-2d2dda6b531d <br>
State: running <br>
Persistent: no <br>
Autostart: no <br>
Capacity: 200.00 MB <br>
Allocation: 152.00 MB <br>
Available: 48.00 MB <br>
<br>
</blockquote>
<br>
Thanks for the testing, Eli, <br>
<br>
Could you also check what's the vol XML? I want to confirm if
the <br>
"<extents>" in
"<source><device></device></source>"displays
well, <br>
though it looks to me there is no "<path>" element defined
for "<extents>" <br>
in the storage vol schema yet. <br>
<br>
</blockquote>
1. my vol XML is like this:<br>
<br>
virsh # vol-dumpxml test_stripes --pool vg_ssd<br>
<volume><br>
<name>test_stripes</name><br>
<key>1pc6Gf-1hn2-WGnw-ASKt-uX6w-xUed-qERq50</key><br>
<b> <source><br>
<device path='/dev/sdb(0),/dev/sdc'><br>
</b></blockquote>
<br>
This is expected, and is what's Daniel Berrange worried about.<br>
<br>
<blockquote cite="mid:4E7AF4C3.4030500@linux.vnet.ibm.com"
type="cite"><b> <extent start='0' end='159383552'/><br>
</device><br>
</source></b><br>
</blockquote>
<br>
Thanks<br>
Osier<br>
</body>
</html>