Blame SOURCES/kvm-redhat-link-etc-qemu-ga-fsfreeze-hook-to-etc-qemu-kv.patch

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