[Libvir] [PATCH] 0/22 Compile libvirt, virsh under MinGW

-- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

This pulls in some extra modules that we need: sys_stat (provides things like the S_* permissions flags which are missing under Windows) vasprintf (asprintf implementation) stdndup strsep poll gettext (portable gettext and <libintl.h> support) getpass (discussed previously) Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:19:27AM +0000, Richard W.M. Jones wrote:
This pulls in some extra modules that we need:
sys_stat (provides things like the S_* permissions flags which are missing under Windows)
vasprintf (asprintf implementation)
stdndup
strsep
poll
gettext (portable gettext and <libintl.h> support)
getpass (discussed previously)
Looks fine to me, I assume you checked the LGPLv2 licence of the new modules imported from gnulib, good to see gnulib helps on many other portbility requirement than just the 2 initial cases, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Daniel Veillard wrote:
On Fri, Dec 07, 2007 at 11:19:27AM +0000, Richard W.M. Jones wrote:
This pulls in some extra modules that we need:
sys_stat (provides things like the S_* permissions flags which are missing under Windows)
vasprintf (asprintf implementation)
stdndup
strsep
poll
gettext (portable gettext and <libintl.h> support)
getpass (discussed previously)
Looks fine to me, I assume you checked the LGPLv2 licence of the new modules imported from gnulib, good to see gnulib helps on many other portbility requirement than just the 2 initial cases,
We already pull in LGPLv3 _header_ files (in CVS right now): float.in.h intprops.h physmem.h stdlib.in.h verify.h and a couple of LGPLv3 C files: dummy.c (but this file is literally trivial) physmem.c (However the documentation for physmem says the module is under LGPLv2+ so either the documentation is wrong or the top of the file is wrong or else I don't understand what's going on here). Unfortunately although all the modules above are LGPLv2, I just noticed that getpass depends indirectly on realloc. Documentation for realloc says its LGPLv2+ so I didn't think it was a problem, but the top of the file says LGPLv3. License lawyers, on your marks ... Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

"Richard W.M. Jones" <rjones@redhat.com> wrote:
Daniel Veillard wrote:
On Fri, Dec 07, 2007 at 11:19:27AM +0000, Richard W.M. Jones wrote:
This pulls in some extra modules that we need:
sys_stat (provides things like the S_* permissions flags which are missing under Windows)
vasprintf (asprintf implementation)
stdndup
strsep
poll
gettext (portable gettext and <libintl.h> support)
getpass (discussed previously)
Looks fine to me, I assume you checked the LGPLv2 licence of the new modules imported from gnulib, good to see gnulib helps on many other portbility requirement than just the 2 initial cases,
We already pull in LGPLv3 _header_ files (in CVS right now):
float.in.h intprops.h physmem.h stdlib.in.h verify.h
and a couple of LGPLv3 C files:
dummy.c (but this file is literally trivial) physmem.c
(However the documentation for physmem says the module is under LGPLv2+ so either the documentation is wrong or the top of the file is wrong or else I don't understand what's going on here).
Unfortunately although all the modules above are LGPLv2, I just noticed that getpass depends indirectly on realloc. Documentation for realloc says its LGPLv2+ so I didn't think it was a problem, but the top of the file says LGPLv3.
License lawyers, on your marks ...
Don't worry. Perhaps gnulib-tool isn't transforming the licenses properly (yes, it is supposed to do this). physmem is most definitely LGPLv2+ because I just changed it. The definitive source is gnulib's modules/physmem file: License: LGPLv2+ I'm looking into why gnulib-tool isn't working as expected.

"Richard W.M. Jones" <rjones@redhat.com> wrote:
(However the documentation for physmem says the module is under LGPLv2+ so either the documentation is wrong or the top of the file is wrong or else I don't understand what's going on here).
Unfortunately although all the modules above are LGPLv2, I just noticed that getpass depends indirectly on realloc. Documentation for realloc says its LGPLv2+ so I didn't think it was a problem, but the top of the file says LGPLv3.
Using gnulib-tools' --lgpl=2 option fixes this. That will cause the copyright notices to be rewritten. However, that currently excludes *all* of the unit tests, because these tests rely on LGPLv3 modules. So the easiest solution (though it's unfortunate for both libvirt and gnulib) is to give up those unit tests: i.e., to remove the --with-tests option below. And without the tests, there's no need for the three --avoid= options: diff --git a/bootstrap b/bootstrap index 73ad3f6..474f4a8 100755 --- a/bootstrap +++ b/bootstrap @@ -92,15 +92,11 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool avoid='--avoid=snprintf' avoid=' - --avoid=snprintf-tests - --avoid=vasnprintf-tests - --avoid=alloca-opt-tests ' $gnulib_tool \ - --lgpl \ + --lgpl=2 \ $avoid \ - --with-tests \ --m4-base=gnulib/m4 \ --source-base=gnulib/lib \ --tests-base=gnulib/tests \ That empties the gnulib/tests directory of all its *.c files, but I'd like to leave it (with just Makefile.am), in the hopes we can work out a compromise that lets us use the tests again. I'll prepare a patch along these lines.

Jim Meyering wrote:
diff --git a/bootstrap b/bootstrap index 73ad3f6..474f4a8 100755 --- a/bootstrap +++ b/bootstrap @@ -92,15 +92,11 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool avoid='--avoid=snprintf'
avoid=' - --avoid=snprintf-tests - --avoid=vasnprintf-tests - --avoid=alloca-opt-tests '
$gnulib_tool \ - --lgpl \ + --lgpl=2 \ $avoid \ - --with-tests \ --m4-base=gnulib/m4 \ --source-base=gnulib/lib \ --tests-base=gnulib/tests \
That empties the gnulib/tests directory of all its *.c files, but I'd like to leave it (with just Makefile.am), in the hopes we can work out a compromise that lets us use the tests again.
I'll prepare a patch along these lines.
Don't worry, I'll make this change. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

Jim Meyering <jim@meyering.net> wrote:
"Richard W.M. Jones" <rjones@redhat.com> wrote:
(However the documentation for physmem says the module is under LGPLv2+ so either the documentation is wrong or the top of the file is wrong or else I don't understand what's going on here).
Unfortunately although all the modules above are LGPLv2, I just noticed that getpass depends indirectly on realloc. Documentation for realloc says its LGPLv2+ so I didn't think it was a problem, but the top of the file says LGPLv3.
Using gnulib-tools' --lgpl=2 option fixes this. That will cause the copyright notices to be rewritten. However, that currently excludes *all* of the unit tests, because these tests rely on LGPLv3 modules. So the easiest solution (though it's unfortunate for both libvirt and gnulib) is to give up those unit tests: i.e., to remove the --with-tests option below. And without the tests, there's no need for the three --avoid= options:
diff --git a/bootstrap b/bootstrap index 73ad3f6..474f4a8 100755 --- a/bootstrap +++ b/bootstrap
FYI, The new bootstrap script will end with: ... gnulib_tool=$GNULIB_SRCDIR/gnulib-tool <$gnulib_tool || exit # Tell gnulib to: # require LGPLv2+ # put *.m4 files in new gnulib/m4/ dir # put *.[ch] files in new gnulib/lib/ dir. $gnulib_tool \ --lgpl=2 \ --m4-base=gnulib/m4 \ --source-base=gnulib/lib \ --import physmem getaddrinfo rm -f \ .gitignore \ gnulib/lib/.gitignore \ gnulib/m4/.gitignore \ gnulib/tests/.gitignore (cd gnulib/lib && (cat .cvsignore; \ ls -1 *.in.h|sed 's/\.in\.h/.h/') | sort -u > .t; mv .t .cvsignore)

Changes configure to test for extra functions and headers which are missing on Windows. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

"Richard W.M. Jones" <rjones@redhat.com> wrote:
Changes configure to test for extra functions and headers which are missing on Windows. ... Index: configure.in =================================================================== RCS file: /data/cvs/libvirt/configure.in,v retrieving revision 1.111 diff -u -r1.111 configure.in --- configure.in 6 Dec 2007 16:34:48 -0000 1.111 +++ configure.in 7 Dec 2007 10:38:49 -0000 @@ -60,10 +60,10 @@ LIBVIRT_COMPILE_WARNINGS(maximum)
dnl Availability of various common functions (non-fatal if missing). -AC_CHECK_FUNCS([regexec cfmakeraw]) +AC_CHECK_FUNCS([cfmakeraw regexec uname])
dnl Availability of various common headers (non-fatal if missing). -AC_CHECK_HEADERS([paths.h sys/syslimits.h]) +AC_CHECK_HEADERS(pwd.h paths.h sys/syslimits.h sys/utsname.h sys/wait.h winsock2.h)
Not a big deal, but it's a little better not to remove those quotes ([]). The risk is really minimal (who's going to define an m4 macro named sys, pwd, paths, etc?) but good practice. There's plenty of "underquoting" in just about any configure.in script you care to look at. +1 on patches 1..6

On Fri, Dec 07, 2007 at 11:20:10AM +0000, Richard W.M. Jones wrote:
Changes configure to test for extra functions and headers which are missing on Windows.
looks just fine, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Dec 07, 2007 at 11:20:10AM +0000, Richard W.M. Jones wrote:
Changes configure to test for extra functions and headers which are missing on Windows.
ACK with Jim's suggestion not to remove [] Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

And as a result of pulling in more modules, we get 3 extra subdirectories which need .cvsignore too. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:21:11AM +0000, Richard W.M. Jones wrote:
And as a result of pulling in more modules, we get 3 extra subdirectories which need .cvsignore too.
Rich.
-- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
Index: gnulib/lib/.cvsignore =================================================================== RCS file: /data/cvs/libvirt/gnulib/lib/.cvsignore,v retrieving revision 1.1 diff -u -r1.1 .cvsignore --- gnulib/lib/.cvsignore 5 Dec 2007 21:35:32 -0000 1.1 +++ gnulib/lib/.cvsignore 7 Dec 2007 10:39:52 -0000 @@ -1,11 +1,39 @@ +.deps +.libs +*.lo +*.la +Makefile +Makefile.in alloca.h +asprintf.c float.h +fseeko.c +getdelim.c +getline.c +getpass.c +getpass.h +lseek.c netinet_in.h +poll.c +poll.h +poll.in.h +realloc.c
That I don't understand clearly. you mean the .c files are now generated by the Makefile rules ? I assume it will get clearer with the other patches. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Daniel Veillard <veillard@redhat.com> wrote: ...
Index: gnulib/lib/.cvsignore =================================================================== RCS file: /data/cvs/libvirt/gnulib/lib/.cvsignore,v retrieving revision 1.1 diff -u -r1.1 .cvsignore --- gnulib/lib/.cvsignore 5 Dec 2007 21:35:32 -0000 1.1 +++ gnulib/lib/.cvsignore 7 Dec 2007 10:39:52 -0000 @@ -1,11 +1,39 @@ +.deps +.libs +*.lo +*.la +Makefile +Makefile.in alloca.h +asprintf.c float.h +fseeko.c +getdelim.c +getline.c +getpass.c +getpass.h +lseek.c netinet_in.h +poll.c +poll.h +poll.in.h +realloc.c
That I don't understand clearly. you mean the .c files are now generated by the Makefile rules ? I assume it will get clearer with the other patches.
Good catch. It shouldn't ignore those *.c files. Nor the *.in.h ones. However, adding the first six lines and poll.h is fine. The files to be ignored in gnulib/lib are only those (.h usually) generated by Makefile rules. This snippet from bootstrap tried to do the right thing: (cd gnulib/lib && (cat .cvsignore; \ ls -1 *.in.h|sed 's/\.in\.h/.h/') | sort -u > .t; mv .t .cvsignore)

Jim Meyering wrote:
Daniel Veillard <veillard@redhat.com> wrote: ...
Index: gnulib/lib/.cvsignore =================================================================== RCS file: /data/cvs/libvirt/gnulib/lib/.cvsignore,v retrieving revision 1.1 diff -u -r1.1 .cvsignore --- gnulib/lib/.cvsignore 5 Dec 2007 21:35:32 -0000 1.1 +++ gnulib/lib/.cvsignore 7 Dec 2007 10:39:52 -0000 @@ -1,11 +1,39 @@ +.deps +.libs +*.lo +*.la +Makefile +Makefile.in alloca.h +asprintf.c float.h +fseeko.c +getdelim.c +getline.c +getpass.c +getpass.h +lseek.c netinet_in.h +poll.c +poll.h +poll.in.h +realloc.c That I don't understand clearly. you mean the .c files are now generated by the Makefile rules ? I assume it will get clearer with the other patches.
Good catch. It shouldn't ignore those *.c files. Nor the *.in.h ones. However, adding the first six lines and poll.h is fine.
The files to be ignored in gnulib/lib are only those (.h usually) generated by Makefile rules. This snippet from bootstrap tried to do the right thing:
(cd gnulib/lib && (cat .cvsignore; \ ls -1 *.in.h|sed 's/\.in\.h/.h/') | sort -u > .t; mv .t .cvsignore)
Ah, light comes on. I was wondering for ages what is was that seemed to regenerate the .cvsignore file :-) Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

Jim Meyering wrote:
(cd gnulib/lib && (cat .cvsignore; \ ls -1 *.in.h|sed 's/\.in\.h/.h/') | sort -u > .t; mv .t .cvsignore)
So this snippet isn't quite right because for a subdirectory the .in.h file might be called something like 'sys_stat.in.h' which is transformed into 'sys/stat.h'. I've added the right .cvsignore files by hand. I've also removed the *.c ignores above, not sure how they got in there because I certainly didn't add them myself. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

"Richard W.M. Jones" <rjones@redhat.com> wrote:
Jim Meyering wrote:
(cd gnulib/lib && (cat .cvsignore; \ ls -1 *.in.h|sed 's/\.in\.h/.h/') | sort -u > .t; mv .t .cvsignore)
So this snippet isn't quite right because for a subdirectory the .in.h file might be called something like 'sys_stat.in.h' which is transformed into 'sys/stat.h'. I've added the right .cvsignore files by hand.
I've also removed the *.c ignores above, not sure how they got in there because I certainly didn't add them myself.
Most projects that use gnulib do *not* version control the sources, so for them it's required to ignore everything. So gnulib-tool adds those *.c names to .cvsignore files. Since libvirt is at least the second project that is adamant about version-controlling gnulib-tool-pulled sources, I plan to add an option to gnulib-tool to make it's .cvsignore-writing behavior do what libvirt wants.

Moves the check for WITH_XEN higher so we don't needlessly compile header files when they won't be needed. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:22:09AM +0000, Richard W.M. Jones wrote:
Moves the check for WITH_XEN higher so we don't needlessly compile header files when they won't be needed.
Sensible, +1, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Dec 07, 2007 at 11:22:09AM +0000, Richard W.M. Jones wrote:
Moves the check for WITH_XEN higher so we don't needlessly compile header files when they won't be needed.
Can't we remove this WITH_XEN entirely ? The configure script and Makefile.am are setup so that the proxy is (supposed to) not be compiled at iff if WITH_PROXY is not defined. And WITH_PROXY depends on existance of Xen Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

What are these files? No idea but we get "loTs" of them under Windows (bum bum!) Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:22:49AM +0000, Richard W.M. Jones wrote:
What are these files? No idea but we get "loTs" of them under Windows (bum bum!)
No idea either, +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Dec 07, 2007 at 11:22:49AM +0000, Richard W.M. Jones wrote:
What are these files? No idea but we get "loTs" of them under Windows (bum bum!)
They're just one of many things libtool splatters around - not entirely sure of the circumstances in which it does it, but I've hit them under Linux every now & then too. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

Under MinGW we don't have anything like termcap. This disables the console in virsh, replacing "virsh console" with an error message. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:24:15AM +0000, Richard W.M. Jones wrote:
Under MinGW we don't have anything like termcap. This disables the console in virsh, replacing "virsh console" with an error message.
Looks fine, maybe the message could be a bit more open, using for example 'platform' instead of 'Win32', Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Dec 07, 2007 at 11:24:15AM +0000, Richard W.M. Jones wrote:
Under MinGW we don't have anything like termcap. This disables the console in virsh, replacing "virsh console" with an error message.
More fundamentally, the console is intended to connect to /dev/pts/XXX associate with guest VMs. Since we're not running any VMs on Windows there's no /dev/pts to connect to so the command is pointless anyway. The console command should also look at the URI to see if its a remote style URI, and refuse to do anything in that case even for Linux. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

There is no uid_t or getuid in MinGW. I'm not really sure that forcing connections readonly if the user is non-root is a useful thing to be doing anyway, so perhaps this code is better off just being deleted? Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

"Richard W.M. Jones" <rjones@redhat.com> wrote:
There is no uid_t or getuid in MinGW.
I'm not really sure that forcing connections readonly if the user is non-root is a useful thing to be doing anyway, so perhaps this code is better off just being deleted?
For the missing uid_t, you could add this to configure.in AC_CHECK_TYPE(mode_t, int) then no need for ifndef around the decl of "uid". With this function (and a test for getuid in configure.in), (or maybe that should be "return 0"?) #ifndef HAVE_GETUID static int getuid() { return 1; } #endif /* __MINGW32__ */ you could avoid the remaining ifdefs.
-- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Rich.
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903 Index: src/virsh.c =================================================================== RCS file: /data/cvs/libvirt/src/virsh.c,v retrieving revision 1.118 diff -u -r1.118 virsh.c --- src/virsh.c 6 Dec 2007 16:36:21 -0000 1.118 +++ src/virsh.c 7 Dec 2007 10:44:05 -0000 @@ -202,7 +202,9 @@ virConnectPtr conn; /* connection to hypervisor (MAY BE NULL) */ vshCmd *cmd; /* the current command */ char *cmdstr; /* string with command */ +#ifndef __MINGW32__ uid_t uid; /* process owner */ +#endif /* __MINGW32__ */ int imode; /* interactive mode? */ int quiet; /* quiet mode */ int debug; /* print debug messages? */ @@ -4508,17 +4523,21 @@ if (ctl->conn) return FALSE;
+#ifndef __MINGW32__ ctl->uid = getuid(); +#endif
vshOpenLogFile(ctl);
/* set up the library error handler */ virSetErrorFunc(NULL, virshErrorHandler);
+#ifndef __MINGW32__ /* Force a non-root, Xen connection to readonly */ if ((ctl->name == NULL || !strcasecmp(ctl->name, "xen")) && ctl->uid != 0) ctl->readonly = 1; +#endif

On Fri, Dec 07, 2007 at 12:42:35PM +0100, Jim Meyering wrote:
"Richard W.M. Jones" <rjones@redhat.com> wrote:
There is no uid_t or getuid in MinGW.
I'm not really sure that forcing connections readonly if the user is non-root is a useful thing to be doing anyway, so perhaps this code is better off just being deleted?
For the missing uid_t, you could add this to configure.in AC_CHECK_TYPE(mode_t, int) then no need for ifndef around the decl of "uid".
With this function (and a test for getuid in configure.in), (or maybe that should be "return 0"?)
#ifndef HAVE_GETUID static int getuid() { return 1; } #endif /* __MINGW32__ */
you could avoid the remaining ifdefs.
Sounds better, maybe return -1 to indicate it is a failure, though uid_t should be unsigned, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Jim Meyering wrote:
"Richard W.M. Jones" <rjones@redhat.com> wrote:
There is no uid_t or getuid in MinGW.
I'm not really sure that forcing connections readonly if the user is non-root is a useful thing to be doing anyway, so perhaps this code is better off just being deleted?
For the missing uid_t, you could add this to configure.in AC_CHECK_TYPE(mode_t, int) then no need for ifndef around the decl of "uid".
autoconf docs seem to suggest that this usage is deprecated: <quote> -- Macro: AC_CHECK_TYPE (TYPE, DEFAULT) Autoconf, up to 2.13, used to provide this version of `AC_CHECK_TYPE', deprecated because of its flaws. First, although it is a member of the `CHECK' clan, it does more than just checking. Secondly, missing types are defined using `#define', not `typedef', and this can lead to problems in the case of pointer types. </quote>
With this function (and a test for getuid in configure.in), (or maybe that should be "return 0"?)
#ifndef HAVE_GETUID static int getuid() { return 1; } #endif /* __MINGW32__ */
you could avoid the remaining ifdefs.
Better just to check for getuid? Having said that I still think it'd be better just to delete this code because forcing non-root Xen connections to be readonly doesn't seem very useful to me. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

"Richard W.M. Jones" <rjones@redhat.com> wrote:
Jim Meyering wrote:
"Richard W.M. Jones" <rjones@redhat.com> wrote:
There is no uid_t or getuid in MinGW.
I'm not really sure that forcing connections readonly if the user is non-root is a useful thing to be doing anyway, so perhaps this code is better off just being deleted?
For the missing uid_t, you could add this to configure.in AC_CHECK_TYPE(mode_t, int) then no need for ifndef around the decl of "uid".
autoconf docs seem to suggest that this usage is deprecated:
<quote> -- Macro: AC_CHECK_TYPE (TYPE, DEFAULT) Autoconf, up to 2.13, used to provide this version of `AC_CHECK_TYPE', deprecated because of its flaws. First, although it is a member of the `CHECK' clan, it does more than just checking. Secondly, missing types are defined using `#define', not `typedef', and this can lead to problems in the case of pointer types. </quote>
Good catch. I forgot there's a specific macro for that type: AC_TYPE_UID_T For some others, like socklen_t, sigset_t, sig_atomic_t, you do have use AC_CHECK_TYPE, so that comment needs some clarification.
With this function (and a test for getuid in configure.in), (or maybe that should be "return 0"?)
#ifndef HAVE_GETUID static int getuid() { return 1; }
Oops. In case it's not all moot -- if this code is removed -- That should be s/int/uid_t/, of course.
#endif /* __MINGW32__ */
you could avoid the remaining ifdefs.
Better just to check for getuid?
Having said that I still think it'd be better just to delete this code because forcing non-root Xen connections to be readonly doesn't seem very useful to me.

There is no O_SYNC in the Win32 API. This general patch disables it as suggested by Jim Meyering yesterday. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:27:23AM +0000, Richard W.M. Jones wrote:
There is no O_SYNC in the Win32 API. This general patch disables it as suggested by Jim Meyering yesterday.
Fine to me, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

This patch enables the Gnulib version of gettext. Note that gettext_noop is defined in Gnulib "gettext.h". Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

No INET_ADDRSTRLEN in Winsock. Instead we hard-code it if not available, as with the other limits. I checked and users of this are safe provided that it's at least some rather small size. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

This disables iptables if configured --without-qemu. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:31:22AM +0000, Richard W.M. Jones wrote:
This disables iptables if configured --without-qemu.
ACK Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

Stupid Microsoft cruft and pollution. Winsock needs to be initialised before use! Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:32:09AM +0000, Richard W.M. Jones wrote:
Stupid Microsoft cruft and pollution. Winsock needs to be initialised before use!
Could be separated as a distinct function, but fine, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Dec 07, 2007 at 11:32:09AM +0000, Richard W.M. Jones wrote:
Stupid Microsoft cruft and pollution. Winsock needs to be initialised before use!
ACK Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

Enable Gnulib implementation of getpass. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

Richard W.M. Jones wrote:
Enable Gnulib implementation of getpass.
Probably need a patch to go with that one ... Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:33:16AM +0000, Richard W.M. Jones wrote:
Richard W.M. Jones wrote:
Enable Gnulib implementation of getpass.
Probably need a patch to go with that one ...
+1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Windows doesn't have uname or <sys/utsname.h>. We can't get the model info without more delving into the Win32 API. This just disables the functionality temporarily, but a proper fix will be to find out how to do this under Windows. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:34:56AM +0000, Richard W.M. Jones wrote:
Windows doesn't have uname or <sys/utsname.h>.
We can't get the model info without more delving into the Win32 API. This just disables the functionality temporarily, but a proper fix will be to find out how to do this under Windows.
+1 , but raises a question to me, we don't really expect to use libvirt to drive virtualization on Windows but just for remote access, right ? In that case the Node in question can only be remote and not having an implementation is just fine. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Daniel Veillard wrote:
On Fri, Dec 07, 2007 at 11:34:56AM +0000, Richard W.M. Jones wrote:
Windows doesn't have uname or <sys/utsname.h>.
We can't get the model info without more delving into the Win32 API. This just disables the functionality temporarily, but a proper fix will be to find out how to do this under Windows.
+1 , but raises a question to me, we don't really expect to use libvirt to drive virtualization on Windows but just for remote access, right ? In that case the Node in question can only be remote and not having an implementation is just fine.
This is true. Even the test driver (the only non-remote driver on Windows) wouldn't use it. However I guess that qemu could work on Windows and then this code could become active ... if someone was sufficiently motivated in future to enable qemu support. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:34:56AM +0000, Richard W.M. Jones wrote:
Windows doesn't have uname or <sys/utsname.h>.
We can't get the model info without more delving into the Win32 API. This just disables the functionality temporarily, but a proper fix will be to find out how to do this under Windows.
Could simply disable the nodeinfo.c file entirely. Its only used by the QEMU driver so not really needed on Windows Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

As reasoned earlier, if there's no Xen there can be no proxy, so there's no need to build the client side of the proxy driver. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:35:46AM +0000, Richard W.M. Jones wrote:
As reasoned earlier, if there's no Xen there can be no proxy, so there's no need to build the client side of the proxy driver.
Sure, +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Dec 07, 2007 at 11:35:46AM +0000, Richard W.M. Jones wrote:
As reasoned earlier, if there's no Xen there can be no proxy, so there's no need to build the client side of the proxy driver.
The configure script already provides a 'WITH_PROXY' symbol for this which should be used in preference to WITH_XEN Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

This was my attempt to get uid_t type, which in fact isn't present at all. I will check later if this is still necessary and get back. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:39:11AM +0000, Richard W.M. Jones wrote:
This was my attempt to get uid_t type, which in fact isn't present at all. I will check later if this is still necessary and get back.
The man page suggests sys/types.h ought to have uid_t Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

This enables the use of getaddrinfo under Windows (requires inclusion of the "getaddrinfo.h" header from gnulib). AI_ADDRCONFIG isn't supported by the gnulib emulation of getaddrinfo. There is some controversy as to whether this flag actually does anything useful. http://www.google.co.uk/search?q=AI_ADDRCONFIG Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

"Richard W.M. Jones" <rjones@redhat.com> wrote:
This enables the use of getaddrinfo under Windows (requires inclusion of the "getaddrinfo.h" header from gnulib).
AI_ADDRCONFIG isn't supported by the gnulib emulation of getaddrinfo. There is some controversy as to whether this flag actually does anything useful. http://www.google.co.uk/search?q=AI_ADDRCONFIG
I don't know enough to comment. If there's a good case for it, it belongs in gnulib. If you add this, you can avoid adding those in-function #ifdefs: Slightly cleaner, imho, even if you get a redundant (and probably compiler-eliminated) store instruction on losing systems: #ifndef AI_ADDRCONFIG # define AI_ADDRCONFIG 0 #endif
+++ src/remote_internal.c 7 Dec 2007 10:59:51 -0000 @@ -51,6 +65,8 @@ #endif #include <libxml/uri.h>
+#include "getaddrinfo.h" + #include "internal.h" #include "driver.h" #include "getaddrinfo.h" @@ -492,7 +509,9 @@ struct addrinfo hints; memset (&hints, 0, sizeof hints); hints.ai_socktype = SOCK_STREAM; +#ifdef AI_ADDRCONFIG hints.ai_flags = AI_ADDRCONFIG; +#endif

On Fri, Dec 07, 2007 at 11:41:22AM +0000, Richard W.M. Jones wrote:
This enables the use of getaddrinfo under Windows (requires inclusion of the "getaddrinfo.h" header from gnulib).
AI_ADDRCONFIG isn't supported by the gnulib emulation of getaddrinfo. There is some controversy as to whether this flag actually does anything useful. http://www.google.co.uk/search?q=AI_ADDRCONFIG
As someone actually using IPv6 on my network I can say AI_ADDRCONFIG does work and is important. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

Miscellaneous changes to headers. The important one is that if <winsock2.h> is available then that replaces all of the usual socket- and network database-related headers (which are not available in Windows). Thus you end up with code like this: #ifndef HAVE_WINSOCK2_H #include <sys/socket.h> #include <netdb.h> #include <netinet/in.h> #else #include <winsock2.h> #endif Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:43:46AM +0000, Richard W.M. Jones wrote:
Miscellaneous changes to headers. The important one is that if <winsock2.h> is available then that replaces all of the usual socket- and network database-related headers (which are not available in Windows). Thus you end up with code like this:
#ifndef HAVE_WINSOCK2_H #include <sys/socket.h> #include <netdb.h> #include <netinet/in.h> #else #include <winsock2.h> #endif
I looked quickly how it's dome in libxml2, there we use _WINSOCKAPI_ as the define to select the Windows networking API (apparently a standard define of Microsoft) and we have a wsockcompat.h which does some remapping of the BSD interfaces onto winsock.h/winsock2.h . Lets keep things simple as you did with gnulib and if people want to compile on the various MS compilers, well we take patches :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Daniel Veillard wrote:
On Fri, Dec 07, 2007 at 11:43:46AM +0000, Richard W.M. Jones wrote:
Miscellaneous changes to headers. The important one is that if <winsock2.h> is available then that replaces all of the usual socket- and network database-related headers (which are not available in Windows). Thus you end up with code like this:
#ifndef HAVE_WINSOCK2_H #include <sys/socket.h> #include <netdb.h> #include <netinet/in.h> #else #include <winsock2.h> #endif
I looked quickly how it's dome in libxml2, there we use _WINSOCKAPI_ as the define to select the Windows networking API (apparently a standard define of Microsoft) and we have a wsockcompat.h which does some remapping of the BSD interfaces onto winsock.h/winsock2.h . Lets keep things simple as you did with gnulib and if people want to compile on the various MS compilers, well we take patches :-)
Yes, wsockcompat looks particularly useful. Might copy it for the XDR implementation. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

.. because it's a lot simpler than actually implementing them. The user will see an error message to this effect if they try to use them. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:45:18AM +0000, Richard W.M. Jones wrote:
.. because it's a lot simpler than actually implementing them. The user will see an error message to this effect if they try to use them.
ACK, now we have kerberos and username/passwd support there's little reason to care about tunnelling over SSH, or other transport, and UNIX sockets are meaningless. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

A bit of header file rearrangement. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:46:07AM +0000, Richard W.M. Jones wrote:
A bit of header file rearrangement.
Makes sense, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Dec 07, 2007 at 11:46:07AM +0000, Richard W.M. Jones wrote:
A bit of header file rearrangement.
ACK Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

It's not likely that the external programs will actually exist on MinGW anyway, so execing them isn't very useful. This also removes the virFileLinkPointsTo function, which I think is only used by libvirtd anyway. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:47:23AM +0000, Richard W.M. Jones wrote:
It's not likely that the external programs will actually exist on MinGW anyway, so execing them isn't very useful.
This also removes the virFileLinkPointsTo function, which I think is only used by libvirtd anyway.
...
+#ifndef __MINGW32__ +
It's annoying we don't have a better define to say 'on windows', in libxml2 it usually ends up being defined as if defined (_WIN32) || defined (__DJGPP__) because in that case it's not the compiler we want to detect, it's the platform. but that's fine for now :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Dec 07, 2007 at 11:47:23AM +0000, Richard W.M. Jones wrote:
It's not likely that the external programs will actually exist on MinGW anyway, so execing them isn't very useful.
I don't much like the idea of leaving them in reporting errors at runtime. If we can't implement them we should not provide them at all on Windows, so you get clear compile time errors if something accidentlly starts to use them.
This also removes the virFileLinkPointsTo function, which I think is only used by libvirtd anyway.
Used by the network and storage drivers, so not important for Windows. REgards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

No such error code in winsock. Instead return EIO. Probably a better fix is to disable virUUIDGenerateRandomBytes entirely: it's not used by the remote driver and will always fail under Windows because it tries to read /dev/urandom. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Fri, Dec 07, 2007 at 11:49:42AM +0000, Richard W.M. Jones wrote:
No such error code in winsock. Instead return EIO.
Probably a better fix is to disable virUUIDGenerateRandomBytes entirely: it's not used by the remote driver and will always fail under Windows because it tries to read /dev/urandom.
+1, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Dec 07, 2007 at 11:49:42AM +0000, Richard W.M. Jones wrote:
No such error code in winsock. Instead return EIO.
Probably a better fix is to disable virUUIDGenerateRandomBytes entirely: it's not used by the remote driver and will always fail under Windows because it tries to read /dev/urandom.
Again I prefer to remove it at compile time rather than returning runtime errors Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

On Fri, Dec 07, 2007 at 01:35:05PM +0100, Jim Meyering wrote:
Modulo the few suggestions, this series looks fine.
Agreed, I think it should go though, discussing minor cleanups will be easier once it had been commited, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Dec 07, 2007 at 09:21:42AM -0500, Daniel Veillard wrote:
On Fri, Dec 07, 2007 at 01:35:05PM +0100, Jim Meyering wrote:
Modulo the few suggestions, this series looks fine.
Agreed, I think it should go though, discussing minor cleanups will be easier once it had been commited,
Hum, now that it has been ommited, I can't rebuild on RHEL-5 again: test2:~/libvirt -> ./autogen.sh --prefix=/usr ; make /u/veillard/libvirt/tmpcvs7319 /u/veillard/libvirt/tmpwrk7319 Putting files in AC_CONFIG_AUX_DIR, `build-aux'. /u/veillard/libvirt/build-aux gnulib/m4/getdelim.m4:9: error: Autoconf version 2.60 or higher is required gnulib/m4/getdelim.m4:9: the top level autom4te: /usr/bin/m4 failed with exit status: 63 aclocal: autom4te failed with exit status: 63 configure:7536: error: possibly undefined macro: gl_FUNC_FSEEKO If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure:8764: error: possibly undefined macro: gl_FUNC_GETDELIM configure:8769: error: possibly undefined macro: gl_FUNC_GETLINE configure:8774: error: possibly undefined macro: gl_FUNC_GETPASS configure:8981: error: possibly undefined macro: gl_FUNC_LSEEK configure:9475: error: possibly undefined macro: gl_FUNC_POLL configure:9476: error: possibly undefined macro: gl_FUNC_REALLOC_POSIX configure:12342: error: possibly undefined macro: gl_FUNC_STRNDUP configure:12347: error: possibly undefined macro: gl_FUNC_STRNLEN configure:12352: error: possibly undefined macro: gl_FUNC_STRPBRK configure:12357: error: possibly undefined macro: gl_FUNC_STRSEP configure:12362: error: possibly undefined macro: gl_HEADER_SYS_SELECT configure:12651: error: possibly undefined macro: gl_HEADER_SYS_STAT_H configure:12654: error: possibly undefined macro: gl_HEADER_SYS_TIME_H configure:13051: error: possibly undefined macro: gl_FUNC_VASPRINTF checking for a BSD-compatible install... /usr/bin/install -c ... it then generates makefiles but make fails when doing build-aux/missing Can we restore RHEL5 as a working environment, it's certainly in use around, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Dec 07, 2007 at 09:51:53AM -0500, Daniel Veillard wrote:
On Fri, Dec 07, 2007 at 09:21:42AM -0500, Daniel Veillard wrote:
On Fri, Dec 07, 2007 at 01:35:05PM +0100, Jim Meyering wrote:
Modulo the few suggestions, this series looks fine.
Agreed, I think it should go though, discussing minor cleanups will be easier once it had been commited,
Hum, now that it has been ommited, I can't rebuild on RHEL-5 again:
test2:~/libvirt -> ./autogen.sh --prefix=/usr ; make /u/veillard/libvirt/tmpcvs7319 /u/veillard/libvirt/tmpwrk7319 Putting files in AC_CONFIG_AUX_DIR, `build-aux'. /u/veillard/libvirt/build-aux gnulib/m4/getdelim.m4:9: error: Autoconf version 2.60 or higher is required
Okay, Dan fixed it quickly :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (4)
-
Daniel P. Berrange
-
Daniel Veillard
-
Jim Meyering
-
Richard W.M. Jones