Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] libvirt: add service for controlling guests marked "autostart"
@ 2022-03-09 20:24 GSI
  2022-06-28  2:16 ` github-actions
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: GSI @ 2022-03-09 20:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

There is a new pull request by GSI against master on the void-packages repository

https://github.com/GSI/void-packages libvirtd-guests
https://github.com/void-linux/void-packages/pull/36068

libvirt: add service for controlling guests marked "autostart"
#### Testing the changes
- I tested the changes in this PR: **YES**


#### Local build testing
- I built this PR locally for my native architecture, (x86_64-musl)

A patch file from https://github.com/void-linux/void-packages/pull/36068.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libvirtd-guests-36068.patch --]
[-- Type: text/x-diff, Size: 2589 bytes --]

From 78970706c4708ffeef09e596cdced2ec05b1e9d1 Mon Sep 17 00:00:00 2001
From: GSI2022 <2022@groovy-skills.com>
Date: Wed, 9 Mar 2022 21:16:30 +0100
Subject: [PATCH] libvirt: add service for controlling guests marked
 "autostart"

---
 srcpkgs/libvirt/files/libvirtd-guests/finish | 24 ++++++++++++++++++++
 srcpkgs/libvirt/files/libvirtd-guests/run    | 11 +++++++++
 srcpkgs/libvirt/template                     |  2 +-
 3 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100755 srcpkgs/libvirt/files/libvirtd-guests/finish
 create mode 100755 srcpkgs/libvirt/files/libvirtd-guests/run

diff --git a/srcpkgs/libvirt/files/libvirtd-guests/finish b/srcpkgs/libvirt/files/libvirtd-guests/finish
new file mode 100755
index 000000000000..3e25b8cd2ce0
--- /dev/null
+++ b/srcpkgs/libvirt/files/libvirtd-guests/finish
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Command guests to shut down and wait for them to finish.
+# A reasonable grace period should be set via the SVWAIT environment variable.
+# Example: SVWAIT=300 sv stop libvirtd-guests
+# 
+# Note that the "libvirtd-guests" service only handles guests marked "autostart".
+
+request_guest_shutdown () {
+	local guests="${1}"
+	echo "$guests" | while read g ; do virsh shutdown "$g" ; done
+}
+
+guests=`virsh list --name --autostart | sed '/^$/d'`
+request_guest_shutdown "$guests"
+
+# Wait until guests are powered off.
+while [ "$guests" != "" ] ; do
+	# Apparently certain (Windows) guests want to be asked multiple
+	# times to shut down.
+	request_guest_shutdown "$guests"
+	sleep 1
+	guests=`virsh list --name --autostart | sed '/^$/d'`
+done
diff --git a/srcpkgs/libvirt/files/libvirtd-guests/run b/srcpkgs/libvirt/files/libvirtd-guests/run
new file mode 100755
index 000000000000..4ba801fb5f91
--- /dev/null
+++ b/srcpkgs/libvirt/files/libvirtd-guests/run
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+guests=`virsh list --name --autostart --state-shutoff`
+
+echo "$guests" | while read g ; do
+	if [ "$g" != '' ] ; then
+		virsh start "$g"
+	fi
+done
+
+pause
diff --git a/srcpkgs/libvirt/template b/srcpkgs/libvirt/template
index 1568aa905a56..65071b566485 100644
--- a/srcpkgs/libvirt/template
+++ b/srcpkgs/libvirt/template
@@ -89,7 +89,7 @@ post_install() {
 	local _services _srv
 
 	# runit services; libvirtd is for legacy use
-	_services="libvirt-generic libvirtd virtqemud virtvboxd virtxend
+	_services="libvirt-generic libvirtd libvirtd-guests virtqemud virtvboxd virtxend
 	 virtlxcd virtlockd virtlogd virtproxyd virtinterfaced virtnetworkd
 	 virtnodedevd virtnwfilterd virtsecretd virtstoraged"
 	for _srv in $_services; do

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: libvirt: add service for controlling guests marked "autostart"
  2022-03-09 20:24 [PR PATCH] libvirt: add service for controlling guests marked "autostart" GSI
@ 2022-06-28  2:16 ` github-actions
  2022-06-28 10:34 ` GSI
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: github-actions @ 2022-06-28  2:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/36068#issuecomment-1168136755

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: libvirt: add service for controlling guests marked "autostart"
  2022-03-09 20:24 [PR PATCH] libvirt: add service for controlling guests marked "autostart" GSI
  2022-06-28  2:16 ` github-actions
@ 2022-06-28 10:34 ` GSI
  2022-09-28  2:14 ` github-actions
  2022-10-13  2:15 ` [PR PATCH] [Closed]: " github-actions
  3 siblings, 0 replies; 5+ messages in thread
From: GSI @ 2022-06-28 10:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

New comment by GSI on void-packages repository

https://github.com/void-linux/void-packages/pull/36068#issuecomment-1168547105

Comment:
I consider this is a valuable addition.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: libvirt: add service for controlling guests marked "autostart"
  2022-03-09 20:24 [PR PATCH] libvirt: add service for controlling guests marked "autostart" GSI
  2022-06-28  2:16 ` github-actions
  2022-06-28 10:34 ` GSI
@ 2022-09-28  2:14 ` github-actions
  2022-10-13  2:15 ` [PR PATCH] [Closed]: " github-actions
  3 siblings, 0 replies; 5+ messages in thread
From: github-actions @ 2022-09-28  2:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/36068#issuecomment-1260299567

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Closed]: libvirt: add service for controlling guests marked "autostart"
  2022-03-09 20:24 [PR PATCH] libvirt: add service for controlling guests marked "autostart" GSI
                   ` (2 preceding siblings ...)
  2022-09-28  2:14 ` github-actions
@ 2022-10-13  2:15 ` github-actions
  3 siblings, 0 replies; 5+ messages in thread
From: github-actions @ 2022-10-13  2:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]

There's a closed pull request on the void-packages repository

libvirt: add service for controlling guests marked "autostart"
https://github.com/void-linux/void-packages/pull/36068

Description:
#### Testing the changes
- I tested the changes in this PR: **YES**


#### Local build testing
- I built this PR locally for my native architecture, (x86_64-musl)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-13  2:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09 20:24 [PR PATCH] libvirt: add service for controlling guests marked "autostart" GSI
2022-06-28  2:16 ` github-actions
2022-06-28 10:34 ` GSI
2022-09-28  2:14 ` github-actions
2022-10-13  2:15 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).