[PATCH 0/9] FOR DISCUSSION ONLY: daemon error handling
The more I look at this patch, the less I like it. I would summarise why I think it's wrong here, but it's better if you look at the message I posted on the gnulib mailing list here first: http://lists.gnu.org/archive/html/bug-gnulib/2009-11/msg00434.html Directly accessing errno on Windows is wrong: you won't see the true reasons for an error by doing that. However depending on what the call is and whether it was replaced by gnulib, the alternatives are a lot more complicated. This patch series attempts to Do The Right Thing with gnulib code as it stands at the moment (assuming my understanding of gnulib error handling is correct -- see above link). I feel however that it's probably better to change gnulib error handling to be more rational. There's also an additional complication I discovered: MinGW error values are often wrong. So that's a MinGW bug to take to the nice upstream folks on the MinGW project. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
-- 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
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
-- 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
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
-- 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
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
On Fri, Nov 27, 2009 at 06:01:56PM +0000, Richard W.M. Jones wrote:
The more I look at this patch, the less I like it.
But I think some patches in this set do make sense to apply anyway: [PATCH 1/9] daemon error handling: Formalize access to errno. - I think the idea of formalizing access to errno, and in particular not having code that saves and restores errno, is a good one. [PATCH 5/9] daemon error handling: fix case_sensitive_path for Windows. - This is really a separate issue and I think we should just apply this one. [PATCH 6/9] daemon error handling: clear errors before all functions - Clearing errno before invoking stub functions seems like a reasonable change to me. It can avoid incorrect error messages in cases where error handling paths that aren't tested very much are wrong, for virtually no cost. [PATCH 7/9] daemon error handling: recursive_mkdir shouldn't need to set errno. - This one is basically a cleanup, it avoids setting errno in order to communicate an error to the local caller, and I think we should apply it. [PATCH 8/9] daemon error handling: Change CHROOT_* macros handling of errno. - Chroot handling in general needs fixing for Win32, but I didn't like the way the macros save and restore errno, and so I think this change makes sense on its own. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
participants (1)
-
Richard W.M. Jones