[libvirt] [libvirt-sandbox][PATCH] module lookup and rundir fix

Radu C. dmns_serp at yahoo.com
Wed May 30 17:24:59 UTC 2012


Hello,
I've been trying to get libvirt-sandbox working on my Gentoo box but I ran into some difficulties. The version I'm using is the latest git one.


The first problem was the following when running virt-sandbox:
"Unable to start sandbox: Error opening file '/tmp/libvirt-sandbox-9ivpRN/9pnet.ko': File exists"
I pinpointed the problem to the following diff in commit [05fb94d2c42abe9cfd86c3663d704c268f325503]:
-    gchar *moddirpath = g_strdup_printf("/lib/modules/%s/kernel",

+    gchar *moddirpath = g_strdup_printf("/lib/modules/%s",

The problem is that symlinks are made to the build directory and it finds a module multiple times.
I inserted a printf in the lookup loop so here's what I mean:

dmns libvirt-sandbox # virt-sandbox -c qemu:///system -n test1323 -v
-d /usr/bin/yes
found: /lib/modules/3.4.0-gentoo/kernel/fs/fscache/fscache.ko
found: /lib/modules/3.4.0-gentoo/source/fs/fscache/fscache.ko
found: /lib/modules/3.4.0-gentoo/build/fs/fscache/fscache.ko
found: /lib/modules/3.4.0-gentoo/kernel/net/9p/9pnet.ko
found: /lib/modules/3.4.0-gentoo/source/net/9p/9pnet.ko
found: /lib/modules/3.4.0-gentoo/build/net/9p/9pnet.ko
found: /lib/modules/3.4.0-gentoo/kernel/fs/9p/9p.ko
found: /lib/modules/3.4.0-gentoo/source/fs/9p/9p.ko
found: /lib/modules/3.4.0-gentoo/build/fs/9p/9p.ko
found: /lib/modules/3.4.0-gentoo/kernel/net/9p/9pnet_virtio.ko
found: /lib/modules/3.4.0-gentoo/source/net/9p/9pnet_virtio.ko
found: /lib/modules/3.4.0-gentoo/build/net/9p/9pnet_virtio.ko

The next problem was the following:

dmns libvirt-sandbox # virt-sandbox -c qemu:///system -n test123 -v -d
/usr/bin/yes
Unable to start sandbox: Failed to create domain: internal error
Process exited while reading console log output: char device
redirected to /dev/pts/1
char device redirected to /dev/pts/3
Virtio-9p Failed to initialize fs-driver with id:fsdev-fs1 and export
path:libvirt-sandbox/test123/config

It appears when running as root because of the following line:
./libvirt-sandbox/libvirt-sandbox-context.c:    cachedir = (getuid() ? g_get_user_cache_dir() : RUNDIR);

RUNDIR is always "" due to being compiled with -DRUNDIR=\"\" . This is because there's a typo in makefile.am

Both of these are fixed in the diff attachment.

Having these fixes in place everything works fine when using libvirt 0.9.10 but for newer versions I noticed every time I ran virt-sandbox the libvirtd daemon would segfault.
Using git bisect I traced the problem back to commit [1]. So I reverted back to libvirt 0.9.10 but I believe there is a problem both in the commit and somewhere in libvirt-sandbox.
Please have a look and tell me if you need extra info.


[1] http://libvirt.org/git/?p=libvirt.git;a=commit;h=4716138229ae47c5492c13a8622b779889560fd7


Radu Caragea.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-sandbox.diff
Type: application/octet-stream
Size: 1763 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120530/626984cb/attachment-0001.obj>


More information about the libvir-list mailing list