d76c62
From 26d83d4f99fbdebf9546ebb883535a85dda2fbad Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <26d83d4f99fbdebf9546ebb883535a85dda2fbad@dist-git>
d76c62
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
d76c62
Date: Wed, 4 Mar 2020 12:42:43 +0100
d76c62
Subject: [PATCH] qemu: add virtiofsd_debug to qemu.conf
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
Add a 'virtiofsd_debug' option for tuning whether to run virtiofsd
d76c62
in debug mode.
d76c62
d76c62
Signed-off-by: Ján Tomko <jtomko@redhat.com>
d76c62
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
d76c62
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
d76c62
Tested-by: Andrea Bolognani <abologna@redhat.com>
d76c62
(cherry picked from commit f04319a5449974f1553458e96c2a6ee25e65ab93)
d76c62
Signed-off-by: Ján Tomko <jtomko@redhat.com>
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1694166
d76c62
Message-Id: <6e46af8184e9e982a6aca92a62534623795bb1fc.1583322091.git.jtomko@redhat.com>
d76c62
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
d76c62
---
d76c62
 src/qemu/libvirtd_qemu.aug         | 1 +
d76c62
 src/qemu/qemu.conf                 | 7 +++++++
d76c62
 src/qemu/qemu_conf.c               | 2 ++
d76c62
 src/qemu/qemu_conf.h               | 1 +
d76c62
 src/qemu/test_libvirtd_qemu.aug.in | 1 +
d76c62
 5 files changed, 12 insertions(+)
d76c62
d76c62
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug
d76c62
index 557b6f38f8..3014fa6b86 100644
d76c62
--- a/src/qemu/libvirtd_qemu.aug
d76c62
+++ b/src/qemu/libvirtd_qemu.aug
d76c62
@@ -116,6 +116,7 @@ module Libvirtd_qemu =
d76c62
    let nvram_entry = str_array_entry "nvram"
d76c62
 
d76c62
    let debug_level_entry = int_entry "gluster_debug_level"
d76c62
+                 | bool_entry "virtiofsd_debug"
d76c62
 
d76c62
    let memory_entry = str_entry "memory_backing_dir"
d76c62
 
d76c62
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
d76c62
index b6805ffc41..815d2d78ae 100644
d76c62
--- a/src/qemu/qemu.conf
d76c62
+++ b/src/qemu/qemu.conf
d76c62
@@ -809,6 +809,13 @@
d76c62
 #
d76c62
 #gluster_debug_level = 9
d76c62
 
d76c62
+# virtiofsd debug
d76c62
+#
d76c62
+# Whether to enable the debugging output of the virtiofsd daemon.
d76c62
+# Possible values are 0 or 1. Disabled by default.
d76c62
+#
d76c62
+#virtiofsd_debug = 1
d76c62
+
d76c62
 # To enhance security, QEMU driver is capable of creating private namespaces
d76c62
 # for each domain started. Well, so far only "mount" namespace is supported. If
d76c62
 # enabled it means qemu process is unable to see all the devices on the system,
d76c62
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
d76c62
index 029996427e..7aaf2862a4 100644
d76c62
--- a/src/qemu/qemu_conf.c
d76c62
+++ b/src/qemu/qemu_conf.c
d76c62
@@ -801,6 +801,8 @@ virQEMUDriverConfigLoadDebugEntry(virQEMUDriverConfigPtr cfg,
d76c62
 {
d76c62
     if (virConfGetValueUInt(conf, "gluster_debug_level", &cfg->glusterDebugLevel) < 0)
d76c62
         return -1;
d76c62
+    if (virConfGetValueBool(conf, "virtiofsd_debug", &cfg->virtiofsdDebug) < 0)
d76c62
+        return -1;
d76c62
 
d76c62
     return 0;
d76c62
 }
d76c62
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
d76c62
index b9401635d7..4361f5b2bb 100644
d76c62
--- a/src/qemu/qemu_conf.h
d76c62
+++ b/src/qemu/qemu_conf.h
d76c62
@@ -202,6 +202,7 @@ struct _virQEMUDriverConfig {
d76c62
     virFirmwarePtr *firmwares;
d76c62
     size_t nfirmwares;
d76c62
     unsigned int glusterDebugLevel;
d76c62
+    bool virtiofsdDebug;
d76c62
 
d76c62
     char *memoryBackingDir;
d76c62
 
d76c62
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
d76c62
index dd90edf687..fca9a942c9 100644
d76c62
--- a/src/qemu/test_libvirtd_qemu.aug.in
d76c62
+++ b/src/qemu/test_libvirtd_qemu.aug.in
d76c62
@@ -98,6 +98,7 @@ module Test_libvirtd_qemu =
d76c62
 }
d76c62
 { "stdio_handler" = "logd" }
d76c62
 { "gluster_debug_level" = "9" }
d76c62
+{ "virtiofsd_debug" = "1" }
d76c62
 { "namespaces"
d76c62
     { "1" = "mount" }
d76c62
 }
d76c62
-- 
d76c62
2.25.1
d76c62