thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

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

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