::
- cpu-compare FILE [--error]
+ cpu-compare FILE [--error] [--validate]
Compare CPU definition from XML <file> with host CPU. (See
``hypervisor-cpu-compare`` command for comparing the CPU definition with the CPU
`https://libvirt.org/formatdomain.html#elementsCPU <https://libvirt.org/formatdomain.html#elementsCPU>`__. If *--error* is
specified, the command will return an error when the given CPU is
incompatible with host CPU and a message providing more details about the
-incompatibility will be printed out.
+incompatibility will be printed out. If *--validate* is specified, validates
+the format of the XML document against an internal RNG schema.
cpu-models
::
- hypervisor-cpu-compare FILE [virttype] [emulator] [arch] [machine] [--error]
+ hypervisor-cpu-compare FILE [virttype] [emulator] [arch] [machine] [--error] [--validate]
Compare CPU definition from XML <file> with the CPU the hypervisor is able to
provide on the host. (This is different from ``cpu-compare`` which compares the
*machine* specifies the machine type. If *--error* is specified, the command
will return an error when the given CPU is incompatible with the host CPU and a
message providing more details about the incompatibility will be printed out.
+If *--validate* is specified, validates the format of the XML document against
+an internal RNG schema.
hypervisor-cpu-baseline
.type = VSH_OT_BOOL,
.help = N_("report error if CPUs are incompatible")
},
+ {.name = "validate",
+ .type = VSH_OT_BOOL,
+ .help = N_("validate the XML document against schema")
+ },
{.name = NULL}
};
if (vshCommandOptBool(cmd, "error"))
flags |= VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE;
+ if (vshCommandOptBool(cmd, "validate"))
+ flags |= VIR_CONNECT_COMPARE_CPU_VALIDATE_XML;
+
if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
return false;
.type = VSH_OT_BOOL,
.help = N_("report error if CPUs are incompatible")
},
+ {.name = "validate",
+ .type = VSH_OT_BOOL,
+ .help = N_("validate the XML document against schema")
+ },
{.name = NULL}
};
if (vshCommandOptBool(cmd, "error"))
flags |= VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE;
+ if (vshCommandOptBool(cmd, "validate"))
+ flags |= VIR_CONNECT_COMPARE_CPU_VALIDATE_XML;
+
if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0 ||
vshCommandOptStringReq(ctl, cmd, "virttype", &virttype) < 0 ||
vshCommandOptStringReq(ctl, cmd, "emulator", &emulator) < 0 ||