cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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