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