Notes on cross-compiling the daemon (was: Re: [Libguestfs] Windows port of daemon?)

Richard W.M. Jones rjones at redhat.com
Fri Nov 20 10:00:13 UTC 2009


Notes on issues cross-compiling the daemon.

I installed the Fedora Windows cross compiler and
mingw32-portablexdr[1] and then did:

  cd daemon
  mingw32-configure
  make

* No custom format specifiers.  No replacement in Gnulib's printf
  either.  Bugger.

* No chroot.  That means that cases where we use CHROOT_IN/CHROOT_OUT
  have to be rewritten.  There's this almost laughable Windows library
  function which we might use:
  http://msdn.microsoft.com/en-us/library/bb773569%28VS.85%29.aspx
  This one needs more thought.

* guestfsd.c socket code needs some attention.

* guestfsd.c: command* functions need a Win32 replacement.

* proto.c: Protocol code uses a select loop which could be replaced
  with a Win32 equivalent or (probably easier) we just use the Gnulib
  replacement select function.

* stubs.c: LVM tokenizing code is a bit broken for reasons I didn't
  look into very deeply.  We need to check for LVM availability in
  the appliance and disable all LVM-related code conditionally.

These functions are missing, but Gnulib provides replacements:

  + mkdtemp
  + fstatat (gnulib module: openat)
  + getline
  + glob
  + sleep
  + strchrnul

These functions are missing, and Gnulib provides no replacement
(but it really should do):

  - fstatvfs
  - futimens
  - posix_fallocate
  - pread
  - readlinkat
  - realpath
  - sync

I'll post a few patches shortly to fix some obviously broken things.
(A good thing about compiling for another platform is I've already
found some genuine mistakes in the code).

Rich.

[1] mingw32-portablexdr from here:
http://git.annexia.org/?p=fedora-mingw.git;a=summary

-- 
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




More information about the Libguestfs mailing list