[libvirt] [PATCH] qemu: Allow cachetune only for KVM domains

Michal Privoznik posted 1 patch 5 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/89fae10bb7063444c8a7938c04d0348ed2f9b2e6.1530189931.git.mprivozn@redhat.com
Test syntax-check passed
src/qemu/qemu_domain.c | 7 +++++++
1 file changed, 7 insertions(+)
[libvirt] [PATCH] qemu: Allow cachetune only for KVM domains
Posted by Michal Privoznik 5 years, 10 months ago
https://bugzilla.redhat.com/show_bug.cgi?id=1541921

In TCG mode, there are no vCPU threads and thus there's nothing
to be placed into resctrl CGroup. Forbid such configuration.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_domain.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index fee44812c1..a39d9a46a0 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3980,6 +3980,13 @@ qemuDomainDefValidate(const virDomainDef *def,
         }
     }
 
+    if (def->ncachetunes &&
+        def->virtType != VIR_DOMAIN_VIRT_KVM) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("cachetune is only supported for KVM domains"));
+        goto cleanup;
+    }
+
     if (qemuDomainDefValidateFeatures(def, qemuCaps) < 0)
         goto cleanup;
 
-- 
2.16.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Allow cachetune only for KVM domains
Posted by Daniel P. Berrangé 5 years, 10 months ago
On Thu, Jun 28, 2018 at 02:45:38PM +0200, Michal Privoznik wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1541921
> 
> In TCG mode, there are no vCPU threads and thus there's nothing
> to be placed into resctrl CGroup. Forbid such configuration.

This reminds me (again) that we need to add MTTCG support to libvirt
which allows one thread per vCPU with TCG.

> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/qemu/qemu_domain.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index fee44812c1..a39d9a46a0 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -3980,6 +3980,13 @@ qemuDomainDefValidate(const virDomainDef *def,
>          }
>      }
>  
> +    if (def->ncachetunes &&
> +        def->virtType != VIR_DOMAIN_VIRT_KVM) {
> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                       _("cachetune is only supported for KVM domains"));
> +        goto cleanup;
> +    }
> +
>      if (qemuDomainDefValidateFeatures(def, qemuCaps) < 0)
>          goto cleanup;

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Allow cachetune only for KVM domains
Posted by Pavel Hrdina 5 years, 10 months ago
On Thu, Jun 28, 2018 at 02:45:38PM +0200, Michal Privoznik wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1541921
> 
> In TCG mode, there are no vCPU threads and thus there's nothing
> to be placed into resctrl CGroup. Forbid such configuration.

Just a small nit, resctrl is not a CGroup.

Pavel
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list