From 020501879841afb788087f0455df79367c0337a0 Mon Sep 17 00:00:00 2001 From: Danilo de Paula Date: Fri, 11 Sep 2020 14:23:22 -0400 Subject: [PATCH 1/4] redhat: link /etc/qemu-ga/fsfreeze-hook to /etc/qemu-kvm/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Danilo de Paula Message-id: <20200911142322.1865501-2-ddepaula@redhat.com> Patchwork-id: 98358 O-Subject: [RHEL-AV-8.3.0 qemu-kvm PATCH v2 1/1] redhat: link /etc/qemu-ga/fsfreeze-hook to /etc/qemu-kvm/ Bugzilla: 1738820 RH-Acked-by: Eduardo Lima (Etrunko) RH-Acked-by: Marc-André Lureau RH-Acked-by: Miroslav Rezanina When qemu-ga was introduced to RHEL-8, we used the qemu-guest-agent from RHEL-7 as base. In RHEL-7, qemu-guest-agent is built as standalone package. It's built as "qemu-ga", hence the "qemu-ga" folders. For RHEL-8, that should have been renamed to qemu-kvm, but I missed it. Renaming those folders to /etc/qemu-kvm is a no go today, because users might have populated the /etc/qemu-ga/fsfreeze-hook.d folder. So, in order to make qemu-ga -F works in RHEL-8, a link is being created in the expected place, pointing to the real one. Also, fsfreeze-hook opens up the fsfreeze-hook.d on the same PATH where it is stored. However, it doesn't follow symlinks. In order to fix this, I had to change it to make sure it follows the link. An option would be to also link the fsfreeze-hook.d folder, but I choose not to do so as it creates a permanent/visible change in users environments. The downside is to keep another downstream-only change. Signed-off-by: Danilo C. L. de Paula --- redhat/qemu-kvm.spec.template | 6 ++++++ scripts/qemu-guest-agent/fsfreeze-hook | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook index 13aafd4845..e9b84ec028 100755 --- a/scripts/qemu-guest-agent/fsfreeze-hook +++ b/scripts/qemu-guest-agent/fsfreeze-hook @@ -8,7 +8,7 @@ # request, it is issued with "thaw" argument after filesystem is thawed. LOGFILE=/var/log/qga-fsfreeze-hook.log -FSFREEZE_D=$(dirname -- "$0")/fsfreeze-hook.d +FSFREEZE_D=$(dirname -- "$(realpath $0)")/fsfreeze-hook.d # Check whether file $1 is a backup or rpm-generated file and should be ignored is_ignored_file() { -- 2.27.0