a41c76
From 745aed1c66fcde8c8bf14d67622f02a838dd7ae2 Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <745aed1c66fcde8c8bf14d67622f02a838dd7ae2@dist-git>
a41c76
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
a41c76
Date: Wed, 4 Mar 2020 12:42:37 +0100
a41c76
Subject: [PATCH] qemu: pass virDomainObjPtr to qemuExtDevicesSetupCgroup
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Signed-off-by: Ján Tomko <jtomko@redhat.com>
a41c76
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Tested-by: Andrea Bolognani <abologna@redhat.com>
a41c76
(cherry picked from commit 6baf97ef2c7416f3d81bdc6cf20f121b62c8fd4f)
a41c76
Signed-off-by: Ján Tomko <jtomko@redhat.com>
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1694166
a41c76
Message-Id: <fcb334eecdc7d85740f1aa5f7cd9f3d151996f99.1583322090.git.jtomko@redhat.com>
a41c76
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
a41c76
---
a41c76
 src/qemu/qemu_cgroup.c    | 2 +-
a41c76
 src/qemu/qemu_extdevice.c | 3 ++-
a41c76
 src/qemu/qemu_extdevice.h | 2 +-
a41c76
 3 files changed, 4 insertions(+), 3 deletions(-)
a41c76
a41c76
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
a41c76
index 45701b4c6e..57a1231855 100644
a41c76
--- a/src/qemu/qemu_cgroup.c
a41c76
+++ b/src/qemu/qemu_cgroup.c
a41c76
@@ -1262,7 +1262,7 @@ qemuSetupCgroupForExtDevices(virDomainObjPtr vm,
a41c76
                            false, &cgroup_temp) < 0)
a41c76
         goto cleanup;
a41c76
 
a41c76
-    ret = qemuExtDevicesSetupCgroup(driver, vm->def, cgroup_temp);
a41c76
+    ret = qemuExtDevicesSetupCgroup(driver, vm, cgroup_temp);
a41c76
 
a41c76
  cleanup:
a41c76
     virCgroupFree(&cgroup_temp);
a41c76
diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c
a41c76
index 7f3bb104d9..bb73787b8d 100644
a41c76
--- a/src/qemu/qemu_extdevice.c
a41c76
+++ b/src/qemu/qemu_extdevice.c
a41c76
@@ -236,9 +236,10 @@ qemuExtDevicesHasDevice(virDomainDefPtr def)
a41c76
 
a41c76
 int
a41c76
 qemuExtDevicesSetupCgroup(virQEMUDriverPtr driver,
a41c76
-                          virDomainDefPtr def,
a41c76
+                          virDomainObjPtr vm,
a41c76
                           virCgroupPtr cgroup)
a41c76
 {
a41c76
+    virDomainDefPtr def = vm->def;
a41c76
     size_t i;
a41c76
 
a41c76
     for (i = 0; i < def->nvideos; i++) {
a41c76
diff --git a/src/qemu/qemu_extdevice.h b/src/qemu/qemu_extdevice.h
a41c76
index df29968e16..49373a15a1 100644
a41c76
--- a/src/qemu/qemu_extdevice.h
a41c76
+++ b/src/qemu/qemu_extdevice.h
a41c76
@@ -58,5 +58,5 @@ void qemuExtDevicesStop(virQEMUDriverPtr driver,
a41c76
 bool qemuExtDevicesHasDevice(virDomainDefPtr def);
a41c76
 
a41c76
 int qemuExtDevicesSetupCgroup(virQEMUDriverPtr driver,
a41c76
-                              virDomainDefPtr def,
a41c76
+                              virDomainObjPtr vm,
a41c76
                               virCgroupPtr cgroup);
a41c76
-- 
a41c76
2.25.1
a41c76