[Libguestfs] [PATCH] daemon: Work around udevsettle issue (RHBZ#548121).
Richard W.M. Jones
rjones at redhat.com
Mon Dec 21 12:28:40 UTC 2009
On Fri, Dec 18, 2009 at 07:25:12PM +0000, Richard W.M. Jones wrote:
> >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);
> }
I verified that this fixes the original build problem on Koji, so
I'm going to push this now.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
More information about the Libguestfs
mailing list