[fedora-virt] [RFC/PATCH] libguestfs: build Debian based appliance

Richard W.M. Jones rjones at redhat.com
Tue Jun 30 12:56:09 UTC 2009


On Tue, Jun 30, 2009 at 10:01:59AM +0100, Richard W.M. Jones wrote:
> I'm slightly doubtful about what is going on here, because the tests
> are *supposed* to deal with the case where devices are named /dev/hda
> etc.  See:
> 
> http://libguestfs.org/guestfs.3.html#block_device_naming

OK, I understand what was happening here.

The device name translation stuff mentioned at the link above relied
on the (pre-udev) case where the /dev/sd* nodes would exist, but upon
opening them you'd get ENXIO.

With udev, the device nodes no longer exist, so we get ENOENT.

The simple patch below should fix that case.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 75 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
-------------- next part --------------
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index 7eabbd4..0a3e64f 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -714,7 +714,7 @@ device_name_translation (char *device, const char *func)
     return 0;
   }
 
-  if (errno != ENXIO) {
+  if (errno != ENXIO && errno != ENOENT) {
   error:
     reply_with_perror ("%s: %s", func, device);
     return -1;


More information about the Fedora-virt mailing list