Compare commits
10 Commits
3e0404a523
...
9ef1d9c14c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ef1d9c14c | ||
|
|
b8f05625f7 | ||
|
|
53de3c05a4 | ||
|
|
762cdada49 | ||
|
|
6b4d35fa95 | ||
|
|
9aca7d7c26 | ||
|
|
8e0eee7357 | ||
|
|
98f68cac3a | ||
|
|
21bfbb3f26 | ||
|
|
1d2d573d15 |
51
0002-fix-bugfix-when-exec-lsmd-help-attach-daemon.patch
Normal file
51
0002-fix-bugfix-when-exec-lsmd-help-attach-daemon.patch
Normal file
@ -0,0 +1,51 @@
|
||||
From 53593fddd4a243c6eb38794d1a4416db11bd5ec2 Mon Sep 17 00:00:00 2001
|
||||
From: Wu Bo <wubo40@huawei.com>
|
||||
Date: Tue, 2 Jun 2020 11:49:10 +0800
|
||||
Subject: [PATCH] fix bugfix when exec lsmd help attach daemon
|
||||
|
||||
$ lsmd --help
|
||||
libStorageMgmt plug-in daemon.
|
||||
lsmd [--plugindir <directory>] [--socketdir <dir>] [-v] [-d]
|
||||
--plugindir = The directory where the plugins are located
|
||||
--socketdir = The directory where the Unix domain sockets will be created
|
||||
--confdir = The directory where the config files are located
|
||||
-v = Verbose logging
|
||||
-d = New style daemon (systemd)
|
||||
$ ps -ef | grep lsmd
|
||||
libstor+ 1366 1 0 Sep23 ? 00:00:00 /usr/bin/lsmd -d
|
||||
|
||||
Signed-off-by: Wu Bo <wubo40@huawei.com>
|
||||
---
|
||||
daemon/lsm_daemon.c | 9 +++++----
|
||||
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/daemon/lsm_daemon.c b/daemon/lsm_daemon.c
|
||||
index dc4df3b..65e337d 100644
|
||||
--- a/daemon/lsm_daemon.c
|
||||
+++ b/daemon/lsm_daemon.c
|
||||
@@ -829,6 +829,11 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
}
|
||||
|
||||
+ if (c == 'h') {
|
||||
+ usage();
|
||||
+ return EXIT_SUCCESS;
|
||||
+ }
|
||||
+
|
||||
switch (c) {
|
||||
case 0:
|
||||
switch (option_index) {
|
||||
@@ -844,10 +849,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
break;
|
||||
|
||||
- case 'h':
|
||||
- usage();
|
||||
- break;
|
||||
-
|
||||
case 'v':
|
||||
verbose_flag = 1;
|
||||
break;
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
From 2ba3527ae5dc345ee91797c6445bb7fe009b02e3 Mon Sep 17 00:00:00 2001
|
||||
From: Tony Asleson <tasleson@redhat.com>
|
||||
Date: Thu, 23 May 2019 14:35:51 -0500
|
||||
Subject: [PATCH 1/2] simarray._block_rounding: Use integer division
|
||||
|
||||
This was causing problems for py2 vs. py3 code. Always use integer
|
||||
division.
|
||||
|
||||
Signed-off-by: Tony Asleson <tasleson@redhat.com>
|
||||
---
|
||||
plugin/sim/simarray.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plugin/sim/simarray.py b/plugin/sim/simarray.py
|
||||
index 6f0a582..bc7817b 100644
|
||||
--- a/plugin/sim/simarray.py
|
||||
+++ b/plugin/sim/simarray.py
|
||||
@@ -1268,7 +1268,7 @@ def _check_pool_free_space(self, sim_pool_id, size_bytes):
|
||||
|
||||
@staticmethod
|
||||
def _block_rounding(size_bytes):
|
||||
- return (size_bytes + BackStore.BLK_SIZE - 1) / \
|
||||
+ return (size_bytes + BackStore.BLK_SIZE - 1) // \
|
||||
BackStore.BLK_SIZE * BackStore.BLK_SIZE
|
||||
|
||||
def sim_vol_create(self, name, size_bytes, sim_pool_id, is_hw_raid_vol=0):
|
||||
--
|
||||
2.37.3.windows.1
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
From 4e8c6efae3bf8c016c560e58771b7a4db7032efe Mon Sep 17 00:00:00 2001
|
||||
From: Tony Asleson <tasleson@redhat.com>
|
||||
Date: Thu, 23 May 2019 14:43:41 -0500
|
||||
Subject: [PATCH 2/2] sim_array [volume|fs]_resize: Change re-size behavior
|
||||
|
||||
The simulator only allows size increments of a block size. The code was
|
||||
returning success if the user specified 1 byte more for the resize, but
|
||||
internally it wasn't updating the size, eg. it was leaving the previous
|
||||
rounded down size. This goes against the documentation for the volume
|
||||
re-size where we may round up for resize. This change rounds up the
|
||||
supplied value. If the rounded up size matches current size we return
|
||||
no state change, else we round up and update the simulator value to match.
|
||||
|
||||
This also matches the expected behavior that when successful the new size
|
||||
will indeed be different, although it may be larger than specified and
|
||||
if the exact operation is repeated, it will fail with no state change.
|
||||
|
||||
Signed-off-by: Tony Asleson <tasleson@redhat.com>
|
||||
---
|
||||
plugin/sim/simarray.py | 22 ++++++----------------
|
||||
1 file changed, 6 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/plugin/sim/simarray.py b/plugin/sim/simarray.py
|
||||
index bc7817b..8552e3d 100644
|
||||
--- a/plugin/sim/simarray.py
|
||||
+++ b/plugin/sim/simarray.py
|
||||
@@ -1367,18 +1367,12 @@ def _sim_ag_ids_of_masked_vol(self, sim_vol_id):
|
||||
'vol_masks', 'vol_id="%s"' % sim_vol_id))
|
||||
|
||||
def sim_vol_resize(self, sim_vol_id, new_size_bytes):
|
||||
- org_new_size_bytes = new_size_bytes
|
||||
new_size_bytes = BackStore._block_rounding(new_size_bytes)
|
||||
sim_vol = self.sim_vol_of_id(sim_vol_id)
|
||||
if sim_vol['total_space'] == new_size_bytes:
|
||||
- if org_new_size_bytes != new_size_bytes:
|
||||
- # Even volume size is identical to rounded size,
|
||||
- # but it's not what user requested, hence we silently pass.
|
||||
- return
|
||||
- else:
|
||||
- raise LsmError(
|
||||
- ErrorNumber.NO_STATE_CHANGE,
|
||||
- "Volume size is identical to requested")
|
||||
+ raise LsmError(
|
||||
+ ErrorNumber.NO_STATE_CHANGE,
|
||||
+ "Volume size is identical to requested")
|
||||
|
||||
sim_pool = self.sim_pool_of_id(sim_vol['pool_id'])
|
||||
|
||||
@@ -1610,17 +1604,13 @@ def sim_fs_delete(self, sim_fs_id):
|
||||
self._data_delete("fss", 'id="%s"' % sim_fs_id)
|
||||
|
||||
def sim_fs_resize(self, sim_fs_id, new_size_bytes):
|
||||
- org_new_size_bytes = new_size_bytes
|
||||
new_size_bytes = BackStore._block_rounding(new_size_bytes)
|
||||
sim_fs = self.sim_fs_of_id(sim_fs_id)
|
||||
|
||||
if sim_fs['total_space'] == new_size_bytes:
|
||||
- if new_size_bytes != org_new_size_bytes:
|
||||
- return
|
||||
- else:
|
||||
- raise LsmError(
|
||||
- ErrorNumber.NO_STATE_CHANGE,
|
||||
- "File System size is identical to requested")
|
||||
+ raise LsmError(
|
||||
+ ErrorNumber.NO_STATE_CHANGE,
|
||||
+ "File System size is identical to requested")
|
||||
|
||||
# TODO(Gris Ge): If a fs is in a clone/snapshot relationship, resize
|
||||
# should be handled properly.
|
||||
--
|
||||
2.37.3.windows.1
|
||||
|
||||
@ -2,13 +2,17 @@
|
||||
%define with_python2 0
|
||||
Name: libstoragemgmt
|
||||
Version: 1.8.0
|
||||
Release: 2
|
||||
Release: 7
|
||||
Summary: Storage array management library
|
||||
License: LGPLv2+
|
||||
URL: https://github.com/libstorage/libstoragemgmt
|
||||
Source0: https://github.com/libstorage/libstoragemgmt/archive/%{name}-%{version}.tar.gz
|
||||
Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch1: 0001-change-run-dir.patch
|
||||
Patch2: 0002-fix-bugfix-when-exec-lsmd-help-attach-daemon.patch
|
||||
|
||||
Patch6000: backport-0001-simarray._block_rounding-Use-integer-division.patch
|
||||
Patch6001: backport-0002-sim_array-volume-fs-_resize-Change-re-size-behavior.patch
|
||||
|
||||
BuildRequires: gcc gcc-c++ autoconf automake libtool libxml2-devel check-devel perl-interpreter
|
||||
BuildRequires: openssl-devel glib2-devel systemd bash-completion libconfig-devel systemd-devel
|
||||
@ -20,6 +24,7 @@ BuildRequires: python2-six python2-devel
|
||||
%endif
|
||||
|
||||
Requires: python3-libstoragemgmt
|
||||
Obsoletes: python2-libstoragemgmt python2-libstoragemgmt-clibs
|
||||
|
||||
%description
|
||||
The libStorageMgmt library will provide a vendor agnostic open source storage
|
||||
@ -99,7 +104,7 @@ smis generic aaray for libstoragemgmt.
|
||||
%package netapp-plugin
|
||||
Summary: netapp files for libstoragemgmt
|
||||
BuildArch: noarch
|
||||
Requires: python3-%{name} = %{version} python3-%{name} = %{version}-%{release}
|
||||
Requires: python3-%{name} = %{version}
|
||||
Requires(post): python3-%{name} = %{version}
|
||||
Requires(postun): python3-%{name} = %{version}
|
||||
Provides: %{name}-targetd-plugin = %{version}-%{release}
|
||||
@ -369,6 +374,21 @@ fi
|
||||
%{_mandir}/man*/*
|
||||
|
||||
%changelog
|
||||
* Sat Jan 7 2023 mengwenhua <mengwenhua@xfusion.com> - 1.8.0-7
|
||||
- Sim fs resize
|
||||
|
||||
* Tue Jul 27 2021 yannglongkang <yanglongkang@huawei.com> - 1.8.0-6
|
||||
- fix bugfix when exec lsmd help attach daemon
|
||||
|
||||
* Tue Sep 29 2020 baizhonggui <baizhonggui@huawei.com> - 1.8.0-5
|
||||
- Modify source0
|
||||
|
||||
* Tue Aug 18 2020 wenzhanli<wenzhanli2@huawei.com> - 1.8.0-4
|
||||
- add release version for update
|
||||
|
||||
* Sat Mar 21 2020 songshuaishuai <songshuaishuai2@huawei.com> - 1.8.0-3
|
||||
- fix update error
|
||||
|
||||
* Mon Mar 16 2020 gulining<gulining1@huawei.com> - 1.8.0-2
|
||||
- remove python2
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user