From d31a16c435e497f320ccfa880122dff963f151a7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 23 Aug 2018 20:07:28 -0400 Subject: Organize in to an installable package --- systemd/system/qemu | 37 ------------------------------------- systemd/system/qemu@.service | 16 ---------------- 2 files changed, 53 deletions(-) delete mode 100755 systemd/system/qemu delete mode 100644 systemd/system/qemu@.service (limited to 'systemd/system') diff --git a/systemd/system/qemu b/systemd/system/qemu deleted file mode 100755 index ad58ae3..0000000 --- a/systemd/system/qemu +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -shopt -s lastpipe -set -euE -o pipefail - -declare -A vcpu2cpulist -numactl=() -source "/etc/conf.d/qemu.d/$1" -args+=( - -name "$1",debug-threads=on - -pidfile "/run/qemu-$1/pid" - -vnc unix:"/run/qemu-$1/vnc.sock" - -monitor unix:"/run/qemu-$1/monitor.sock",server,nowait - -serial file:"/dev/stdout" - -daemonize -) - -{ - numactl "${numactl[@]}" -- qemu-system-"${system}" "${args[@]}" - - if [[ ${vcpu2cpulist+${#vcpu2cpulist[@]}} -gt 0 ]]; then - declare -A vcpu2tid - while read -r line; do - if [[ $line != ?' CPU #'*:*thread_id=* ]]; then - continue - fi - vcpu=${line#?' CPU #'}; vcpu=${vcpu%%:*} - tid=${line#thread_id=}; tid=${tid%% *} - vcpu2tid[$vcpu]=$tid - done < <(socat STDIO UNIX-CONNECT:"/run/qemu-$1/monitor.sock" <<<'info cpus') - - for vcpu in "${!vcpu_pins[@]}"; do - taskset --cpu-list --pid -- "${vcpu2cpulist[@]}" "${vcpu2tid[$vcpu]}" - done - fi - - systemd-notify --ready -} | exec cat diff --git a/systemd/system/qemu@.service b/systemd/system/qemu@.service deleted file mode 100644 index 95cbefc..0000000 --- a/systemd/system/qemu@.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Virtual Machine %I -Documentation=man:qemu(1) -PartOf=machines.target -Before=machines.target - -[Service] -Type=notify -NotifyAccess=all -RuntimeDirectory=qemu-%I -PIDFile=/run/qemu-%I/pid -ExecStart=/etc/systemd/system/qemu %I -ExecStop=/bin/socat SYSTEM:'echo system_powerdown; sleep infinity' UNIX-CONNECT:/run/qemu-%I/monitor.sock - -[Install] -WantedBy=machines.target -- cgit v1.2.3-2-g168b