Merge ~paelzer/ubuntu/+source/qemu:lp-2051153-fix-run-qemu-mount-restart-JAMMY into ubuntu/+source/qemu:ubuntu/jammy-devel

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: 8375d2576cf91937b997012261d098eb1386786a
Proposed branch: ~paelzer/ubuntu/+source/qemu:lp-2051153-fix-run-qemu-mount-restart-JAMMY
Merge into: ubuntu/+source/qemu:ubuntu/jammy-devel
Diff against target: 30 lines (+11/-0)
2 files modified
debian/changelog (+7/-0)
debian/rules (+4/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Sergio Durigan Junior (community) Approve
Canonical Server Reporter Pending
Review via email: mp+459588@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Hi Christian,

First of all, thank you very much for tackling this. As usual, your "brain dump" in the bug makes it easier to review the MP.

I'm OK with the changes if you want to upload them as they are right now, but I'm leaving a comment below regarding the readability/trackeability/maintainability of the approach you chose.

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: paelzer, sergiodj
Uploaders: paelzer, sergiodj
MP auto-approved

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

Thank you

On "sed here vs. just dumping the contents of the #DEBHELPER#" I hav egon through the same thinking.
But debhelper does so much, and if we change qemu-guest agent or any other I'd want to at least be able to use normal changes (unless they are in vain like in this case). Therefore I didn't want to remove #DEBHELPER# from the maintscript and instead chose the most surgical approach (there is much more it does for that mount unit that mostly has no effect, but I decided to keep it as is as it also has no negative effect as far as we know).

I'm ok having the original call commented out and followed your suggestion.
Let me test rebuild that to be sure we miss no special char escaping or any such ...

Once that looks good I'll upload for SRU review ...

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

Ok, test works, the postinst now looks like

...
# End automatically added section
# Automatically added by dh_installsystemd/13.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
        if [ -d /run/systemd/system ]; then
                systemctl --system daemon-reload >/dev/null || true
                if [ -n "$2" ]; then
                        _dh_action=restart
                else
                        _dh_action=start
                fi
                # LP: 2051153 Do not restart mount units
# deb-systemd-invoke $_dh_action 'run-qemu.mount' >/dev/null || true
        fi
fi
# End automatically added section
...

I think that helps to recognize what it is, and we do not need to bother to prefix it with spaces do we?
Arrr, I can't unsee - I'll add the spaces ....

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Tuesday, January 30 2024, Christian Ehrhardt  wrote:

> Ok, test works, the postinst now looks like
>
> ...
> # End automatically added section
> # Automatically added by dh_installsystemd/13.6ubuntu1
> if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
> if [ -d /run/systemd/system ]; then
> systemctl --system daemon-reload >/dev/null || true
> if [ -n "$2" ]; then
> _dh_action=restart
> else
> _dh_action=start
> fi
> # LP: 2051153 Do not restart mount units
> # deb-systemd-invoke $_dh_action 'run-qemu.mount' >/dev/null || true
> fi
> fi
> # End automatically added section
> ...
>
>
>
> I think that helps to recognize what it is, and we do not need to bother to prefix it with spaces do we?
> Arrr, I can't unsee - I'll add the spaces ....

Hah, yeah :-). No need to worry about the spaces, but I think it's too
late now?

Either way, this is all fine by me and already approved. Feel free to
upload.

Thank you!

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

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

It is not too late, I've rebuilt my change to ensure it works - it does not. Now the other line is bad :-)

  else
   _dh_action=start
  fi
# LP: 2051153 Do not restart mount units
# deb-systemd-invoke $_dh_action 'run-qemu.mount' >/dev/null || true
 fi
fi

But yeah as long as I only modify spaces no re-review is needed.

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

Now it looks good:
  else
   _dh_action=start
  fi
  # LP: 2051153 Do not restart mount units
  # deb-systemd-invoke $_dh_action 'run-qemu.mount' >/dev/null || true
 fi
fi

Done by:
sed -i -E 's/(\s*)(deb-systemd-invoke\s*\$$_dh_action.*run-qemu.mount.*$$)/\1# LP: 2051153 Do not restart mount units\n\1# \2/' debian/qemu-block-extra/DEBIAN/postinst

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

Uploading qemu_6.2+dfsg-2ubuntu6.17.dsc
Uploading qemu_6.2+dfsg-2ubuntu6.17.debian.tar.xz
Uploading qemu_6.2+dfsg-2ubuntu6.17_source.buildinfo
Uploading qemu_6.2+dfsg-2ubuntu6.17_source.changes

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 673fb9c..9ed337b 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+qemu (1:6.2+dfsg-2ubuntu6.17) jammy; urgency=medium
7+
8+ * d/rules: modify qemu-block-extra postinst to avoid
9+ restarting run-qemu.mount (LP: #2051153)
10+
11+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 29 Jan 2024 11:43:30 +0100
12+
13 qemu (1:6.2+dfsg-2ubuntu6.16) jammy-security; urgency=medium
14
15 * SECURITY UPDATE: infinite loop in USB xHCI controller
16diff --git a/debian/rules b/debian/rules
17index e9a1e84..b2c0d0a 100755
18--- a/debian/rules
19+++ b/debian/rules
20@@ -438,6 +438,10 @@ binary-arch: $(addprefix install-, ${qemu-builds})
21 dh_fixperms -a
22 dh_shlibdeps -a
23 dh_installdeb -a
24+ # On jammy dh_installsystemd will always restart a mount unit, no matter
25+ # the options we pass - hence we post-modify it in the maint scripts to
26+ # match the required behavior.
27+ sed -i -E 's/(\s*)(deb-systemd-invoke\s*\$$_dh_action.*run-qemu.mount.*$$)/\1# LP: 2051153 Do not restart mount units\n\1# \2/' debian/qemu-block-extra/DEBIAN/postinst
28 ifeq ($(enable_linux_user),enable)
29 # after shlibdeps finished, grab ${shlibs:Depends} from -user package
30 # and transform it into Built-Using field for -user-static.

Subscribers

People subscribed via source and target branches