Merge ~paelzer/ubuntu/+source/qemu:lp-1913421-exec-run-FOCAL into ubuntu/+source/qemu:ubuntu/focal-devel

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 72259d9abe5e069f13f1959fe81921fd238e8dfb
Merge reported by: Christian Ehrhardt 
Merged at revision: e4dcd6ce19550c5ed4af5f410d3587560ce4ccc6
Proposed branch: ~paelzer/ubuntu/+source/qemu:lp-1913421-exec-run-FOCAL
Merge into: ubuntu/+source/qemu:ubuntu/focal-devel
Diff against target: 177 lines (+27/-48)
5 files modified
debian/changelog (+12/-0)
debian/qemu-block-extra.postrm.in (+6/-1)
debian/qemu-block-extra.prerm.in (+8/-0)
debian/rules (+1/-1)
dev/null (+0/-46)
Reviewer Review Type Date Requested Status
Utkarsh Gupta (community) Approve
Dan Streetman (community) Abstain
Ubuntu Stable Release Updates Team Pending
Canonical Server Pending
Canonical Server packageset reviewers Pending
Review via email: mp+407764@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

PPA: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/4653/+packages

Please review these MPs in depth as the maintscript and edge-case magic has bitten me enough on this :-/

Revision history for this message
Dan Streetman (ddstreet) wrote :

abstaining from review per bug 1913421 comment 41

review: Abstain
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The discussion between Dan and me continued on the bug, I'd ask (and therefore assign for pre-unapproved-review) the SRU-Team to help us by adding a third opinion.

Dan and I are not even battling with strong opposing opinions - there are just multiple ways to do things and it isn't clear how to best-continue so we'd need a tie breaker.

I'd ask/recommend to read comment 41 and all that followed on the bug, if needed to go deeper also the rest of the bug comments and the related Debian PR.
Then adding a 3rd voice/opinion here would really help us.

3ea58ce... by Christian Ehrhardt 

d/qemu-block-extra.prerm.in: test for exec and prepare /var/run/qemu if needed

/run is by default mounted as noexec which breaks the use case of
/var/run/qemu - therefore if not already executable (via e.g. an admin that
has taken care) prepare a mountpoint that suffices for the intended use.

For SRUs this was considered less regression risk than the badly dh*
handled mount unit that is used in >=21.10 releases.

Signed-off-by: Christian Ehrhardt <email address hidden>

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Re-worked according to the bug discussion - thanks to everyone that participated!
Thereby ready for re-review.

Revision history for this message
Utkarsh Gupta (utkarsh) wrote (last edit ):

4d7e39d261ce5a6372b08d1b0bc841d739d96f3f
-> okay, not much to comment there except the commit
   message has a typo; one of the "postrm" should be "prerm".
   (the commit message typo also resulted in a typo in d/ch)

d0cbddde8451168ebeb5d2cfe051f6b198b71162
-> k, nothing much to comment again, seems okay.

a93de72fecece932dc3586356648dd5fd53a7820
-> like Hirsute, we split the `remove` and `purge` actions and the
   extended commit message helps in making things clearer. Whilst
   purging, we remove anything and everything that was there under
   /run/qemu; okay, +1. But quick q: do we not care about /var/run/qemu
   as we seem to be doing in the "remove" case, few lines above?
   Apologies if it's obvious and I am just lacking the context.

2925434903ab858a3cc366d19e581ca5efc02664
-> follows https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1913421/comments/47.
   +1 there.

So TL;DR 1 typo in commit message & d/ch entry and 1 question to satiate my understanding. All good otherwise, thus approving.

review: Approve
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

fabba88fdbe53457d08725e6af58ae03c35f4d34
-> d/ch entry has a typo; mentioned above (1st line); please
   consider fixing that before uploading.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Typo cleaned up - thanks

We could make all and everything /var/run/qemu but for the sake of not changing more I've kept it as it is in the current state (using /run/qemu) in Focal (and Hirsute).
Indeed using /var/run/qemu everywhere would have been better, but in 99.9..% /var/run == /run so that only makes a difference in a very very few environments.
OTOH you are right, we touch it we could/should maybe clean it up.
If someone made /var/run != /run it could otherwise lead to problems.

I'll update them and re-test before uploading

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

All re-verified and uploading to -unapproved now.
Thanks everyone involved.

c155ebb... by Christian Ehrhardt 

d/qemu-block-extra.prerm.in: make check helper is executable

Signed-off-by: Christian Ehrhardt <email address hidden>

53992e6... by Christian Ehrhardt 

Revert "d/rules: --enable-module-upgrades not needed for qemu-system-x86-xen"

This reverts commit 430ef6313e3c9dcf15486e23a2833fae6193c38b.

e4dcd6c... by Christian Ehrhardt 

changelog: dropping xen module upgrade fix

While the code really is useless and it could be removed the SRU
mindset defines that we would not want/need to touch it if there is
no impact and we are not aware of any.

Signed-off-by: Christian Ehrhardt <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 081c8f3..20c9285 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,15 @@
6+qemu (1:4.2-3ubuntu6.18) focal; urgency=medium
7+
8+ * enhance loading of old modules post upgrade (LP: #1913421)
9+ - d/rules: d/qemu-system-gui.{prerm,postrm}.in: do not save gui modules
10+ (can't be loaded late)
11+ - d/qemu-block-extra.postrm.in: clear all (current and former) modules
12+ on purge
13+ - d/qemu-block-extra.prerm.in: test for exec and prepare /var/run/qemu
14+ if needed
15+
16+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 19 Aug 2021 14:10:54 +0200
17+
18 qemu (1:4.2-3ubuntu6.17) focal-security; urgency=medium
19
20 * SECURITY UPDATE: NULL pointer dereference in MemoryRegionOps object
21diff --git a/debian/qemu-block-extra.postrm.in b/debian/qemu-block-extra.postrm.in
22index ef2126a..2193801 100644
23--- a/debian/qemu-block-extra.postrm.in
24+++ b/debian/qemu-block-extra.postrm.in
25@@ -20,12 +20,17 @@ set -e
26
27
28 case "$1" in
29- purge|remove)
30+ remove)
31 # remove .so files for still running qemu instances in /var/run
32 # for details see bug LP: #1847361
33 rm -f /var/run/qemu/@PKGVERSION@/block-*.so
34 ;;
35
36+ purge)
37+ umount --quiet /var/run/qemu 1>/dev/null 2>&1 || true
38+ rm -rf "/var/run/qemu" 1>/dev/null 2>&1 || true
39+ ;;
40+
41 upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
42 ;;
43
44diff --git a/debian/qemu-block-extra.prerm.in b/debian/qemu-block-extra.prerm.in
45index dee25a8..09f2a10 100644
46--- a/debian/qemu-block-extra.prerm.in
47+++ b/debian/qemu-block-extra.prerm.in
48@@ -24,6 +24,14 @@ case "$1" in
49 upgrade|deconfigure)
50 # retain .so files for still running qemu instances in /var/run
51 # for details see bug LP: #1847361
52+ mkdir -p /var/run/qemu
53+ printf "#!/bin/sh\nexit 0\n" > /var/run/qemu/exec
54+ chmod +x /var/run/qemu/exec || true
55+ if ! /var/run/qemu/exec 1>/dev/null 2>&1 && ! findmnt --mountpoint /var/run/qemu 1>/dev/null; then
56+ # not executable and not yet a mount point on its own - create a tmpfs mount
57+ mount -t tmpfs --source none --target /var/run/qemu --options defaults,nosuid,nodev,exec,mode=755 || true
58+ fi
59+ echo "/var/run/qemu is a mountpoint to allow still running qemu binaries of former builds (after package upgrades) to fallback-load modules from there" > /var/run/qemu/README || true
60 mkdir -p /var/run/qemu/@PKGVERSION@
61 cp /usr/lib/@ARCH@/qemu/block-*.so /var/run/qemu/@PKGVERSION@/
62 ;;
63diff --git a/debian/qemu-system-gui.postrm.in b/debian/qemu-system-gui.postrm.in
64deleted file mode 100644
65index 48c740a..0000000
66--- a/debian/qemu-system-gui.postrm.in
67+++ /dev/null
68@@ -1,44 +0,0 @@
69-#!/bin/sh
70-# postrm script for brrr
71-#
72-# see: dh_installdeb(1)
73-
74-set -e
75-
76-# summary of how this script can be called:
77-# * <postrm> `remove'
78-# * <postrm> `purge'
79-# * <old-postrm> `upgrade' <new-version>
80-# * <new-postrm> `failed-upgrade' <old-version>
81-# * <new-postrm> `abort-install'
82-# * <new-postrm> `abort-install' <old-version>
83-# * <new-postrm> `abort-upgrade' <old-version>
84-# * <disappearer's-postrm> `disappear' <overwriter>
85-# <overwriter-version>
86-# for details, see https://www.debian.org/doc/debian-policy/ or
87-# the debian-policy package
88-
89-
90-case "$1" in
91- purge|remove)
92- # remove .so files for still running qemu instances in /var/run
93- # for details see bug LP: #1847361
94- rm -f /var/run/qemu/@PKGVERSION@/ui-gtk.so
95- rm -f /var/run/qemu/@PKGVERSION@/audio-*.so
96- ;;
97-
98- upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
99- ;;
100-
101- *)
102- echo "postrm called with unknown argument \`$1'" >&2
103- exit 1
104- ;;
105-esac
106-
107-# dh_installdeb will replace this with shell code automatically
108-# generated by other debhelper scripts.
109-
110-#DEBHELPER#
111-
112-exit 0
113diff --git a/debian/qemu-system-gui.prerm.in b/debian/qemu-system-gui.prerm.in
114deleted file mode 100644
115index 3624362..0000000
116--- a/debian/qemu-system-gui.prerm.in
117+++ /dev/null
118@@ -1,46 +0,0 @@
119-#!/bin/sh
120-# prerm script for qemu-system-gui
121-#
122-# see: dh_installdeb(1)
123-
124-set -e
125-
126-# summary of how this script can be called:
127-# * <prerm> `remove'
128-# * <old-prerm> `upgrade' <new-version>
129-# * <new-prerm> `failed-upgrade' <old-version>
130-# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
131-# * <deconfigured's-prerm> `deconfigure' `in-favour'
132-# <package-being-installed> <version> `removing'
133-# <conflicting-package> <version>
134-# for details, see https://www.debian.org/doc/debian-policy/ or
135-# the debian-policy package
136-
137-
138-case "$1" in
139- remove)
140- ;;
141-
142- upgrade|deconfigure)
143- # retain .so files for still running qemu instances in /var/run
144- # for details see bug LP: #1847361
145- mkdir -p /var/run/qemu/@PKGVERSION@
146- cp /usr/lib/@ARCH@/qemu/ui-gtk.so /var/run/qemu/@PKGVERSION@/
147- cp /usr/lib/@ARCH@/qemu/audio-*.so /var/run/qemu/@PKGVERSION@/
148- ;;
149-
150- failed-upgrade)
151- ;;
152-
153- *)
154- echo "prerm called with unknown argument \`$1'" >&2
155- exit 1
156- ;;
157-esac
158-
159-# dh_installdeb will replace this with shell code automatically
160-# generated by other debhelper scripts.
161-
162-#DEBHELPER#
163-
164-exit 0
165diff --git a/debian/rules b/debian/rules
166index 6a55d5a..ea64a7e 100755
167--- a/debian/rules
168+++ b/debian/rules
169@@ -17,7 +17,7 @@ else
170 VENDOR := DEBIAN
171 endif
172
173-AUTOGENERATED:= qemu-block-extra.prerm qemu-block-extra.postrm qemu-system-gui.prerm qemu-system-gui.postrm
174+AUTOGENERATED:= qemu-block-extra.prerm qemu-block-extra.postrm
175 PKGVERSION := $(shell printf "Debian ${DEB_VERSION}" | tr --complement '[:alnum:]+-.~' '_')
176
177 # support parallel build using DEB_BUILD_OPTIONS=parallel=N

Subscribers

People subscribed via source and target branches