[libvirt PATCH] qemu_shim: set system identity

Ján Tomko posted 1 patch 1 year, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/3d4ed514f3d7c8eb0e573ac9f33ed1821ff14e3b.1678896159.git.jtomko@redhat.com
src/qemu/qemu_shim.c | 5 +++++
1 file changed, 5 insertions(+)
[libvirt PATCH] qemu_shim: set system identity
Posted by Ján Tomko 1 year, 1 month ago
Otherwise looking up a secret fails when we try to elevate the identity
in qemuDomainSecretInfoSetupFromSecret.

https://bugzilla.redhat.com/show_bug.cgi?id=2000410

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 src/qemu/qemu_shim.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_shim.c b/src/qemu/qemu_shim.c
index 7b58583074..b642f6175a 100644
--- a/src/qemu/qemu_shim.c
+++ b/src/qemu/qemu_shim.c
@@ -26,6 +26,7 @@
 
 #include "virfile.h"
 #include "virgettext.h"
+#include "viridentity.h"
 #include "virthread.h"
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
@@ -133,6 +134,7 @@ qemuShimQuench(void *userData G_GNUC_UNUSED,
 
 int main(int argc, char **argv)
 {
+    g_autoptr(virIdentity) sysident = NULL;
     GThread *eventLoopThread = NULL;
     virConnectPtr conn = NULL;
     virConnectPtr sconn = NULL;
@@ -191,6 +193,9 @@ int main(int argc, char **argv)
 
     virSetErrorFunc(NULL, qemuShimQuench);
 
+    sysident = virIdentityGetSystem();
+    virIdentitySetCurrent(sysident);
+
     if (verbose)
         g_printerr("%s: %lld: initializing signal handlers\n",
                    argv[0], deltams());
-- 
2.39.2

Re: [libvirt PATCH] qemu_shim: set system identity
Posted by Michal Prívozník 1 year, 1 month ago
On 3/15/23 17:02, Ján Tomko wrote:
> Otherwise looking up a secret fails when we try to elevate the identity
> in qemuDomainSecretInfoSetupFromSecret.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=2000410
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>  src/qemu/qemu_shim.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal