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

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: a0cc0fc3ae2f7f5f6d9654a86956daa74453ed76
Merged at revision: 668b732a1154e0b55ba085d66c84ae22443407f0
Proposed branch: ~paelzer/ubuntu/+source/qemu:lp-1913421-exec-run-BIONIC
Merge into: ubuntu/+source/qemu:ubuntu/bionic-devel
Diff against target: 62 lines (+26/-1)
3 files modified
debian/changelog (+10/-0)
debian/qemu-block-extra.postrm.in (+8/-1)
debian/qemu-block-extra.prerm.in (+8/-0)
Reviewer Review Type Date Requested Status
Utkarsh Gupta (community) Approve
Dan Streetman (community) Abstain
Ubuntu Stable Release Updates Team Pending
Canonical Server packageset reviewers Pending
Canonical Server Pending
Review via email: mp+407765@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.

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 :

6863f0b1c8c87175eac800835cae8980e37b4d46
-> 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.

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

ecb77f389ef403a06e1a5fc9f1d4a4b422cf7969
-> d/ch looks good. +1.

So TL;DR 1 question to satiate my understanding. All good otherwise, thus approving.

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

Indeed there is some inconsistency in Bionics version of it. Due to the different stages of /var/run == /run.
I'm tempted to say that /var/run/qemu is the better string to use and will do so in all of Bionic. In the others I'll not introduce a mess by changing them all over, although one could say it could/should be changes there as well.

I've initially kept it /run/qemu to match the later behavior, but for Bionic where a lot is /var... already I'll unify on that.

Thanks - I'll clean that up.

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

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

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 cdc52db..e10b766 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,13 @@
6+qemu (1:2.11+dfsg-1ubuntu7.38) bionic; urgency=medium
7+
8+ * enhance loading of old modules post upgrade (LP: #1913421)
9+ - d/qemu-block-extra.prerm.in: clear all (current and former) modules
10+ on purge
11+ - d/qemu-block-extra.prerm.in: test for exec and prepare /var/run/qemu
12+ if needed
13+
14+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 19 Aug 2021 14:30:25 +0200
15+
16 qemu (1:2.11+dfsg-1ubuntu7.37) bionic-security; urgency=medium
17
18 * SECURITY UPDATE: NULL pointer dereference in MemoryRegionOps object
19diff --git a/debian/qemu-block-extra.postrm.in b/debian/qemu-block-extra.postrm.in
20index 5c3d73e..84667da 100644
21--- a/debian/qemu-block-extra.postrm.in
22+++ b/debian/qemu-block-extra.postrm.in
23@@ -20,12 +20,19 @@ set -e
24
25
26 case "$1" in
27- purge|remove)
28+ remove)
29 # remove .so files for still running qemu instances in /var/run
30 # for details see bug LP: #1847361
31 rm -f /var/run/qemu/@PKGVERSION@/block-*.so
32 ;;
33
34+ purge)
35+ # Might fail if guests run that have files loaded from there
36+ # That is ok and will be cleaned on reboot
37+ umount /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 ;;

Subscribers

People subscribed via source and target branches