Mailinglist Archive: yast-commit (396 mails)

< Previous Next >
[yast-commit] r65293 - in /branches/SuSE-Code-11-SP2-Branch/storage: libstorage/src/ package/ storage/src/include/ storage/src/modules/
Author: fehr
Date: Tue Aug 9 16:31:49 2011
New Revision: 65293

URL: http://svn.opensuse.org/viewcvs/yast?rev=65293&view=rev
Log:
fix bugs in subvolume handling during install

Modified:
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.h
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/StorageInterface.h
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc
branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes

branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp

branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_lib.ycp
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/ep-dialogs.ycp
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp

Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc Tue Aug 9
16:31:49 2011
@@ -113,6 +113,22 @@
y2war( "subvolume " << v << " already exists!" );
}

+bool
+Btrfs::existSubvolume( const string& name )
+ {
+ bool ret=false;
+ y2mil( "name:" << name );
+ list<Subvolume>::iterator i=subvol.begin();
+ while( i!=subvol.end() && !ret )
+ {
+ ret = !i->deleted() && i->path()==name && (!getFormat()||i->created());
+ if( !ret )
+ ++i;
+ }
+ y2mil( "ret:" << ret );
+ return( ret );
+ }
+
int
Btrfs::createSubvolume( const string& name )
{
@@ -121,12 +137,16 @@
list<Subvolume>::iterator i=subvol.begin();
while( i!=subvol.end() && !i->deleted() && i->path()!=name )
++i;
- if( i==subvol.end() || getFormat() )
+ if( i==subvol.end() )
{
Subvolume v( name );
v.setCreated();
subvol.push_back( v );
}
+ else if( getFormat() )
+ {
+ i->setCreated();
+ }
else
ret = BTRFS_SUBVOL_EXISTS;
y2mil( "ret:" << ret );
@@ -702,14 +722,30 @@
info.devices_add = boost::join( dev_add, "\n" );
info.devices_rem = boost::join( dev_rem, "\n" );
info.subvol.erase();
+ info.subvol_add.erase();
+ info.subvol_rem.erase();

for( list<Subvolume>::const_iterator i=subvol.begin();
i!=subvol.end(); ++i )
{
- if( !info.subvol.empty() )
- info.subvol += '\n';
- if( !i->deleted() )
- info.subvol += i->path();
+ if( i->deleted() )
+ {
+ if( !info.subvol_rem.empty() )
+ info.subvol_rem += '\n';
+ info.subvol_rem += i->path();
+ }
+ else if( i->created() )
+ {
+ if( !info.subvol_add.empty() )
+ info.subvol_add += '\n';
+ info.subvol_add += i->path();
+ }
+ else
+ {
+ if( !info.subvol.empty() )
+ info.subvol += '\n';
+ info.subvol += i->path();
+ }
}
tinfo = info;
}

Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h Tue Aug 9
16:31:49 2011
@@ -48,6 +48,7 @@
void getDevices( list<string>& devs ) const { devs=devices; }
void getSubvolumes( list<Subvolume>& sv ) const { sv = subvol; }

+ bool existSubvolume( const string& name );
int createSubvolume( const string& name );
int deleteSubvolume( const string& name );
int extendVolume( const string& dev );

Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc
(original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc Tue Aug
9 16:31:49 2011
@@ -174,6 +174,17 @@
vols.push_back(b);
}

+bool BtrfsCo::existSubvolume( const string& device, const string& name )
+ {
+ bool ret = false;
+ y2mil( "device:" << device << " name:" << name );
+ BtrfsIter i;
+ if( findBtrfs( device, i ))
+ ret = i->existSubvolume( name );
+ y2mil( "ret:" << ret );
+ return( ret );
+ }
+
int BtrfsCo::createSubvolume( const string& device, const string& name )
{
int ret = 0;

Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.h?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.h (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.h Tue Aug
9 16:31:49 2011
@@ -46,6 +46,7 @@
void addFromVolume( const Volume& v, string& uuid );
void eraseVolume( Volume* v );

+ bool existSubvolume( const string& device, const string& name );
int createSubvolume( const string& device, const string& name );
int removeSubvolume( const string& device, const string& name );
int extendVolume( const string& device, const string& dev );

Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc
(original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc Tue Aug
9 16:31:49 2011
@@ -4373,6 +4373,20 @@
return( ret );
}

+bool Storage::existSubvolume( const string& device, const string& name )
+ {
+ int ret = false;
+ assertInit();
+ y2mil("device:" << device << " name:" << name);
+ BtrfsCo* co;
+ if( haveBtrfs(co) )
+ {
+ ret = co->existSubvolume( device, name );
+ }
+ y2mil("ret:" << ret);
+ return( ret );
+ }
+
int Storage::createSubvolume( const string& device, const string& name )
{
int ret = 0;

Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.h Tue Aug
9 16:31:49 2011
@@ -540,6 +540,7 @@

int removeDmraid( const string& name );

+ bool existSubvolume( const string& device, const string& name );
int createSubvolume( const string& device, const string& name );
int removeSubvolume( const string& device, const string& name );
int extendBtrfsVolume( const string& device, const string& dev );

Modified:
branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/StorageInterface.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/StorageInterface.h?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/StorageInterface.h
(original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/StorageInterface.h
Tue Aug 9 16:31:49 2011
@@ -540,6 +540,8 @@
string devices_add;
string devices_rem;
string subvol;
+ string subvol_add;
+ string subvol_rem;
};

/**
@@ -2221,6 +2223,15 @@
virtual int removeDmraid( const string& name ) = 0;

/**
+ * Check for existence of a BTRFS subvolume
+ *
+ * @param device of the main BTRFS volume
+ * @param name of subvolume
+ * @return true if subvolume exists, false otherwise
+ */
+ virtual bool existSubvolume( const string& device, const string& name )
= 0;
+
+ /**
* Create a BTRFS subvolume
*
* @param device of the main BTRFS volume

Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc (original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc Tue Aug
9 16:31:49 2011
@@ -725,7 +725,7 @@
else
ret = VOLUME_CANNOT_TMP_MOUNT;
}
- y2mil( "ret:" << " mp:" << m << " needUmount:" << needUmount );
+ y2mil( "ret:" << ret << " mp:" << m << " needUmount:" << needUmount );
return( ret );
}


Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes
(original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Tue
Aug 9 16:31:49 2011
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Aug 9 16:29:08 CEST 2011 - fehr@xxxxxxx
+
+- fix bugs in subvolume handling during install
+
+-------------------------------------------------------------------
Thu Aug 4 17:30:06 CEST 2011 - fehr@xxxxxxx

- avoid crash when btrfs signature is on disk device (bnc#710043)

Modified:
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
---
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp
(original)
+++
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_dialogs.ycp
Tue Aug 9 16:31:49 2011
@@ -1345,13 +1345,20 @@
{
string pth = (string)UI::QueryWidget(`id(`subvol), `CurrentItem);
y2milestone( "SubvolHandling remove path:%1", pth );
+ y2milestone( "SubvolHandling remove subvol:%1", new["subvol"]:[] );
new["subvol"] = maplist( map p, new["subvol"]:[],
{
if( p["name"]:""==pth )
+ {
p["delete"] = true;
+ if( haskey( p, "create" ))
+ p = remove( p, "create" );
+ }
return p;
});
+ y2milestone( "SubvolHandling remove subvol:%1", new["subvol"]:[] );
items = SubvolNames( new );
+ y2milestone( "SubvolHandling remove items:%1", items );
changed = true;
UI::ChangeWidget( `id(`subvol), `Items, items );
}
@@ -1359,9 +1366,10 @@
{
string pth = (string)UI::QueryWidget( `id(`new_path), `Value );
y2milestone( "SubvolHandling add path:%1", pth );
+ y2milestone( "SubvolHandling names:%1", SubvolNames( new ) );
if( pth==nil || size(pth)==0 )
Popup::Message(_("Empty subvolume name not allowed."));
- else if( size(filter( map p, new["subvol"]:[],
``(p["name"]:""==pth)))>0 )
+ else if( size(filter( string s, SubvolNames( new ), ``(s==pth)))>0 )
Popup::Message(sformat(_("Subvolume name %1 already
exists."),pth));
else
{

Modified:
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_lib.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_lib.ycp?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
---
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_lib.ycp
(original)
+++
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/custom_part_lib.ycp
Tue Aug 9 16:31:49 2011
@@ -24,6 +24,7 @@
import "Partitions";
import "Product";
import "FileSystems";
+ import "Greasemonkey";

include "partitioning/partition_defines.ycp";

@@ -370,6 +371,49 @@
return( ret );
}

+define term SubvolPart( boolean can_do_subvol )
+ {
+ term subvol = `Empty();
+ if( can_do_subvol )
+ subvol = `FrameWithMarginBox("", `PushButton( `id(`subvol),
`opt(`hstretch),
+ // button text
+ _("Subvolume Handling")));
+ return( Greasemonkey::Transform(subvol) );
+ }
+
+map<string,any> HandleSubvol( map<string,any> data )
+ {
+ map<string,any> ret = data;
+ if( ret["mount"]:""=="/" )
+ {
+ y2milestone( "before HandleSubvol fs:%1", ret["used_fs"]:`unknown );
+ y2milestone( "before HandleSubvol subvol:%1", ret["subvol"]:[] );
+ if( ret["used_fs"]:`unknown==`btrfs )
+ {
+ if( ret["format"]:false )
+ {
+ list<map> lsc = filter( map s, ret["subvol"]:[],
+ ``(s["create"]:false));
+ y2milestone( "HandleSubvol list:%1", lsc );
+ if( size(lsc)==0 )
+ {
+ ret = (map<string,any>)Storage::AddSubvolRoot( ret );
+ y2milestone( "HandleSubvol AddSubvolRoot subvol:%1",
ret["subvol"]:[] );
+ }
+ }
+ else
+ ret["subvol"] = filter( map s, ret["subvol"]:[],
+
``(!s["create"]:false&&!s["delete"]:false));
+ }
+ else
+ ret["subvol"] = [];
+ y2milestone( "after HandleSubvol subvol:%1", ret["subvol"]:[] );
+ }
+ else
+ ret["subvol"] = [];
+ return( ret );
+ }
+
map pkg_for_fs = $[
`ext2 : [ "e2fsprogs" ],
`ext3 : [ "e2fsprogs" ],
@@ -432,7 +476,7 @@
if( apply_change && UI::WidgetExists( `id(`crypt_fs)) )
{
boolean cr = selected_fs[`crypt]:true &&
- new["type"]:`primary!=`btrfs;
+ new["used_fs"]:`unknown!=`btrfs;
y2milestone( "HandleFsChanged cr:%1", cr );

UI::ChangeWidget( `id(`crypt_fs), `Enabled, cr );
@@ -443,6 +487,15 @@
}
}

+ if( !init && apply_change && UI::WidgetExists( `id(`subvol_rp)) )
+ {
+ boolean sv = new["used_fs"]:`unknown==`btrfs;
+ y2milestone( "HandleFsChanged sv:%1", sv );
+ UI::ReplaceWidget( `id(`subvol_rp), SubvolPart(sv) );
+ if( UI::WidgetExists( `id(`subvol)) )
+ UI::ChangeWidget( `id(`subvol), `Enabled, sv );
+ }
+
if( apply_change )
{
////////////////////////////////////////////////
@@ -494,6 +547,8 @@
{
new["fs_options"] = FileSystems::DefaultFormatOptions(new);
new["fstopt"] = fstopt;
+ y2milestone( "HandleFsChanged fstopt:%1 new[\"fstopt\"]:%2",
+ fstopt, new["fstopt"]:"" );

integer max_len = FileSystems::LabelLength( used_fs );
if( size(new["label"]:"") > max_len )
@@ -510,6 +565,8 @@
{
new["label"] = "";
}
+ if( used_fs!=`btrfs )
+ new["subvol"] = [];
}
}
y2milestone( "HandleFsChanged new %1", new );
@@ -535,11 +592,16 @@
new = filter(string key, any value, new, ``( key != "fstopt"));
}
}
- if( !init && ret == `mount_point &&
- UI::WidgetExists( `id(`fstab_options) ))
+ if( !init && ret==`mount_point )
{
string mp = (string)UI::QueryWidget(`id(`mount_point), `Value);
- UI::ChangeWidget( `id(`fstab_options), `Enabled, !isempty(mp) );
+ if( new["mount"]:""!=mp )
+ {
+ new["mount"] = mp;
+ new = HandleSubvol( new );
+ }
+ if( UI::WidgetExists( `id(`fstab_options) ))
+ UI::ChangeWidget( `id(`fstab_options), `Enabled, !isempty(mp) );
}
if( (init && UI::WidgetExists( `id(`format))) ||
ret == `do_format || ret == `do_not_format)
@@ -577,6 +639,7 @@
if( new["used_fs"]:`unknown != old["used_fs"]:`unknown )
new = HandleFsChanged( init, new, old["used_fs"]:`unknown,
file_systems );
+ new = HandleSubvol( new );
if( format )
{
new["fs_options"] = FileSystems::DefaultFormatOptions(new);
@@ -644,6 +707,7 @@
UI::ChangeWidget( `id(`fsid_point), `Value,
selected_fs[`fsid_item]:"");
}
+ new = HandleSubvol( new );
}
}
}
@@ -709,7 +773,6 @@
}
if( ret == `fstab_options )
{
- new["mount"] = UI::QueryWidget( `id(`mount_point), `Value );
new = FstabOptions( old, new );
}
if( ret == `subvol )

Modified:
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/ep-dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/ep-dialogs.ycp?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/ep-dialogs.ycp
(original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/include/ep-dialogs.ycp
Tue Aug 9 16:31:49 2011
@@ -181,18 +181,16 @@
_("Do not mount partition"));
}

- term subvol = `Empty();
- if( data["used_fs"]:`unknown==`btrfs )
- {
- subvol = `FrameWithMarginBox("", `PushButton( `id(`subvol),
`opt(`hstretch),
- // button text
- _("Subvolume
Handling")));
- }
+ term subvol =
+ `ReplacePoint( `id(`subvol_rp),
+ SubvolPart(data["used_fs"]:`unknown==`btrfs) );

list mountpoints = ProposeMountpoints( used_fs, mount );

- term contents = `HVSquash(`VStackFrames(
- fmt,
+ term contents = `HVSquash(
+ `HBox( fmt,
+ `HSpacing(1),
+ `VStackFrames(
`FrameWithMarginBox(_("Mounting Options"),
`RadioButtonGroup(`id(`mount),
`VBox(
@@ -210,9 +208,10 @@
notmnt
))
),
- subvol
- )
- );
+ subvol,
+ `VStretch()
+ ))
+ );

MiniWorkflow::SetContents(Greasemonkey::Transform(contents),
MiniWorkflowStepFormatMountHelptext());

@@ -449,18 +448,6 @@

if (!data["format"]:false)
data = filter(string key, any value, data, { return key !=
"fs_options"; });
- if( data["mount"]:""=="/" && data["used_fs"]:`unknown==`btrfs &&
- data["format"]:false )
- {
- y2milestone( "before AddSubvolRoot subvol:%1",
data["subvol"]:[] );
- list<map> lsc = filter( map s, data["subvol"]:[],
``(s["create"]:false));
- y2milestone( "before AddSubvolRoot list:%1", lsc );
- if( size(lsc)==0 )
- {
- data = (map<string,any>)Storage::AddSubvolRoot( data );
- y2milestone( "after AddSubvolRoot subvol:%1",
data["subvol"]:[] );
- }
- }

if (contains([`primary, `extended, `logical],
data["type"]:`unknown))
if (data["fsid"]:0 != orig_data["fsid"]:0)

Modified:
branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp?rev=65293&r1=65292&r2=65293&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp
(original)
+++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp
Tue Aug 9 16:31:49 2011
@@ -1707,9 +1707,34 @@
ls = splitstring(
LibStorage::BtrfsInfo::swig_devices_rem_get(info), "\n" );
if( size(ls)>0 )
c["devices_rem"] = ls;
+ list<map> li = [];
+ p["subvol"] = li;
ls = splitstring(LibStorage::BtrfsInfo::swig_subvol_get(info),
"\n");
if( !isempty(ls) )
- p["subvol"] = maplist( string s, ls, ``{ map m = $[ "name" : s
]; return( m ); });
+ {
+ li = maplist( string s, ls,
+ ``{ map m = $[ "name" : s ]; return( m ); });
+ p["subvol"] = li;
+ y2milestone( "subvol:%1", p["subvol"]:[] );
+ }
+ ls = splitstring(LibStorage::BtrfsInfo::swig_subvol_add_get(info),
"\n");
+ if( !isempty(ls) )
+ {
+ li = maplist( string s, ls,
+ ``{ map m = $[ "create":true, "name" : s ];
+ return( m ); });
+ p["subvol"] = union( p["subvol"]:[], li );
+ y2milestone( "subvol:%1", p["subvol"]:[] );
+ }
+ ls = splitstring(LibStorage::BtrfsInfo::swig_subvol_rem_get(info),
"\n");
+ if( !isempty(ls) )
+ {
+ li = maplist( string s, ls,
+ ``{ map m = $[ "delete":true, "name" : s ];
+ return( m ); });
+ p["subvol"] = union( p["subvol"]:[], li );
+ y2milestone( "subvol:%1", p["subvol"]:[] );
+ }
if( size(p["devices"]:[])+size(p["devices_add"]:[])>1 )
p["device"] = "UUID=" + p["uuid"]:"";
c["partitions"] = add( c["partitions"]:[], p );
@@ -2647,29 +2672,35 @@
y2milestone( "ChangeVolumeProperties cre:%1", cre );
while( ret==0 && size(rem)>0 )
{
- changed = true;
string pth = rem[0,"name"]:"";
- ret = LibStorage::StorageInterface::removeSubvolume( sint, d, pth );
- if( ret<0 )
- y2error( "ChangeVolumeProperties sint ret:%1", ret );
- else
+ if( LibStorage::StorageInterface::existSubvolume( sint, d, pth ))
{
- y2milestone( "ChangeVolumeProperties sint ret:%1", ret );
- rem = remove( rem, 0 );
+ changed = true;
+ ret = LibStorage::StorageInterface::removeSubvolume( sint, d,
pth );
+ if( ret<0 )
+ y2error( "ChangeVolumeProperties sint ret:%1", ret );
+ else
+ {
+ y2milestone( "ChangeVolumeProperties sint ret:%1", ret );
+ }
}
+ rem = remove( rem, 0 );
}
while( ret==0 && size(cre)>0 )
{
- changed = true;
string pth = cre[0,"name"]:"";
- ret = LibStorage::StorageInterface::createSubvolume( sint, d, pth );
- if( ret<0 )
- y2error( "ChangeVolumeProperties sint ret:%1", ret );
- else
+ if( !LibStorage::StorageInterface::existSubvolume( sint, d, pth ))
{
- y2milestone( "ChangeVolumeProperties sint ret:%1", ret );
- cre = remove( cre, 0 );
+ changed = true;
+ ret = LibStorage::StorageInterface::createSubvolume( sint, d,
pth );
+ if( ret<0 )
+ y2error( "ChangeVolumeProperties sint ret:%1", ret );
+ else
+ {
+ y2milestone( "ChangeVolumeProperties sint ret:%1", ret );
+ }
}
+ cre = remove( cre, 0 );
}
}
if( ret==0 )

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages