]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_shim: set system identity
authorJán Tomko <jtomko@redhat.com>
Wed, 15 Mar 2023 15:21:49 +0000 (16:21 +0100)
committerJán Tomko <jtomko@redhat.com>
Wed, 22 Mar 2023 13:41:28 +0000 (14:41 +0100)
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>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_shim.c

index 7b5858307414079924a738920cd9853ba1a1aee6..b642f6175a84e7dfb1dfc3101795a62fde4324cc 100644 (file)
@@ -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());