From: Jiri Denemark Date: Tue, 2 Jun 2020 22:28:10 +0000 (+0200) Subject: conf: Advertise migratable attribute for CPU in domcaps X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=120ac100fdf2413c56f1b55803fd45c28ac42079;p=libvirt.git conf: Advertise migratable attribute for CPU in domcaps Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in index 7df9f0bbbf..1506f79818 100644 --- a/docs/formatdomaincaps.html.in +++ b/docs/formatdomaincaps.html.in @@ -201,7 +201,12 @@ <domainCapabilities> ... <cpu> - <mode name='host-passthrough' supported='yes'/> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> <mode name='host-model' supported='yes'> <model fallback='allow'>Broadwell</model> <vendor>Intel</vendor> @@ -227,7 +232,11 @@
host-passthrough
-
No mode specific details are provided.
+
+ The hostPassthroughMigratable enum shows possible values + of the migratable attribute for the <cpu> element + with mode='host-passthrough' in the domain XML. +
host-model
diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng index 682cc82177..325581476d 100644 --- a/docs/schemas/domaincaps.rng +++ b/docs/schemas/domaincaps.rng @@ -99,6 +99,9 @@ host-passthrough + + + diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 921d795630..0fa8aee78e 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -412,10 +412,21 @@ virDomainCapsCPUFormat(virBufferPtr buf, virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); - virBufferAsprintf(buf, "\n", + virBufferAsprintf(buf, "hostPassthrough ? "yes" : "no"); + if (cpu->hostPassthrough && cpu->hostPassthroughMigratable.report) { + virBufferAddLit(buf, ">\n"); + virBufferAdjustIndent(buf, 2); + ENUM_PROCESS(cpu, hostPassthroughMigratable, + virTristateSwitchTypeToString); + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + } else { + virBufferAddLit(buf, "/>\n"); + } + virBufferAsprintf(buf, "hostModel) { diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 9f4a23d015..685d5e2a44 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -145,6 +145,7 @@ typedef struct _virDomainCapsCPU virDomainCapsCPU; typedef virDomainCapsCPU *virDomainCapsCPUPtr; struct _virDomainCapsCPU { bool hostPassthrough; + virDomainCapsEnum hostPassthroughMigratable; virCPUDefPtr hostModel; virDomainCapsCPUModelsPtr custom; };