Validation is usually performed on an entire document. If we are only
interested in validating a single nested node that can occur in
different contexts, this would require writing different schemas for
any of those different contexts.
By temporarily replacing the document's root node, we can validate the
relevant node only.
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
`virsh cpu-compare` and `virsh hypervisor-cpu-compare` both accept
guest and host cpu definitions. This schema is able to validate both
possibilities.
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This also inlines the defintions for "cpufeature", "cpuspec",
"featureName" and "pagesHost", as "cpu" was the only user.
Doing so avoids a naming collision when cputypes.rng is included in
other schemas in a later patch.
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Quotation marks were used ~ 7000 times, apostrophes ~ 3000 times.
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
There is no such <storage> element, <capacity> and <allocation> exist at
the top level.
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
I left in a 'return' or 'goto cleanup' in a few places
where I did the conversion manually.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reported-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
We do not have a legacy API for listing network ports
so there's nothing to fall back on.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Switch the allocation in virshSnapshotListCollect and
its cargo-culted Checkpoint counterpart to two separate
g_new0 calls and move the boolean expression to
the if condition that chooses between them.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Starting with Linux 5.9, Xen Dom0 works on commonly available
AArch64 devices, such as the Raspberry Pi 4.
Reference: https://xenproject.org/2020/09/29/xen-on-raspberry-pi-4-adventures/
Signed-off-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
There is present no XML test coverage for this.
Add genericxml parse + formatting coverage.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Modify virCPUarmCompare in cpu_arm.c to perform compare action.
This patch only adds host to host CPU compare, the rest cases
remains the same. This is useful for source and destination host
compare during migrations to avoid migration between different
CPU models that have different CPU freatures.
Signed-off-by: Zhenyu Zheng <zheng.zhenyu@outlook.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Move them to separate conditions to reduce churn
in following patches.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Change the interface of esxUtil_ResolveHostname() to return a newly
allocated string with the result address, instead of forcing the callers
to provide a buffer and its size. This way we can simply (auto)free the
string, and make the function stacks smaller.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Call freeaddrinfo() as soon as @result is not needed anymore, i.e. right
after getnameinfo(); this avoids calling freeaddrinfo() in two branches.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
spicevmc is the most common <redirdev> usage. This adds an XML example
for it.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Currently it is visually at the same indent as <seclabel>. This
fixes it to be grouped it with <devices>
Fixes: d4abb7b45d
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
libvirt doesn't reject this but only one <driver> element takes
effect.
Drop the instance that is already referenced in the previous example
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Previous refactors allow us to plainly replace all VIR_FREE by g_free to
finish the modernization of the file.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Restructure the control-flow a bit using an temporary variable to avoid
the need to use VIR_FREE.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Use modern allocators, automatic memory feeing, and decrease the scope
of some variables to remove the 'cleanup' label.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Use modern allocators, automatic memory feeing, and decrease the scope
of some variables to remove the 'error' and 'cleanup' labels.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Use modern allocators, automatic memory feeing, and decrease the scope
of some variables to remove the 'error' label.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>