Export compile directory to guests
Use 9p over virtio to share files on the host with the guest domains. The files are accessible in the guests /hostfs directory.
This commit is contained in:
committed by
Tobias Brunner
parent
48ea1d8b0b
commit
0593b6c975
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Automatically generated file; DO NOT EDIT.
|
# Automatically generated file; DO NOT EDIT.
|
||||||
# Linux/x86_64 3.5.0 Kernel Configuration
|
# Linux/x86_64 3.5.3 Kernel Configuration
|
||||||
#
|
#
|
||||||
CONFIG_64BIT=y
|
CONFIG_64BIT=y
|
||||||
# CONFIG_X86_32 is not set
|
# CONFIG_X86_32 is not set
|
||||||
@@ -741,7 +741,9 @@ CONFIG_WIRELESS=y
|
|||||||
#
|
#
|
||||||
# CONFIG_WIMAX is not set
|
# CONFIG_WIMAX is not set
|
||||||
# CONFIG_RFKILL is not set
|
# CONFIG_RFKILL is not set
|
||||||
# CONFIG_NET_9P is not set
|
CONFIG_NET_9P=y
|
||||||
|
CONFIG_NET_9P_VIRTIO=y
|
||||||
|
# CONFIG_NET_9P_DEBUG is not set
|
||||||
# CONFIG_CAIF is not set
|
# CONFIG_CAIF is not set
|
||||||
# CONFIG_CEPH_LIB is not set
|
# CONFIG_CEPH_LIB is not set
|
||||||
# CONFIG_NFC is not set
|
# CONFIG_NFC is not set
|
||||||
@@ -1385,7 +1387,7 @@ CONFIG_REISERFS_FS=y
|
|||||||
# CONFIG_GFS2_FS is not set
|
# CONFIG_GFS2_FS is not set
|
||||||
# CONFIG_BTRFS_FS is not set
|
# CONFIG_BTRFS_FS is not set
|
||||||
# CONFIG_NILFS2_FS is not set
|
# CONFIG_NILFS2_FS is not set
|
||||||
# CONFIG_FS_POSIX_ACL is not set
|
CONFIG_FS_POSIX_ACL=y
|
||||||
CONFIG_FILE_LOCKING=y
|
CONFIG_FILE_LOCKING=y
|
||||||
CONFIG_FSNOTIFY=y
|
CONFIG_FSNOTIFY=y
|
||||||
CONFIG_DNOTIFY=y
|
CONFIG_DNOTIFY=y
|
||||||
@@ -1464,6 +1466,8 @@ CONFIG_NETWORK_FILESYSTEMS=y
|
|||||||
# CONFIG_NCP_FS is not set
|
# CONFIG_NCP_FS is not set
|
||||||
# CONFIG_CODA_FS is not set
|
# CONFIG_CODA_FS is not set
|
||||||
# CONFIG_AFS_FS is not set
|
# CONFIG_AFS_FS is not set
|
||||||
|
CONFIG_9P_FS=y
|
||||||
|
CONFIG_9P_FS_POSIX_ACL=y
|
||||||
CONFIG_NLS=y
|
CONFIG_NLS=y
|
||||||
CONFIG_NLS_DEFAULT="iso8859-1"
|
CONFIG_NLS_DEFAULT="iso8859-1"
|
||||||
# CONFIG_NLS_CODEPAGE_437 is not set
|
# CONFIG_NLS_CODEPAGE_437 is not set
|
||||||
|
|||||||
@@ -30,6 +30,11 @@
|
|||||||
<controller type='usb' index='0'>
|
<controller type='usb' index='0'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||||
</controller>
|
</controller>
|
||||||
|
<filesystem type='mount' accessmode='passthrough'>
|
||||||
|
<source dir='/var/run/kvm-swan-hostfs'/>
|
||||||
|
<target dir='/hostshare'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||||
|
</filesystem>
|
||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:9a:e2:de'/>
|
<mac address='52:54:00:9a:e2:de'/>
|
||||||
<source network='vnet2'/>
|
<source network='vnet2'/>
|
||||||
|
|||||||
@@ -30,9 +30,11 @@
|
|||||||
<controller type='usb' index='0'>
|
<controller type='usb' index='0'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||||
</controller>
|
</controller>
|
||||||
<controller type='sata' index='0'>
|
<filesystem type='mount' accessmode='passthrough'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
|
<source dir='/var/run/kvm-swan-hostfs'/>
|
||||||
</controller>
|
<target dir='/hostshare'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||||
|
</filesystem>
|
||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:40:85:6b'/>
|
<mac address='52:54:00:40:85:6b'/>
|
||||||
<source network='vnet3'/>
|
<source network='vnet3'/>
|
||||||
|
|||||||
@@ -30,9 +30,11 @@
|
|||||||
<controller type='usb' index='0'>
|
<controller type='usb' index='0'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||||
</controller>
|
</controller>
|
||||||
<controller type='sata' index='0'>
|
<filesystem type='mount' accessmode='passthrough'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
|
<source dir='/var/run/kvm-swan-hostfs'/>
|
||||||
</controller>
|
<target dir='/hostshare'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||||
|
</filesystem>
|
||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:ae:f1:f8'/>
|
<mac address='52:54:00:ae:f1:f8'/>
|
||||||
<source network='vnet1'/>
|
<source network='vnet1'/>
|
||||||
|
|||||||
@@ -30,9 +30,11 @@
|
|||||||
<controller type='usb' index='0'>
|
<controller type='usb' index='0'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||||
</controller>
|
</controller>
|
||||||
<controller type='sata' index='0'>
|
<filesystem type='mount' accessmode='passthrough'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
|
<source dir='/var/run/kvm-swan-hostfs'/>
|
||||||
</controller>
|
<target dir='/hostshare'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||||
|
</filesystem>
|
||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:b9:15:a9'/>
|
<mac address='52:54:00:b9:15:a9'/>
|
||||||
<source network='vnet1'/>
|
<source network='vnet1'/>
|
||||||
|
|||||||
@@ -25,11 +25,16 @@
|
|||||||
<driver name='qemu' type='qcow2' cache='writethrough'/>
|
<driver name='qemu' type='qcow2' cache='writethrough'/>
|
||||||
<source file='/var/lib/libvirt/images/moon.qcow2'/>
|
<source file='/var/lib/libvirt/images/moon.qcow2'/>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='virtio'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
||||||
</disk>
|
</disk>
|
||||||
<controller type='usb' index='0'>
|
<controller type='usb' index='0'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||||
</controller>
|
</controller>
|
||||||
|
<filesystem type='mount' accessmode='passthrough'>
|
||||||
|
<source dir='/var/run/kvm-swan-hostfs'/>
|
||||||
|
<target dir='/hostshare'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||||
|
</filesystem>
|
||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:43:e3:35'/>
|
<mac address='52:54:00:43:e3:35'/>
|
||||||
<source network='vnet2'/>
|
<source network='vnet2'/>
|
||||||
|
|||||||
@@ -25,11 +25,16 @@
|
|||||||
<driver name='qemu' type='qcow2' cache='writethrough'/>
|
<driver name='qemu' type='qcow2' cache='writethrough'/>
|
||||||
<source file='/var/lib/libvirt/images/sun.qcow2'/>
|
<source file='/var/lib/libvirt/images/sun.qcow2'/>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='virtio'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
||||||
</disk>
|
</disk>
|
||||||
<controller type='usb' index='0'>
|
<controller type='usb' index='0'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||||
</controller>
|
</controller>
|
||||||
|
<filesystem type='mount' accessmode='passthrough'>
|
||||||
|
<source dir='/var/run/kvm-swan-hostfs'/>
|
||||||
|
<target dir='/hostshare'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||||
|
</filesystem>
|
||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:77:43:ea'/>
|
<mac address='52:54:00:77:43:ea'/>
|
||||||
<source network='vnet1'/>
|
<source network='vnet1'/>
|
||||||
|
|||||||
@@ -30,6 +30,11 @@
|
|||||||
<controller type='usb' index='0'>
|
<controller type='usb' index='0'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||||
</controller>
|
</controller>
|
||||||
|
<filesystem type='mount' accessmode='passthrough'>
|
||||||
|
<source dir='/var/run/kvm-swan-hostfs'/>
|
||||||
|
<target dir='/hostshare'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||||
|
</filesystem>
|
||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:69:d3:80'/>
|
<mac address='52:54:00:69:d3:80'/>
|
||||||
<source network='vnet2'/>
|
<source network='vnet2'/>
|
||||||
|
|||||||
@@ -30,6 +30,11 @@
|
|||||||
<controller type='usb' index='0'>
|
<controller type='usb' index='0'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||||
</controller>
|
</controller>
|
||||||
|
<filesystem type='mount' accessmode='passthrough'>
|
||||||
|
<source dir='/var/run/kvm-swan-hostfs'/>
|
||||||
|
<target dir='/hostshare'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||||
|
</filesystem>
|
||||||
<interface type='network'>
|
<interface type='network'>
|
||||||
<mac address='52:54:00:4b:23:fa'/>
|
<mac address='52:54:00:4b:23:fa'/>
|
||||||
<source network='vnet1'/>
|
<source network='vnet1'/>
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
/hostshare /hostfs 9p trans=virtio,version=9p2000.L 0 0
|
||||||
@@ -48,6 +48,7 @@ do_on_exit umount $LOOPDIR/proc
|
|||||||
mkdir -p $LOOPDIR/root/compile
|
mkdir -p $LOOPDIR/root/compile
|
||||||
log_action "Mounting $ROOTIMGCOMPILEDIR as /root/compile"
|
log_action "Mounting $ROOTIMGCOMPILEDIR as /root/compile"
|
||||||
execute "mount -o bind $ROOTIMGCOMPILEDIR $LOOPDIR/root/compile"
|
execute "mount -o bind $ROOTIMGCOMPILEDIR $LOOPDIR/root/compile"
|
||||||
|
do_on_exit rm -r $LOOPDIR/root/compile
|
||||||
do_on_exit umount $LOOPDIR/root/compile
|
do_on_exit umount $LOOPDIR/root/compile
|
||||||
|
|
||||||
echo "Installing software from source"
|
echo "Installing software from source"
|
||||||
@@ -63,3 +64,5 @@ done
|
|||||||
|
|
||||||
log_action "Removing /etc/resolv.conf"
|
log_action "Removing /etc/resolv.conf"
|
||||||
execute "rm -f $LOOPDIR/etc/resolv.conf"
|
execute "rm -f $LOOPDIR/etc/resolv.conf"
|
||||||
|
|
||||||
|
mkdir -p $LOOPDIR/hostfs
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ NETWORKS="vnet1 vnet2 vnet3"
|
|||||||
CONFDIR=$PWD/config/kvm
|
CONFDIR=$PWD/config/kvm
|
||||||
KNLSRC=$BUILDDIR/$KERNEL/arch/x86/boot/bzImage
|
KNLSRC=$BUILDDIR/$KERNEL/arch/x86/boot/bzImage
|
||||||
KNLTARGET=/var/run/kvm-swan-kernel
|
KNLTARGET=/var/run/kvm-swan-kernel
|
||||||
|
HOSTFSTARGET=/var/run/kvm-swan-hostfs
|
||||||
|
|
||||||
echo "Starting test environment"
|
echo "Starting test environment"
|
||||||
|
|
||||||
@@ -16,6 +17,9 @@ check_commands virsh
|
|||||||
log_action "Deploying kernel $KERNEL"
|
log_action "Deploying kernel $KERNEL"
|
||||||
execute "ln -fs $KNLSRC $KNLTARGET"
|
execute "ln -fs $KNLSRC $KNLTARGET"
|
||||||
|
|
||||||
|
log_action "Deploying $ROOTIMGCOMPILEDIR as hostfs"
|
||||||
|
execute "ln -Tfs $ROOTIMGCOMPILEDIR $HOSTFSTARGET"
|
||||||
|
|
||||||
for net in $NETWORKS
|
for net in $NETWORKS
|
||||||
do
|
do
|
||||||
log_action "Network $net"
|
log_action "Network $net"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ echo "Stopping test environment"
|
|||||||
|
|
||||||
NETWORKS="vnet1 vnet2 vnet3"
|
NETWORKS="vnet1 vnet2 vnet3"
|
||||||
KNLTARGET=/var/run/kvm-swan-kernel
|
KNLTARGET=/var/run/kvm-swan-kernel
|
||||||
|
HOSTFSTARGET=/var/run/kvm-swan-hostfs
|
||||||
|
|
||||||
[ `id -u` -eq 0 ] || die "You must be root to run $0"
|
[ `id -u` -eq 0 ] || die "You must be root to run $0"
|
||||||
|
|
||||||
@@ -26,3 +27,6 @@ done
|
|||||||
|
|
||||||
log_action "Removing kernel $KERNEL"
|
log_action "Removing kernel $KERNEL"
|
||||||
execute "rm $KNLTARGET"
|
execute "rm $KNLTARGET"
|
||||||
|
|
||||||
|
log_action "Removing link to hostfs"
|
||||||
|
execute "rm $HOSTFSTARGET"
|
||||||
|
|||||||
Reference in New Issue
Block a user