get_host_initrd can return an invalid or null initrd. Do not set the
ramdisk option in the VM config file to an invalid value.
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
cat >busybox-pv <<EOF
kernel = "`get_host_kernel`"
-ramdisk = "`get_host_initrd`"
extra = "root=/dev/xvda console=hvc0"
memory = 512
name = "raisin-test"
boot="c"
vif=['bridge=xenbr1']
EOF
+ if [[ -e "`get_host_initrd`" ]]
+ then
+ echo "ramdisk = \"`get_host_initrd`\"" >> busybox-pv
+ fi
$SUDO xl create busybox-pv
check_guest_alive