[libvirt] Building on Solaris 11 Express

Richard Laager rlaager at wiktel.com
Sun May 29 02:01:35 UTC 2011


I would really like to use ZFS's zvols as storage for my guests. I
really like ZFS's snapshots, send/receive, and checksumming features.
(Compression and deduplication might be useful as well.)

I'm roughly about half-way done writing a ZFS storage backend for
libvirt. It behaves like the LVM backend. I've been writing it on Linux.
However, ZFS on Linux is not yet production-ready.

So I tried building libvirt on Solaris 11 Express. The following
outlines the trouble (and successes) I've had so far.

First, I had to prune down the features being built:

        I added --without-xen to deal with the following. I wasn't
        intending on using Xen, so this doesn't bother me personally.
                configure: error: You must install the Xen development package to compile Xen driver with -lxenstore

        I added --without-openvz to deal with the following. Likewise,
        I'm not using it.
                  CC     libvirt_driver_openvz_la-openvz_driver.lo
                openvz/openvz_driver.c:45:19: paths.h: No such file or directory
                In file included from ../src/conf/domain_conf.h:40,
                                 from openvz/openvz_conf.h:33,
                                 from openvz/openvz_driver.c:56:
                ../src/conf/nwfilter_conf.h:521: warning: parameter has incomplete type
                

        I added --without-network to deal with the following. I may need
        to actually fix this at some point.
                  CC     libvirt_util_la-bridge.lo
                util/bridge.c:39:20: paths.h: No such file or directory
                util/bridge.c:42:55: linux/param.h: No such file or directory
                util/bridge.c:43:55: linux/sockios.h: No such file or directory
                util/bridge.c:44:55: linux/if_bridge.h: No such file or directory
                util/bridge.c:45:55: linux/if_tun.h: No such file or directory
                util/bridge.c: In function `ifSetInterfaceMac':
                util/bridge.c:313: error: `SIOCGIFHWADDR' undeclared (first use in this function)
                util/bridge.c:313: error: (Each undeclared identifier is reported only once
                util/bridge.c:313: error: for each function it appears in.)
                util/bridge.c:316: error: structure has no member named `ifr_hwaddr'
                util/bridge.c:318: error: `SIOCSIFHWADDR' undeclared (first use in this function)
                util/bridge.c: In function `ifGetMtu':
                util/bridge.c:347: error: `SIOCGIFMTU' undeclared (first use in this function)
                util/bridge.c: In function `ifSetMtu':
                util/bridge.c:378: error: `SIOCSIFMTU' undeclared (first use in this function)
                util/bridge.c: In function `brAddTap':
                util/bridge.c:501: error: `IFF_TAP' undeclared (first use in this function)
                util/bridge.c:501: error: `IFF_NO_PI' undeclared (first use in this function)
                util/bridge.c:515: error: `TUNSETIFF' undeclared (first use in this function)
                util/bridge.c:537: error: `TUNSETPERSIST' undeclared (first use in this function)
                util/bridge.c: In function `brDeleteTap':
                util/bridge.c:567: error: `IFF_TAP' undeclared (first use in this function)
                util/bridge.c:567: error: `IFF_NO_PI' undeclared (first use in this function)
                util/bridge.c:574: error: `TUNSETIFF' undeclared (first use in this function)
                util/bridge.c:575: error: `TUNSETPERSIST' undeclared (first use in this function)
                util/bridge.c: In function `brSetInterfaceUp':
                util/bridge.c:612: error: `SIOCGIFFLAGS' undeclared (first use in this function)
                util/bridge.c:620: error: `SIOCSIFFLAGS' undeclared (first use in this function)
                util/bridge.c: In function `brGetInterfaceUp':
                util/bridge.c:652: error: `SIOCGIFFLAGS' undeclared (first use in this function)


Then, I had to fix a trivial code error. I've mailed the patch to this
list with a subject of "[PATCH] Fix virExecWithHook Prototype".


I also had linker trouble. Solaris 11's gcc package uses Solaris ld, not
GNU ld. I had to change the following:
         VERSION_SCRIPT_FLAGS=-Wl,--version-script=
         `$LD --help 2>&1 | grep -- --version-script >/dev/null` || \
        -    VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
        +    VERSION_SCRIPT_FLAGS=""

Interestingly, this code seems to have been added to support Solaris ld
according to git blame; see git log c2fb8bfe. I'm not sure what is
correct here.


At this point, libvirt builds and installs. I tested virsh against a
remote system using: virsh -c qemu+ssh://REMOTE/system

This worked except for the fact that it was trying to attach
to /usr/local/var/run/libvirt-sock on the remote system due
to /usr/local being the --prefix used with the *local* virsh was built.
I'm not sure how that architectural issue should be addressed. For
testing, I just made a /usr/local/var -> /var symlink on the remote
system.


However, libvirtd will not start locally (on Solaris) which has pretty
much stopped my progress. I'm sure this must be something trivial. Is it
getting a bad prefix? Is something other than libvirtd supposed to make
the socket file? I did try making a /.libvirt directory for testing.

# rm /usr/local/var/run/libvirtd.pid ; /usr/local/sbin/libvirtd -v
20:13:33.663: 1: info : libvirt version: 0.9.1
20:13:33.663: 1: error : qemudListenUnix:605 : Failed to bind socket to
'@//.libvirt/libvirt-sock': No such file or directory


Thanks,
Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110528/7fbf7fc9/attachment-0001.sig>


More information about the libvir-list mailing list