rpms/libguestfs/devel libguestfs-1.0.80-daemon-Work-around-udevsettle-issue-RHBZ-548121.patch, NONE, 1.1 libguestfs.spec, 1.116, 1.117

Richard W.M. Jones rjones at fedoraproject.org
Fri Dec 18 19:30:31 UTC 2009


Author: rjones

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

Modified Files:
	libguestfs.spec 
Added Files:
	libguestfs-1.0.80-daemon-Work-around-udevsettle-issue-RHBZ-548121.patch 
Log Message:
- Work around udevsettle command problem (RHBZ#548121).
- Enable tests.


libguestfs-1.0.80-daemon-Work-around-udevsettle-issue-RHBZ-548121.patch:
 guestfsd.c |   31 +++++++++----------------------
 1 file changed, 9 insertions(+), 22 deletions(-)

--- NEW FILE libguestfs-1.0.80-daemon-Work-around-udevsettle-issue-RHBZ-548121.patch ---
>From 5c6147ecc7ee3cf657edb1e19ad5ab4e973424e0 Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones at redhat.com>
Date: Fri, 18 Dec 2009 19:20:37 +0000
Subject: [PATCH] daemon: Work around udevsettle issue (RHBZ#548121).

---
 daemon/guestfsd.c |   30 +++++++++---------------------
 1 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index 520a4a4..0fc0128 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -1038,31 +1038,19 @@ device_name_translation (char *device, const char *func)
  * involved.  eg. You can create or remove some device, but the /dev
  * device node won't appear until some time later.  This means that
  * you get an error if you run one command followed by another.
+ *
  * Use 'udevadm settle' after certain commands, but don't be too
  * fussed if it fails.
+ *
+ * 'udevsettle' was the old name for this command (RHEL 5).  This was
+ * deprecated in favour of 'udevadm settle'.  The old 'udevsettle'
+ * command was left as a symlink.  Then in Fedora 13 the old symlink
+ * remained but it stopped working (RHBZ#548121), so we have to be
+ * careful not to assume that we can use 'udevsettle' if it exists.
  */
 void
 udev_settle (void)
 {
-  static int which_prog = 0;
-
-  if (which_prog == 0) {
-    if (access ("/sbin/udevsettle", X_OK) == 0)
-      which_prog = 2;
-    else if (access ("/sbin/udevadm", X_OK) == 0)
-      which_prog = 1;
-    else
-      which_prog = 3;
-  }
-
-  switch (which_prog) {
-  case 1:
-    command (NULL, NULL, "/sbin/udevadm", "settle", NULL);
-    break;
-  case 2:
-    command (NULL, NULL, "/sbin/udevsettle", NULL);
-    break;
-  default:
-    ;
-  }
+  (void) command (NULL, NULL, "/sbin/udevadm", "settle", NULL);
+  (void) command (NULL, NULL, "/sbin/udevsettle", NULL);
 }
-- 
1.6.5.2



Index: libguestfs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libguestfs/devel/libguestfs.spec,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -p -r1.116 -r1.117
--- libguestfs.spec	16 Dec 2009 17:29:58 -0000	1.116
+++ libguestfs.spec	18 Dec 2009 19:30:31 -0000	1.117
@@ -5,7 +5,7 @@ Summary:     Access and modify virtual m
 Name:        libguestfs
 Epoch:       1
 Version:     1.0.80
-Release:     2%{?dist}
+Release:     3%{?dist}
 License:     LGPLv2+
 Group:       Development/Libraries
 URL:         http://libguestfs.org/
@@ -15,6 +15,9 @@ BuildRoot:   %{_tmppath}/%{name}-%{versi
 # Disable FUSE tests, not supported in Koji at the moment.
 Patch0:      libguestfs-1.0.79-no-fuse-test.patch
 
+# Work around udevsettle command broken in Fedora 13 (RHBZ#548121).
+Patch1:      libguestfs-1.0.80-daemon-Work-around-udevsettle-issue-RHBZ-548121.patch
+
 # Basic build requirements:
 BuildRequires: /usr/bin/pod2man
 BuildRequires: /usr/bin/pod2text
@@ -328,6 +331,7 @@ Requires:    jpackage-utils
 %setup -q
 
 %patch0 -p1
+%patch1 -p1
 
 mkdir -p daemon/m4
 
@@ -382,11 +386,11 @@ export LIBGUESTFS_DEBUG=1
 #                                 (FIXED)
 # 516096   ?            F-11   race condition in swapoff/blockdev --rereadpt
 # 516543   ?            F-12   qemu-kvm segfaults when run inside a VM (FIXED)
-# 548121   all          F-13   udevsettle command is broken
+# 548121   all          F-13   udevsettle command is broken (WORKAROUND)
 
-#%ifarch x86_64  # reenable if we fix 548121
-#make check
-#%endif
+%ifarch x86_64
+make check
+%endif
 
 
 %install
@@ -602,6 +606,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Dec 18 2009 Richard W.M. Jones <rjones at redhat.com> - 1.0.80-3
+- Work around udevsettle command problem (RHBZ#548121).
+- Enable tests.
+
 * Wed Dec 16 2009 Richard W.M. Jones <rjones at redhat.com> - 1.0.80-2
 - Disable tests because of RHBZ#548121.
 




More information about the scm-commits mailing list