rpms/libguestfs/devel 0001-Implement-vgrename-and-lvrename-APIs.patch, NONE, 1.1 0002-Fix-regressions-rhbz557655.sh-when-debugging-is-enab.patch, NONE, 1.1 libguestfs.spec, 1.132, 1.133

Richard W.M. Jones rjones at fedoraproject.org
Thu Jan 28 22:40:59 UTC 2010


Author: rjones

Update of /cvs/pkgs/rpms/libguestfs/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6302

Modified Files:
	libguestfs.spec 
Added Files:
	0001-Implement-vgrename-and-lvrename-APIs.patch 
	0002-Fix-regressions-rhbz557655.sh-when-debugging-is-enab.patch 
Log Message:
* Thu Jan 28 2010 Richard W.M. Jones <rjones at redhat.com> - 1.0.82-2
- Backport vgrename/lvrename functions from upstream.
- Backport RHBZ557655 test fix from upstream.


0001-Implement-vgrename-and-lvrename-APIs.patch:
 daemon/lvm.c     |   44 ++++++++++++++++++++++++++++++++++++++++++++
 src/MAX_PROC_NR  |    2 +-
 src/generator.ml |   21 ++++++++++++++++++++-
 3 files changed, 65 insertions(+), 2 deletions(-)

--- NEW FILE 0001-Implement-vgrename-and-lvrename-APIs.patch ---
>From 74fe427460bd2d455d2860c937ae81a8b5a1d1e7 Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones at redhat.com>
Date: Thu, 28 Jan 2010 22:06:27 +0000
Subject: [PATCH 1/2] Implement 'vgrename' and 'lvrename' APIs.

---
 daemon/lvm.c     |   44 ++++++++++++++++++++++++++++++++++++++++++++
 src/MAX_PROC_NR  |    2 +-
 src/generator.ml |   20 ++++++++++++++++++++
 3 files changed, 65 insertions(+), 1 deletions(-)

diff --git a/daemon/lvm.c b/daemon/lvm.c
index 564517c..7a05a54 100644
--- a/daemon/lvm.c
+++ b/daemon/lvm.c
@@ -468,3 +468,47 @@ do_vg_activate_all (int activate)
   char *empty[] = { NULL };
   return do_vg_activate (activate, empty);
 }
+
+int
+do_lvrename (const char *logvol, const char *newlogvol)
+{
+  char *err;
+  int r;
+
+  r = command (NULL, &err,
+               "/sbin/lvm", "lvrename",
+               logvol, newlogvol, NULL);
+  if (r == -1) {
+    reply_with_error ("lvrename: %s -> %s: %s", logvol, newlogvol, err);
+    free (err);
+    return -1;
+  }
+
+  free (err);
+
+  udev_settle ();
+
+  return 0;
+}
+
+int
+do_vgrename (const char *volgroup, const char *newvolgroup)
+{
+  char *err;
+  int r;
+
+  r = command (NULL, &err,
+               "/sbin/lvm", "vgrename",
+               volgroup, newvolgroup, NULL);
+  if (r == -1) {
+    reply_with_error ("vgrename: %s -> %s: %s", volgroup, newvolgroup, err);
+    free (err);
+    return -1;
+  }
+
+  free (err);
+
+  udev_settle ();
+
+  return 0;
+}
diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR
index dc6f4a8..3d4c7bf 100644
--- a/src/MAX_PROC_NR
+++ b/src/MAX_PROC_NR
@@ -1 +1 @@
-218
+220
diff --git a/src/generator.ml b/src/generator.ml
index 58c39e6..6de2c7f 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -4204,6 +4204,26 @@ To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>,
 C<guestfs_is_dir>, C<guestfs_is_file> etc.
 To get the size of block devices, use C<guestfs_blockdev_getsize64>.");
 
+  ("lvrename", (RErr, [String "logvol"; String "newlogvol"]), 219, [],
+   [InitBasicFSonLVM, Always, TestOutputList (
+      [["lvrename"; "/dev/VG/LV"; "/dev/VG/LV2"];
+       ["lvs"]], ["/dev/VG/LV2"])],
+   "rename an LVM logical volume",
+   "\
+Rename a logical volume C<logvol> with the new name C<newlogvol>.");
+
+  ("vgrename", (RErr, [String "volgroup"; String "newvolgroup"]), 220, [],
+   [InitBasicFSonLVM, Always, TestOutputList (
+      [["umount"; "/"];
+       ["vg_activate"; "false"; "VG"];
+       ["vgrename"; "VG"; "VG2"];
+       ["vg_activate"; "true"; "VG2"];
+       ["mount"; "/dev/VG2/LV"; "/"];
+       ["vgs"]], ["VG2"])],
+   "rename an LVM volume group",
+   "\
+Rename a volume group C<volgroup> with the new name C<newvolgroup>.");
+
 ]
 
 let all_functions = non_daemon_functions @ daemon_functions
-- 
1.6.5.2


0002-Fix-regressions-rhbz557655.sh-when-debugging-is-enab.patch:
 rhbz557655.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE 0002-Fix-regressions-rhbz557655.sh-when-debugging-is-enab.patch ---
>From 3cd7ce75f1ce5048a4d9f6aeaf66aff3194e1096 Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones at redhat.com>
Date: Thu, 28 Jan 2010 22:35:16 +0000
Subject: [PATCH 2/2] Fix regressions/rhbz557655.sh when debugging is enabled.

The regression test for RHBZ#557655 would fail if debugging was
enabled, because debug output would get mixed up with the test
output.

To reproduce the error do:

LIBGUESTFS_DEBUG=1 make -C regressions TESTS=rhbz557655.sh check

This commit disables debug for just this test.
---
 regressions/rhbz557655.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/regressions/rhbz557655.sh b/regressions/rhbz557655.sh
index 6ef0b70..aa74bc1 100755
--- a/regressions/rhbz557655.sh
+++ b/regressions/rhbz557655.sh
@@ -23,6 +23,7 @@
 set -e
 rm -f test.out
 export LANG=C
+unset LIBGUESTFS_DEBUG
 
 ../fish/guestfish >> test.out 2>&1 <<EOF
 # set-memsize is just a convenient non-daemon function that
-- 
1.6.5.2



Index: libguestfs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libguestfs/devel/libguestfs.spec,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -p -r1.132 -r1.133
--- libguestfs.spec	28 Jan 2010 19:39:14 -0000	1.132
+++ libguestfs.spec	28 Jan 2010 22:40:58 -0000	1.133
@@ -5,7 +5,7 @@ Summary:     Access and modify virtual m
 Name:        libguestfs
 Epoch:       1
 Version:     1.0.82
-Release:     1%{?dist}
+Release:     2%{?dist}
 License:     LGPLv2+
 Group:       Development/Libraries
 URL:         http://libguestfs.org/
@@ -15,6 +15,12 @@ BuildRoot:   %{_tmppath}/%{name}-%{versi
 # Disable FUSE tests, not supported in Koji at the moment.
 Patch0:      libguestfs-1.0.79-no-fuse-test.patch
 
+# Backport vgrename/lvrename functions from upstream.
+Patch1:      0001-Implement-vgrename-and-lvrename-APIs.patch
+
+# Backport RHBZ557655 test fix from upstream.
+Patch2:      0002-Fix-regressions-rhbz557655.sh-when-debugging-is-enab.patch
+
 # Basic build requirements:
 BuildRequires: /usr/bin/pod2man
 BuildRequires: /usr/bin/pod2text
@@ -334,6 +340,8 @@ Requires:    jpackage-utils
 %setup -q
 
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 mkdir -p daemon/m4
 
@@ -609,6 +617,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Thu Jan 28 2010 Richard W.M. Jones <rjones at redhat.com> - 1.0.82-2
+- Backport vgrename/lvrename functions from upstream.
+- Backport RHBZ557655 test fix from upstream.
+
 * Thu Jan 28 2010 Richard W.M. Jones <rjones at redhat.com> - 1.0.82-1
 - New upstream version 1.0.82.  This includes the two patches
   we were carrying, so those are now removed.



More information about the scm-commits mailing list