[libvirt] [PATCH v6 3/9] libxl: warn about ignored CPU mode=custom

Marek Marczykowski-Górecki posted 9 patches 7 years, 3 months ago
There is a newer version of this series
[libvirt] [PATCH v6 3/9] libxl: warn about ignored CPU mode=custom
Posted by Marek Marczykowski-Górecki 7 years, 3 months ago
When support for mode=custom will be added in the future, semantics of
current config will change. Reduce the surprise by emitting a warning.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
Changes since v5:
 - new patch, instead of "libxl: error out on not supported CPU mode,
 instead of silently ignoring"
---
 src/libxl/libxl_conf.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index e7727a1..dcfdd67 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -389,6 +389,12 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
             libxl_defbool_set(&b_info->u.hvm.nested_hvm, hasHwVirt);
         }
 
+        if (def->cpu && def->cpu->mode == VIR_CPU_MODE_CUSTOM) {
+            VIR_WARN("Ignoring CPU with mode=custom, update your config to "
+                     "mode=host-passthrough to avoid risk of changed guest "
+                     "semantics when mode=custom is supported in the future");
+        }
+
         if (def->nsounds > 0) {
             /*
              * Use first sound device.  man xl.cfg(5) describes soundhw as
-- 
git-series 0.9.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v6 3/9] libxl: warn about ignored CPU mode=custom
Posted by Daniel P. Berrangé 7 years, 3 months ago
On Wed, Mar 21, 2018 at 05:32:27PM +0100, Marek Marczykowski-Górecki wrote:
> When support for mode=custom will be added in the future, semantics of
> current config will change. Reduce the surprise by emitting a warning.
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
> Changes since v5:
>  - new patch, instead of "libxl: error out on not supported CPU mode,
>  instead of silently ignoring"
> ---
>  src/libxl/libxl_conf.c | 6 ++++++
>  1 file changed, 6 insertions(+)

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