]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tests: Support for faking emulator in qemuxml2argv
authorJiri Denemark <jdenemar@redhat.com>
Fri, 16 Apr 2010 06:20:33 +0000 (08:20 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 2 Dec 2010 10:13:05 +0000 (11:13 +0100)
commit9237e9558a75f254214c71102704cd600a4541e6
tree076c3e2c26e8c9a17d71ac34cf7ff7153b47c059
parenta7283d849c645bf0bc8bd484efd27a6e8e5eca8b
tests: Support for faking emulator in qemuxml2argv

This patch allows for using custom scripts instead of /usr/bin/qemu
emulator in domain XML. To do so, one would specify relative path to the
custom script in <emulator/>. The path needs to be relative to
qemuxml2argvdata directory and it will be transparently made absolute in
runtime. The expected command line needs to contain the exact relative
path as was used in domain XML.

The problem is RelaxNG schema for domain XML only allows for absolute
path within <emulator/>. To workaround it, an extra '/' must be added at
the beginning of the path. That is, instead of "./qemu.sh" or
"../emulator/qemu.sh" one would use "/./qemu.sh" or
"/../emulator/qemu.sh". The extra slash is removed before further
processing. I don't like this workaround, it's very ugly but it's the
best option I was able to come up with. Relaxing domain XML schema is
not an option IMO.
tests/qemuxml2argvtest.c