Hello community, here is the log from the commit of package libstorage for openSUSE:Factory checked in at 2015-10-01 09:28:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage (Old) and /work/SRC/openSUSE:Factory/.libstorage.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libstorage" Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage/libstorage.changes 2015-09-11 09:00:49.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libstorage.new/libstorage.changes 2015-10-01 09:28:05.000000000 +0200 @@ -1,0 +2,20 @@ +Wed Sep 23 16:13:20 CEST 2015 - aschnell@suse.com + +- changed some requires to suggests (bsc#907331 and bsc#915097) +- 2.25.33 + +------------------------------------------------------------------- +Fri Sep 18 15:33:45 CEST 2015 - aschnell@suse.com + +- fixed detection for parted reporting that GPT does not use + complete disk (bsc#946013) +- 2.25.32 + +------------------------------------------------------------------- +Wed Sep 9 11:07:32 CEST 2015 - shundhammer@suse.de + +- Make sure no volumes are left behind when writing a new disk + label for multipath (bsc#888513) +- 2.25.31 + +------------------------------------------------------------------- Old: ---- libstorage-2.25.30.tar.bz2 New: ---- libstorage-2.25.33.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage.spec ++++++ --- /var/tmp/diff_new_pack.orHSGr/_old 2015-10-01 09:28:06.000000000 +0200 +++ /var/tmp/diff_new_pack.orHSGr/_new 2015-10-01 09:28:06.000000000 +0200 @@ -17,7 +17,7 @@ Name: libstorage -Version: 2.25.30 +Version: 2.25.33 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: libstorage-%{version}.tar.bz2 @@ -117,14 +117,14 @@ %package -n libstorage6 Requires: coreutils -Requires: cryptsetup +Suggests: cryptsetup Requires: device-mapper -Requires: dmraid +Suggests: dmraid Requires: grep Requires: lsscsi >= 0.26 -Requires: lvm2 -Requires: mdadm >= 3.3 -Requires: multipath-tools +Suggests: lvm2 +Suggests: mdadm >= 3.3 +Suggests: multipath-tools Requires: parted >= 3.1 Requires: udev Requires: util-linux >= 2.16 ++++++ libstorage-2.25.30.tar.bz2 -> libstorage-2.25.33.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.30/VERSION new/libstorage-2.25.33/VERSION --- old/libstorage-2.25.30/VERSION 2015-09-01 15:02:58.000000000 +0200 +++ new/libstorage-2.25.33/VERSION 2015-09-23 16:28:37.000000000 +0200 @@ -1 +1 @@ -2.25.30 +2.25.33 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.30/libstorage.spec.in new/libstorage-2.25.33/libstorage.spec.in --- old/libstorage-2.25.30/libstorage.spec.in 2015-08-24 16:52:23.000000000 +0200 +++ new/libstorage-2.25.33/libstorage.spec.in 2015-09-23 16:28:37.000000000 +0200 @@ -117,14 +117,14 @@ %package -n libstorage@LIBVERSION_MAJOR@ Requires: coreutils -Requires: cryptsetup +Suggests: cryptsetup Requires: device-mapper -Requires: dmraid +Suggests: dmraid Requires: grep Requires: lsscsi >= 0.26 -Requires: lvm2 -Requires: mdadm >= 3.3 -Requires: multipath-tools +Suggests: lvm2 +Suggests: mdadm >= 3.3 +Suggests: multipath-tools Requires: parted >= 3.1 Requires: udev Requires: util-linux >= 2.16 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.30/storage/DmPartCo.cc new/libstorage-2.25.33/storage/DmPartCo.cc --- old/libstorage-2.25.30/storage/DmPartCo.cc 2015-04-28 15:17:15.000000000 +0200 +++ new/libstorage-2.25.33/storage/DmPartCo.cc 2015-09-09 11:36:47.000000000 +0200 @@ -457,39 +457,44 @@ int DmPartCo::destroyPartitionTable( const string& new_label ) { - y2mil("begin"); - int ret = disk->destroyPartitionTable( new_label ); - if( ret==0 ) + int ret = 0; + + // Collect dev names for all disk volumes + + vector<string> dev_names; + ConstVolPair vol_pair( disk->volPair( Volume::notDeleted ) ); + + for ( ConstVolIterator it = vol_pair.begin(); it != vol_pair.end(); ++it ) { - VIter j = vols.begin(); - while( j!=vols.end() ) - { - if( (*j)->created() ) - { - delete( *j ); - j = vols.erase( j ); - } - else - ++j; - } - bool save = getStorage()->getRecursiveRemoval(); - getStorage()->setRecursiveRemoval(true); - if (isUsedBy()) - { - getStorage()->removeUsing( device(), getUsedBy() ); - } - ronly = false; - RVIter i = vols.rbegin(); - while( i!=vols.rend() ) + string dev = it->device(); + y2mil( "Going to delete dev " << dev ); + dev_names.push_back( dev ); + } + + // Remove disk partitions one by one from last to first + + bool save = getStorage()->getRecursiveRemoval(); + getStorage()->setRecursiveRemoval(true); + + for ( int i = dev_names.size()-1; i >= 0; i-- ) + { + string dev_name = dev_names[i]; + y2mil( "Removing volume " << dev_name ); + ret = getStorage()->removeVolume( dev_name ); + if ( ret != 0 ) { - if( !(*i)->deleted() ) - getStorage()->removeVolume( (*i)->device() ); - ++i; + y2err( "ERROR: Couldn't remove volume " << dev_name << ": " << ret ); + // break; } - getStorage()->setRecursiveRemoval(save); } - y2mil("ret:" << ret); - return( ret ); + + getStorage()->setRecursiveRemoval(save); + + // Create new disk label + disk->destroyPartitionTable( new_label ); + + y2mil("ret: " << ret ); + return ret; } int DmPartCo::changePartitionId( unsigned nr, unsigned id ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.30/storage/SystemInfo/CmdParted.cc new/libstorage-2.25.33/storage/SystemInfo/CmdParted.cc --- old/libstorage-2.25.30/storage/SystemInfo/CmdParted.cc 2015-08-24 16:52:23.000000000 +0200 +++ new/libstorage-2.25.33/storage/SystemInfo/CmdParted.cc 2015-09-18 15:55:07.000000000 +0200 @@ -73,12 +73,12 @@ } } - parse( cmd.stdout() ); + parse(cmd.stdout(), cmd.stderr()); } void - Parted::parse(const vector<string>& lines) + Parted::parse(const vector<string>& stdout, const vector<string>& stderr) { implicit = false; gpt_enlarge = false; @@ -86,8 +86,8 @@ vector<string>::const_iterator pos; - pos = find_if(lines, string_starts_with("Partition Table:")); - if (pos != lines.end()) + pos = find_if(stdout, string_starts_with("Partition Table:")); + if (pos != stdout.end()) { label = extractNthWord(2, *pos); if (label == "unknown") @@ -99,8 +99,8 @@ y2war("could not find partition table"); // only present for unrecognised disk label due to patch in parted - pos = find_if(lines, string_starts_with("BIOS cylinder,head,sector geometry:")); - if (pos != lines.end()) + pos = find_if(stdout, string_starts_with("BIOS cylinder,head,sector geometry:")); + if (pos != stdout.end()) scanGeometryLine(*pos); else { @@ -110,8 +110,8 @@ } // see bnc #866535 - pos = find_if(lines, string_starts_with("Disk " + device + ":")); - if (pos != lines.end()) + pos = find_if(stdout, string_starts_with("Disk " + device + ":")); + if (pos != stdout.end()) { unsigned long tmp; extractNthWord(2, *pos) >> tmp; @@ -125,19 +125,19 @@ y2war("could not find cylinder number"); // not present for unrecognised disk label - pos = find_if(lines, string_starts_with("Sector size (logical/physical):")); - if (pos != lines.end()) + pos = find_if(stdout, string_starts_with("Sector size (logical/physical):")); + if (pos != stdout.end()) scanSectorSizeLine(*pos); else y2war("could not find sector size"); - pos = find_if(lines, string_starts_with("Disk Flags:")); - if (pos != lines.end()) + pos = find_if(stdout, string_starts_with("Disk Flags:")); + if (pos != stdout.end()) scanDiskFlags(*pos); else y2war("could not find disk flags"); - gpt_enlarge = find_if(lines, string_starts_with("fix the GPT to use all")) != lines.end(); + gpt_enlarge = find_if(stderr, string_contains("fix the GPT to use all")) != stderr.end(); if (label != "loop") { @@ -146,7 +146,7 @@ // Parse partition tables: One with cylinder sizes, one with sector sizes - for (vector<string>::const_iterator it = lines.begin(); it != lines.end(); ++it) + for (vector<string>::const_iterator it = stdout.begin(); it != stdout.end(); ++it) { if (boost::starts_with(*it, "Number")) n++; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.30/storage/SystemInfo/CmdParted.h new/libstorage-2.25.33/storage/SystemInfo/CmdParted.h --- old/libstorage-2.25.30/storage/SystemInfo/CmdParted.h 2015-08-24 16:52:23.000000000 +0200 +++ new/libstorage-2.25.33/storage/SystemInfo/CmdParted.h 2015-09-18 15:55:07.000000000 +0200 @@ -113,7 +113,7 @@ * Parse the output of the 'parted' command in 'lines'. * This may throw a ParseException. */ - void parse(const vector<string>& lines); + void parse(const vector<string>& stdout, const vector<string>& stderr); /** * Return the stderr output of parted command. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.30/storage/gen_md5sum.cc new/libstorage-2.25.33/storage/gen_md5sum.cc --- old/libstorage-2.25.30/storage/gen_md5sum.cc 2015-09-01 15:04:18.000000000 +0200 +++ new/libstorage-2.25.33/storage/gen_md5sum.cc 2015-09-09 11:36:52.000000000 +0200 @@ -1,5 +1,5 @@ -#define SOURCES_MD5SUM "73808992d2a2f6fd939c333ca93c4a74" -#define SOURCES_MD5_DATE " Tue 1 Sep 15:04:18 CEST 2015 " +#define SOURCES_MD5SUM "5db1ab4a20c4b339479fab62ca08fd4a" +#define SOURCES_MD5_DATE " Wed 9 Sep 11:36:52 CEST 2015 " namespace storage { const char* GetSourceMd5() { return SOURCES_MD5SUM; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.30/testsuite/parted.cc new/libstorage-2.25.33/testsuite/parted.cc --- old/libstorage-2.25.30/testsuite/parted.cc 2015-06-01 12:05:45.000000000 +0200 +++ new/libstorage-2.25.33/testsuite/parted.cc 2015-09-18 15:55:07.000000000 +0200 @@ -39,7 +39,7 @@ }; Parted parted("/dev/sda", false); - parted.parse(lines); + parted.parse(lines, {}); cout << parted << endl; } @@ -81,7 +81,44 @@ }; Parted parted("/dev/sdb", false); - parted.parse(lines); + parted.parse(lines, {}); + + cout << parted << endl; +} + + +void +parse_gpt_enlarge_good() +{ + TRACE(); + + vector<string> stdout = { + "Model: Maxtor 6 Y080L0 (scsi)", + "Disk /dev/sdb: 9964cyl", + "Sector size (logical/physical): 512B/512B", + "BIOS cylinder,head,sector geometry: 9964,255,63. Each cylinder is 8225kB.", + "Partition Table: gpt", + "Disk Flags: ", + "", + "Number Start End Size File system Name Flags", + "", + "Model: Maxtor 6 Y080L0 (scsi)", + "Disk /dev/sdb: 160086528s", + "Sector size (logical/physical): 512B/512B", + "Partition Table: gpt", + "Disk Flags: ", + "", + "Number Start End Size File system Name Flags", + "" + }; + + vector<string> stderr = { + "Warning: Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 78164480 blocks) or continue with the current setting? ", + "Warning: Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 78164480 blocks) or continue with the current setting? " + }; + + Parted parted("/dev/sdb", false); + parted.parse(stdout, stderr); cout << parted << endl; } @@ -119,7 +156,7 @@ }; Parted parted("/dev/dasda", false); - parted.parse(lines); + parted.parse(lines, {}); cout << parted << endl; } @@ -151,7 +188,7 @@ }; Parted parted("/dev/sdb", false); - parted.parse(lines); + parted.parse(lines, {}); cout << parted << endl; } @@ -184,7 +221,7 @@ }; Parted parted("/dev/dasdc", false); - parted.parse(lines); + parted.parse(lines, {}); cout << parted << endl; } @@ -207,7 +244,7 @@ }; Parted parted("/dev/sdb", false); - parted.parse(lines); + parted.parse(lines, {}); cout << parted << endl; } @@ -268,7 +305,7 @@ try { - parted.parse(lines); + parted.parse(lines, {}); EXCEPTION_EXPECTED(); } catch ( const ParseException &ex ) @@ -310,7 +347,7 @@ try { - parted.parse(lines); + parted.parse(lines, {}); EXCEPTION_EXPECTED(); } catch ( const ParseException &ex ) @@ -352,7 +389,7 @@ try { - parted.parse(lines); + parted.parse(lines, {}); EXCEPTION_EXPECTED(); } catch ( const ParseException &ex ) @@ -385,7 +422,7 @@ try { - parted.parse(lines); + parted.parse(lines, {}); EXCEPTION_EXPECTED(); } catch ( const ParseException &ex ) @@ -427,7 +464,7 @@ try { - parted.parse(lines); + parted.parse(lines, {}); EXCEPTION_EXPECTED(); } catch ( const ParseException &ex ) @@ -461,7 +498,7 @@ try { - parted.parse(lines); + parted.parse(lines, {}); EXCEPTION_EXPECTED(); } catch ( const ParseException &ex ) @@ -505,7 +542,7 @@ try { - parted.parse(lines); + parted.parse(lines, {}); EXCEPTION_EXPECTED(); } catch ( const ParseException &ex ) @@ -557,7 +594,7 @@ try { - parted.parse(lines); + parted.parse(lines, {}); EXCEPTION_EXPECTED(); } catch ( const ParseException &ex ) @@ -578,6 +615,7 @@ parse_msdos_disk_label_good(); parse_gpt_good(); + parse_gpt_enlarge_good(); parse_dasd_good(); parse_loop_good(); parse_dasd_implicit_good(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.25.30/testsuite/single.out/parted.out new/libstorage-2.25.33/testsuite/single.out/parted.out --- old/libstorage-2.25.30/testsuite/single.out/parted.out 2015-06-01 12:05:45.000000000 +0200 +++ new/libstorage-2.25.33/testsuite/single.out/parted.out 2015-09-18 15:55:07.000000000 +0200 @@ -12,6 +12,9 @@ num:5 cylRegion:[36610,263] secRegion:[588140544,4208640] type:primary id:130 num:6 cylRegion:[36872,23929] secRegion:[592349184,384423936] type:primary id:131 +### parse_gpt_enlarge_good() +device:/dev/sdb label:gpt geometry:[9964,255,63,512] gpt_enlarge + ### parse_dasd_good() device:/dev/dasda label:dasd geometry:[178079,15,12,512] num:1 cylRegion:[1,23303] secRegion:[192,4194528] type:primary id:130