[libvirt] [PATCH] virDomainDefCopy: Skip ostype checks

Michal Privoznik mprivozn at redhat.com
Sat Jun 2 10:57:39 UTC 2018


When parsing domain XML the virCapsDomainData lookup is performed
in order to fill in missing def->os.arch and def->os.machine
strings. Well, when doing copy of already existing virDomainDef
we don't want any automagic fill in of defaults (and those two
strings are going to be provided at this point anyway by first
parse of the domain XML).

What is even worse is that we do not look up capabilities for
parsed emulator path rather than some generic capabilities for
parsed arch. Therefore, if emulator points to qemu under
non-default path (say $HOME/qemu-system-arm) but there's no such
qemu under the default path (say /usr/bin/qemu-system-arm) the
capabilities lookup fails and creating the copy is denied.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/conf/domain_conf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 86814d5f64..f36a1bfe79 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -28397,7 +28397,8 @@ virDomainDefCopy(virDomainDefPtr src,
     virDomainDefPtr ret;
     unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE;
     unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
-                               VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE;
+                               VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE |
+                               VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS;
 
     if (migratable)
         format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_FORMAT_MIGRATABLE;
-- 
2.16.4




More information about the libvir-list mailing list