]> xenbits.xensource.com Git - libvirt.git/commitdiff
Use different separator for lvs command to unbreak parsing for encrypted devs.
authorCole Robinson <crobinso@redhat.com>
Fri, 14 Nov 2008 16:10:47 +0000 (16:10 +0000)
committerCole Robinson <crobinso@redhat.com>
Fri, 14 Nov 2008 16:10:47 +0000 (16:10 +0000)
ChangeLog
src/storage_backend_logical.c

index 5c418965e5151ad1f8237e06a16f0a8b14d88dec..61ed1e9be3a9dae27d4ba55974322ef14c7eebf0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Nov 14 09:40:00 EST 2008 Cole Robinson <crobinso@redhat.com>
+
+       * src/storage_backend_logical.c: Use different separator for lvs
+       command to unbreak parsing for encrypted devices.
+
 Fri Nov 14 13:22:36 +0100 2008 Jim Meyering <meyering@redhat.com>
 
        avoid format string warnings
index 7b013f896e9e95aeeb7b65a253445a9ef8bcb6a8..a579ecdda17dcf2d39b8097c09ce8e9a0dbb8871 100644 (file)
@@ -173,27 +173,30 @@ virStorageBackendLogicalFindLVs(virConnectPtr conn,
                                 virStorageVolDefPtr vol)
 {
     /*
-     *  # lvs --separator : --noheadings --units b --unbuffered --nosuffix --options "lv_name,uuid,devices,seg_size,vg_extent_size" VGNAME
-     *  RootLV:06UgP5-2rhb-w3Bo-3mdR-WeoL-pytO-SAa2ky:/dev/hda2(0):5234491392:33554432
-     *  SwapLV:oHviCK-8Ik0-paqS-V20c-nkhY-Bm1e-zgzU0M:/dev/hda2(156):1040187392:33554432
-     *  Test2:3pg3he-mQsA-5Sui-h0i6-HNmc-Cz7W-QSndcR:/dev/hda2(219):1073741824:33554432
-     *  Test3:UB5hFw-kmlm-LSoX-EI1t-ioVd-h7GL-M0W8Ht:/dev/hda2(251):2181038080:33554432
-     *  Test3:UB5hFw-kmlm-LSoX-EI1t-ioVd-h7GL-M0W8Ht:/dev/hda2(187):1040187392:33554432
+     *  # lvs --separator , --noheadings --units b --unbuffered --nosuffix --options "lv_name,uuid,devices,seg_size,vg_extent_size" VGNAME
+     *  RootLV,06UgP5-2rhb-w3Bo-3mdR-WeoL-pytO-SAa2ky,/dev/hda2(0),5234491392,33554432
+     *  SwapLV,oHviCK-8Ik0-paqS-V20c-nkhY-Bm1e-zgzU0M,/dev/hda2(156),1040187392,33554432
+     *  Test2,3pg3he-mQsA-5Sui-h0i6-HNmc-Cz7W-QSndcR,/dev/hda2(219),1073741824,33554432
+     *  Test3,UB5hFw-kmlm-LSoX-EI1t-ioVd-h7GL-M0W8Ht,/dev/hda2(251),2181038080,33554432
+     *  Test3,UB5hFw-kmlm-LSoX-EI1t-ioVd-h7GL-M0W8Ht,/dev/hda2(187),1040187392,33554432
      *
      * Pull out name & uuid, device, device extent start #, segment size, extent size.
      *
      * NB can be multiple rows per volume if they have many extents
      *
-     * NB lvs from some distros (e.g. SLES10 SP2) outputs trailing ":" on each line
+     * NB lvs from some distros (e.g. SLES10 SP2) outputs trailing "," on each line
+     *
+     * NB Encrypted logical volumes can print ':' in their name, so it is
+     *    not a suitable separator (rhbz 470693).
      */
     const char *regexes[] = {
-        "^\\s*(\\S+):(\\S+):(\\S+)\\((\\S+)\\):(\\S+):([0-9]+):?\\s*$"
+        "^\\s*(\\S+),(\\S+),(\\S+)\\((\\S+)\\),(\\S+),([0-9]+),?\\s*$"
     };
     int vars[] = {
         6
     };
     const char *prog[] = {
-        LVS, "--separator", ":", "--noheadings", "--units", "b",
+        LVS, "--separator", ",", "--noheadings", "--units", "b",
         "--unbuffered", "--nosuffix", "--options",
         "lv_name,uuid,devices,seg_size,vg_extent_size",
         pool->def->source.name, NULL