From 6df8b363f751ec75c305602a4ef0a77b261b1384 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Fri, 18 Dec 2009 14:37:09 +0100 Subject: [PATCH] XML schema for CPU flags XML schema for CPU flags Firstly, CPU topology and model with optional features have to be advertised in host capabilities: ARCHITECTURE NAME ... Secondly, drivers which support detailed CPU specification have to advertise it in guest capabilities: ... And finally, CPU may be configured in domain XML configuration: ... NAME Where MATCH can be one of: - 'minimum' specified CPU is the minimum requested CPU - 'exact' disable all additional features provided by host CPU - 'strict' fail if host CPU doesn't exactly match POLICY can be one of: - 'force' turn on the feature, even if host doesn't have it - 'require' fail if host doesn't have the feature - 'optional' match host - 'disable' turn off the feature, even if host has it - 'forbid' fail if host has the feature 'force' and 'disable' policies turn on/off the feature regardless of its availability on host. 'force' is unlikely to be used but its there for completeness since Xen and VMWare allow it. 'require' and 'forbid' policies prevent a guest from being started on a host which doesn't/does have the feature. 'forbid' is for cases where you disable the feature but a guest may still try to access it anyway and you don't want it to succeed. 'optional' policy sets the feature according to its availability on host. When a guest is booted on a host that has the feature and then migrated to another host, the policy changes to 'require' as we can't take the feature away from a running guest. Default policy for features provided by host CPU but not specified in domain configuration is set using match attribute of cpu tag. If 'minimum' match is requested, additional features will be treated as if they were specified with 'optional' policy. 'exact' match implies 'disable' policy and 'strict' match stands for 'forbid' policy. * docs/schemas/capability.rng docs/schemas/domain.rng: extend the RelaxNG schemas to add CPU flags support --- docs/schemas/capability.rng | 46 ++++++++++++++++++++++++++- docs/schemas/domain.rng | 62 +++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng index 3e8944c392..378652e5ad 100644 --- a/docs/schemas/capability.rng +++ b/docs/schemas/capability.rng @@ -25,6 +25,9 @@ + + + @@ -67,6 +70,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -259,6 +287,11 @@ + + + + + @@ -293,8 +326,14 @@ + + + [0-9]+ + + + - + [0-9]+ @@ -305,4 +344,9 @@ + + + [a-zA-Z0-9\-_]+ + + diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng index 784f9b1a55..566b11753c 100644 --- a/docs/schemas/domain.rng +++ b/docs/schemas/domain.rng @@ -27,6 +27,9 @@ + + + @@ -1234,6 +1237,55 @@ + + + + + + minimum + exact + strict + + + + + + + + + + + + + + + + + + + + + + + + force + require + optional + disable + forbid + + + + + + + + + + +