Compare commits
No commits in common. "5a2233bd04df6d728f879864aecc1de018e111fa" and "4b239c4e58322b425acd6de8ef51320f44644755" have entirely different histories.
5a2233bd04
...
4b239c4e58
8 changed files with 20 additions and 40 deletions
2
Makefile
2
Makefile
|
@ -40,7 +40,7 @@ SRC_C_SOURCES_NAMES := $(notdir $(basename $(wildcard $(SRCD)/*$(SRC_FMT))))
|
|||
C_BINARIES := $(addprefix $(QEMU_BIN)/,$(SRC_C_SOURCES_NAMES))
|
||||
|
||||
# Directories in ~qemu necessary for qemush to work
|
||||
QEMUSH_DIRS_NAMES := bin launchers disks sockets/monitors sockets/spice
|
||||
QEMUSH_DIRS_NAMES := bin launchers disks sockets
|
||||
QEMUSH_DIRS := $(addprefix $(QEMU_HOME)/,$(QEMUSH_DIRS_NAMES))
|
||||
|
||||
install: $(QEMUSH_DIRS) $(MODULES) $(C_BINARIES) $(QEMUSH) $(LAUNCHERS)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
# version=0.5.0
|
||||
#!/bin/bash
|
||||
# version=0.4.1
|
||||
|
||||
# Function to re-exec the script as another user via sudo (only if needed)
|
||||
exec_as() {
|
||||
|
@ -87,7 +87,7 @@ public_attach() {
|
|||
public_running() {
|
||||
cd || return
|
||||
echo "Running machines:"
|
||||
set -- $ls -t sockets/monitors "$@"
|
||||
set -- $ls -t sockets "$@"
|
||||
exec "$@"
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
# Read configuration
|
||||
sourceconf() { [ -r "$1" ] && . "$1"; }
|
||||
sourceconf ./conf
|
||||
|
||||
# Delete socket and PID file
|
||||
exec rm -f "$socket" "${socket}.pid"
|
|
@ -1,13 +1,7 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
# Read configuration
|
||||
sourceconf() {
|
||||
[ -r "$1" ] && . "$1"
|
||||
}
|
||||
sourceconf ./conf
|
||||
|
||||
# Start a virtiofsd sharing qemu shared dir
|
||||
exec /usr/lib/virtiofsd \
|
||||
--shared-dir "$shared_dir" \
|
||||
--socket-path "$socket" \
|
||||
--shared-dir ~qemu/shared \
|
||||
--socket-path /run/virtiofsd.sock \
|
||||
--socket-group qemu
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
set -e
|
||||
#!/bin/sh -e
|
||||
|
||||
# Invoked on termination if the last command failed
|
||||
error() { >&2 echo "$(basename "$0"): ${*}"; }
|
||||
|
@ -18,10 +17,11 @@ case "$1" in
|
|||
extension=qcow2
|
||||
;;
|
||||
socket)
|
||||
basedir=sockets/monitors
|
||||
basedir=sockets
|
||||
;;
|
||||
spice)
|
||||
basedir=sockets/spice
|
||||
basedir=spice
|
||||
extension=sock
|
||||
;;
|
||||
*)
|
||||
false
|
||||
|
@ -33,7 +33,5 @@ trap - EXIT
|
|||
|
||||
# Print the actual string
|
||||
basedir="${HOME}/${basedir}"
|
||||
name="$QEMUSH_NAME"
|
||||
[ -n "$2" ] && name="${name}-${2}"
|
||||
[ -n "$extension" ] && extension=".${extension}"
|
||||
printf %s/%s%s\\n "$basedir" "$name" "$extension"
|
||||
printf %s/%s%s\\n "$basedir" "$QEMUSH_NAME" "$extension"
|
||||
|
|
|
@ -26,6 +26,7 @@ command = [
|
|||
'-M', 'q35',
|
||||
'-cpu', 'host', '-smp', nproc,
|
||||
'-m', ram,
|
||||
'-net', 'nic'
|
||||
] + argv[1:]
|
||||
|
||||
# Print the final command and replace the main process with it
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#!/bin/sh -x
|
||||
base=$(echo "$QEMUSH_BASE" | cut -d , -f 1)
|
||||
QEMUSH_BASE=$(echo "$QEMUSH_BASE" | cut -d , -f 2-)
|
||||
|
||||
exec "$base" \
|
||||
exec "$QEMUSH_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 \
|
||||
-spice port="$(first-free-port 5900)",addr=127.0.0.1,disable-ticketing=on \
|
||||
"$@"
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
#!/bin/sh -x
|
||||
|
||||
# Store VM name in environment variable
|
||||
export QEMUSH_NAME
|
||||
export QEMUSH_RAM=4G
|
||||
export QEMUSH_BASE=virtiofs,kvm
|
||||
[ -z "$QEMUSH_NAME" ] && {
|
||||
export QEMUSH_NAME
|
||||
QEMUSH_NAME=$(basename "$0")
|
||||
}
|
||||
export QEMUSH_BASE=kvm
|
||||
[ -z "$QEMUSH_NAME" ] && QEMUSH_NAME=$(basename "$0")
|
||||
|
||||
# Launch the virtual machine
|
||||
exec spice \
|
||||
-drive file="$(pathof disk)",if=virtio \
|
||||
-net nic -net user,hostname="${QEMUSH_NAME}" \
|
||||
-net user,hostname="${QEMUSH_NAME}" \
|
||||
-usbdevice tablet \
|
||||
-name "$QEMUSH_NAME" \
|
||||
-device intel-hda -device hda-duplex,audiodev=snd0 \
|
||||
"$@"
|
||||
|
|
Loading…
Reference in a new issue