Compare commits
3 commits
95189e503f
...
3514fa96ef
Author | SHA1 | Date | |
---|---|---|---|
3514fa96ef | |||
b20e52014d | |||
73aa42a7f8 |
3 changed files with 53 additions and 20 deletions
|
@ -23,6 +23,9 @@ case "$1" in
|
|||
spice)
|
||||
basedir=sockets/spice
|
||||
;;
|
||||
shared)
|
||||
basedir=shared
|
||||
;;
|
||||
*)
|
||||
false
|
||||
;;
|
||||
|
|
|
@ -1,11 +1,24 @@
|
|||
#!/usr/bin/env sh
|
||||
base=$(echo "$QEMUSH_BASE" | cut -d , -f 1)
|
||||
QEMUSH_BASE=$(echo "$QEMUSH_BASE" | sed "s/^${base}//" | sed 's/^,//')
|
||||
#!/usr/bin/env perl
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
set -- "$base" \
|
||||
-fsdev local,security_model=passthrough,id=fsdev0,path="${HOME}/shared/${QEMUSH_NAME}" \
|
||||
-device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=shared \
|
||||
"$@"
|
||||
my @launchers_chain = ("kvm");
|
||||
|
||||
set -x
|
||||
exec "$@"
|
||||
if (defined $ENV{'QEMUSH_BASE'}) {
|
||||
@launchers_chain = split ",", $ENV{'QEMUSH_BASE'};
|
||||
}
|
||||
|
||||
my $base = shift @launchers_chain;
|
||||
$ENV{'QEMUSH_BASE'} = join ",", @launchers_chain;
|
||||
|
||||
chomp(my $shared_folder = `pathof shared`);
|
||||
|
||||
my @command = (
|
||||
$base,
|
||||
"-fsdev", "local,security_model=passthrough,id=fsdev0,path=${shared_folder}",
|
||||
"-device", "virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=shared",
|
||||
@ARGV
|
||||
);
|
||||
|
||||
print "+ exec ", join(" ", @command), "\n";
|
||||
exec @command;
|
||||
|
|
|
@ -1,12 +1,29 @@
|
|||
#!/bin/sh -x
|
||||
base=$(echo "$QEMUSH_BASE" | cut -d , -f 1)
|
||||
QEMUSH_BASE=$(echo "$QEMUSH_BASE" | sed "s/^${base}//" | sed 's/^,//')
|
||||
#!/usr/bin/env perl
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
exec "$base" \
|
||||
-vga qxl \
|
||||
-chardev spicevmc,id=vdagent,debug=0,name=vdagent \
|
||||
-device virtio-serial \
|
||||
-device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \
|
||||
-spice port="$(first-free-port 5900)",addr=::1,disable-ticketing=on \
|
||||
-audiodev spice,id=snd0 \
|
||||
"$@"
|
||||
my @launchers_chain = ("kvm");
|
||||
|
||||
if (defined $ENV{'QEMUSH_BASE'}) {
|
||||
@launchers_chain = split ",", $ENV{'QEMUSH_BASE'};
|
||||
}
|
||||
|
||||
my $base = shift @launchers_chain;
|
||||
$ENV{'QEMUSH_BASE'} = join ",", @launchers_chain;
|
||||
|
||||
chomp(my $socket_path = `pathof spice`);
|
||||
|
||||
my @command = (
|
||||
$base,
|
||||
"-vga", "qxl",
|
||||
"-chardev", "spicevmc,id=vdagent,debug=0,name=vdagent",
|
||||
"-device", "virtio-serial",
|
||||
"-device", "virtserialport,chardev=vdagent,name=com.redhat.spice.0",
|
||||
"-spice", "unix=on,addr=${socket_path},disable-ticketing=on",
|
||||
"-audiodev", "spice,id=snd0",
|
||||
@ARGV
|
||||
);
|
||||
|
||||
print "+ exec ", join(" ", @command), "\n";
|
||||
exit;
|
||||
exec @command;
|
||||
|
|
Loading…
Reference in a new issue