feat: Update to QEMU 8.1

feat: Update to QEMU 8.1
This commit is contained in:
Kroese 2023-10-17 19:44:54 +02:00 committed by GitHub
commit 44d3e23545
6 changed files with 23 additions and 28 deletions

View File

@ -7,7 +7,7 @@ FROM qemux/qemu-host as builder
# RUN go mod download # RUN go mod download
# RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /qemu-host.bin . # RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /qemu-host.bin .
FROM debian:bookworm-slim FROM debian:trixie-slim
ARG DEBCONF_NOWARNINGS="yes" ARG DEBCONF_NOWARNINGS="yes"
ARG DEBIAN_FRONTEND noninteractive ARG DEBIAN_FRONTEND noninteractive

View File

@ -136,13 +136,6 @@ if [[ SIZE -ne DATA_SIZE ]]; then
error "Virtual disk has the wrong size: ${SIZE}" && exit 89 error "Virtual disk has the wrong size: ${SIZE}" && exit 89
fi fi
AGENT="${STORAGE}/${BASE}.agent"
[ -f "$AGENT" ] && AGENT_VERSION=$(cat "${AGENT}") || AGENT_VERSION=1
if ((AGENT_VERSION < 5)); then
info "The installed VirtualDSM Agent v${AGENT_VERSION} is an outdated version, please upgrade it."
fi
DISK_OPTS="\ DISK_OPTS="\
-device virtio-scsi-pci,id=hw-synoboot,bus=pcie.0,addr=0xa \ -device virtio-scsi-pci,id=hw-synoboot,bus=pcie.0,addr=0xa \
-drive file=${BOOT},if=none,id=drive-synoboot,format=raw,cache=${DISK_CACHE},aio=${DISK_IO},discard=${DISK_DISCARD},detect-zeroes=on \ -drive file=${BOOT},if=none,id=drive-synoboot,format=raw,cache=${DISK_CACHE},aio=${DISK_IO},discard=${DISK_DISCARD},detect-zeroes=on \

View File

@ -28,3 +28,15 @@ if ! apt-mark showinstall | grep -q "xserver-xorg-video-intel"; then
apt-get -qq --no-install-recommends -y install xserver-xorg-video-intel > /dev/null apt-get -qq --no-install-recommends -y install xserver-xorg-video-intel > /dev/null
fi fi
if ! apt-mark showinstall | grep -q "qemu-system-modules-opengl"; then
info "Installing OpenGL module..."
export DEBCONF_NOWARNINGS="yes"
export DEBIAN_FRONTEND="noninteractive"
apt-get -qq update
apt-get -qq --no-install-recommends -y install qemu-system-modules-opengl > /dev/null
fi

View File

@ -242,9 +242,6 @@ mkdir -p "$LOC"
cp /agent/service.sh "$LOC/agent.sh" cp /agent/service.sh "$LOC/agent.sh"
chmod 755 "$LOC/agent.sh" chmod 755 "$LOC/agent.sh"
# Store agent version
echo "7" > "$STORAGE"/"$BASE".agent
info "Install: Installing system partition..." info "Install: Installing system partition..."
LABEL="1.44.1-42218" LABEL="1.44.1-42218"

View File

@ -234,7 +234,11 @@ fi
if [[ "${DHCP}" == [Yy1]* ]]; then if [[ "${DHCP}" == [Yy1]* ]]; then
if [[ "$GATEWAY" == "172."* ]]; then if [[ "$GATEWAY" == "172."* ]]; then
error "You can only enable DHCP while the container is on a macvlan network!" && exit 86 if [[ "${DEBUG}" == [Yy1]* ]]; then
info "Warning: Are you sure the container is on a macvlan network?"
else
error "You can only enable DHCP while the container is on a macvlan network!" && exit 86
fi
fi fi
# Configuration for DHCP IP # Configuration for DHCP IP

View File

@ -39,26 +39,14 @@ _graceful_shutdown() {
echo && error "Could not send shutdown command to the guest ($RESPONSE)" echo && error "Could not send shutdown command to the guest ($RESPONSE)"
# If we cannot shutdown the usual way, fallback to the NMI method # Send a NMI interrupt which will be detected by the agent script
if ! echo 'nmi' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}" > /dev/null ; then
AGENT="${STORAGE}/${BASE}.agent"
[ -f "$AGENT" ] && AGENT_VERSION=$(cat "${AGENT}") || AGENT_VERSION=1
if ((AGENT_VERSION > 1)); then
# Send a NMI interrupt which will be detected by the kernel
if ! echo 'nmi' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}" > /dev/null ; then
AGENT_VERSION=0
fi
fi
if ((AGENT_VERSION < 2)); then
kill -15 "$(cat "${_QEMU_PID}")" kill -15 "$(cat "${_QEMU_PID}")"
pkill -f qemu-system-x86_64 || true pkill -f qemu-system-x86_64 || true
fi fi
fi fi
while [ "$(cat ${_QEMU_SHUTDOWN_COUNTER})" -lt "${QEMU_POWERDOWN_TIMEOUT}" ]; do while [ "$(cat ${_QEMU_SHUTDOWN_COUNTER})" -lt "${QEMU_POWERDOWN_TIMEOUT}" ]; do
@ -70,7 +58,8 @@ _graceful_shutdown() {
if echo 'info version'| nc -q 1 -w 1 localhost "${QEMU_MONPORT}" >/dev/null 2>&1 ; then if echo 'info version'| nc -q 1 -w 1 localhost "${QEMU_MONPORT}" >/dev/null 2>&1 ; then
sleep 1 sleep 1
[[ "${DEBUG}" == [Yy1]* ]] && info "Shutting down, waiting... ($(cat ${_QEMU_SHUTDOWN_COUNTER})/${QEMU_POWERDOWN_TIMEOUT})" CNT="$(cat ${_QEMU_SHUTDOWN_COUNTER})/${QEMU_POWERDOWN_TIMEOUT}"
[[ "${DEBUG}" == [Yy1]* ]] && info "Shutting down, waiting... (${CNT})"
fi fi