Hello community,

here is the log from the commit of package libstorage for openSUSE:Factory 
checked in at 2012-08-13 19:53:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstorage (Old)
 and      /work/SRC/openSUSE:Factory/.libstorage.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libstorage", Maintainer is "aschn...@suse.com"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libstorage/libstorage.changes    2012-08-08 
21:55:13.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libstorage.new/libstorage.changes       
2012-08-13 19:53:54.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Aug 13 16:02:08 CEST 2012 - f...@suse.de
+
+- 2.22.10
+- rename dm maps according to crypttab during update (bnc#774247)
+
+-------------------------------------------------------------------

Old:
----
  libstorage-2.22.9.tar.bz2

New:
----
  libstorage-2.22.10.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libstorage.spec ++++++
--- /var/tmp/diff_new_pack.wmbPD8/_old  2012-08-13 19:54:09.000000000 +0200
+++ /var/tmp/diff_new_pack.wmbPD8/_new  2012-08-13 19:54:09.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           libstorage
-Version:        2.22.9
+Version:        2.22.10
 Release:        0
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source:         libstorage-%{version}.tar.bz2

++++++ libstorage-2.22.9.tar.bz2 -> libstorage-2.22.10.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.9/VERSION 
new/libstorage-2.22.10/VERSION
--- old/libstorage-2.22.9/VERSION       2012-08-08 13:49:37.000000000 +0200
+++ new/libstorage-2.22.10/VERSION      2012-08-13 16:01:13.000000000 +0200
@@ -1 +1 @@
-2.22.9
+2.22.10
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.9/bindings/python/libstorage.py 
new/libstorage-2.22.10/bindings/python/libstorage.py
--- old/libstorage-2.22.9/bindings/python/libstorage.py 2012-08-08 
13:50:30.000000000 +0200
+++ new/libstorage-2.22.10/bindings/python/libstorage.py        2012-08-13 
15:55:54.000000000 +0200
@@ -1306,6 +1306,8 @@
 STORAGE_DEVICE_NOT_FOUND = _libstorage.STORAGE_DEVICE_NOT_FOUND
 STORAGE_BTRFS_CO_NOT_FOUND = _libstorage.STORAGE_BTRFS_CO_NOT_FOUND
 STORAGE_TMPFS_CO_NOT_FOUND = _libstorage.STORAGE_TMPFS_CO_NOT_FOUND
+STORAGE_VOLUME_NOT_ENCRYPTED = _libstorage.STORAGE_VOLUME_NOT_ENCRYPTED
+STORAGE_DM_RENAME_FAILED = _libstorage.STORAGE_DM_RENAME_FAILED
 VOLUME_COMMIT_UNKNOWN_STAGE = _libstorage.VOLUME_COMMIT_UNKNOWN_STAGE
 VOLUME_FSTAB_EMPTY_MOUNT = _libstorage.VOLUME_FSTAB_EMPTY_MOUNT
 VOLUME_UMOUNT_FAILED = _libstorage.VOLUME_UMOUNT_FAILED
@@ -1659,6 +1661,7 @@
     def mountDeviceRo(self, *args): return 
_libstorage.StorageInterface_mountDeviceRo(self, *args)
     def checkDmMapsTo(self, *args): return 
_libstorage.StorageInterface_checkDmMapsTo(self, *args)
     def removeDmTableTo(self, *args): return 
_libstorage.StorageInterface_removeDmTableTo(self, *args)
+    def renameCryptDm(self, *args): return 
_libstorage.StorageInterface_renameCryptDm(self, *args)
     def getFreeInfo(self, *args): return 
_libstorage.StorageInterface_getFreeInfo(self, *args)
     def readFstab(self, *args): return 
_libstorage.StorageInterface_readFstab(self, *args)
     def activateHld(self, *args): return 
_libstorage.StorageInterface_activateHld(self, *args)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.9/storage/Storage.cc 
new/libstorage-2.22.10/storage/Storage.cc
--- old/libstorage-2.22.9/storage/Storage.cc    2012-08-08 13:48:58.000000000 
+0200
+++ new/libstorage-2.22.10/storage/Storage.cc   2012-08-13 15:55:36.000000000 
+0200
@@ -5930,6 +5930,48 @@
     return( ret );
     }
 
+int Storage::renameCryptDm( const string& device, const string& new_name )
+    {
+    y2mil( "device:" << device << " new_name:" << new_name );
+    int ret = 0;
+    VolIterator vol;
+    if( findVolume( device, vol ))
+       {
+        y2mil( "vol:" << *vol );
+        if( vol->dmcrypt() )
+            {
+            string dmnew =  new_name;
+            string::size_type pos = dmnew.find_last_of("/");
+            if( pos!=string::npos )
+                dmnew.erase( 0, pos+1 );
+            string dmold =  vol->dmcryptDevice();
+            pos = dmold.find_last_of("/");
+            if( pos!=string::npos )
+                dmold.erase( 0, pos+1 );
+            y2mil( "dmold:" << dmold << " dmnew:" << dmnew );
+            if( dmnew!=dmold )
+                {
+                if( vol->dmcryptActive() )
+                    {
+                    SystemCmd c(DMSETUPBIN " rename " + dmold + " " + dmnew );
+                    if( c.retcode()!=0 )
+                        ret = STORAGE_DM_RENAME_FAILED;
+                    }
+                if( ret==0 )
+                    vol->setDmcryptDev( "/dev/mapper/"+dmnew, 
vol->dmcryptActive() );
+                }
+            else
+                y2mil( "dmnames already equal" );
+            }
+        else
+            ret = STORAGE_VOLUME_NOT_ENCRYPTED;
+       }
+    else
+       ret = STORAGE_VOLUME_NOT_FOUND;
+    y2mil("ret:" << ret);
+    return( ret );
+    }
+
 
 void
 Storage::logCo(const Container* c) const
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.9/storage/Storage.h 
new/libstorage-2.22.10/storage/Storage.h
--- old/libstorage-2.22.9/storage/Storage.h     2012-08-08 13:48:58.000000000 
+0200
+++ new/libstorage-2.22.10/storage/Storage.h    2012-08-13 15:02:59.000000000 
+0200
@@ -587,6 +587,7 @@
        void removeDmTableTo( const Volume& vol );
        void removeDmTableTo( const string& device );
        void removeDmTableTo( unsigned long mjr, unsigned long mnr );
+        int renameCryptDm( const string& device, const string& new_name );
        bool removeDmTable( const string& table );
        bool removeDmMapsTo( const string& dev );
        bool checkDmMapsTo( const string& dev );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-2.22.9/storage/StorageInterface.h 
new/libstorage-2.22.10/storage/StorageInterface.h
--- old/libstorage-2.22.9/storage/StorageInterface.h    2012-08-08 
13:48:58.000000000 +0200
+++ new/libstorage-2.22.10/storage/StorageInterface.h   2012-08-13 
15:44:01.000000000 +0200
@@ -723,6 +723,8 @@
        STORAGE_DEVICE_NOT_FOUND = -2034,
        STORAGE_BTRFS_CO_NOT_FOUND = -2035,
        STORAGE_TMPFS_CO_NOT_FOUND = -2036,
+       STORAGE_VOLUME_NOT_ENCRYPTED = -2037,
+       STORAGE_DM_RENAME_FAILED = -2038,
 
        VOLUME_COMMIT_UNKNOWN_STAGE = -3000,
        VOLUME_FSTAB_EMPTY_MOUNT = -3001,
@@ -2618,6 +2620,17 @@
        virtual void removeDmTableTo( const string& device ) = 0;
 
        /**
+        * If device has an encrypted dm map, rename it en device
+        *
+        * @param device device name for which dm map should be renamed
+        * @param new_name new dm name used for the device
+        *
+        * @return zero if all is ok, a negative number to indicate an error
+        */
+       virtual int renameCryptDm( const string& device, 
+                                   const string& new_name ) = 0;
+
+       /**
         * Detect potentially available free space on a partition
         *
         * @param device device to check

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to