[libvirt] [PATCH 00/17] docs: remove all use of POD for man pages in favour of RST
by Daniel P. Berrangé
As part of the goal to eliminate Perl from libvirt, this gets rid of the
use of POD format for man pages. There's nothing especially bad about
POD as a markup language compared to other lightweight markup languages
like RST or Markdown. It hasn't found widespread usage outside of the
Perl world though, and so switching from POD to RST brings a language
which likely has more familiarity to contributors.
This also nicely aligns with our use of RST of web pages, and indeed
in this series things are setup so that all the man pages get published
on the main libvirt.org website. Over time this will hopefuly draw
search engines traffic to libvirt.org instead of random 3rd party
websites hosting various out of date copies of the man pages.
Reviewing the individual RST files is likely a very unpleasant task,
especially the enourmous virsh man page. Most of the conversion work
was automated with pod2rst, followed by lots of editting to cleanup
its output. virsh had some further automated processing done to create
headers for each command.
It is probably more useful to review the rendered man page output
and/or websites to see that it looks sane when read.
Daniel P. Berrangé (17):
src: update keycodemapdb submodule
rpm: move pod2man & rst2html deps outside the autotools conditional
rpm: use python3-docutils as the direct dep
docs: introduce rst2man as a mandatory tool for building docs
docs: describe the basic RST structure for a man page
docs: convert libvirtd man page from pod to rst
docs: convert virtlockd man page from pod to rst
docs: convert virtlogd man page from pod to rst
docs: convert virt-host-validate man page from pod to rst
docs: convert virt-pki-validate man page from pod to rst
docs: convert virt-xml-validate man page from pod to rst
docs: convert virt-sanlock-cleanup man page from pod to rst
docs: convert virt-login-shell man page from pod to rst
docs: convert virt-admin man page from pod to rst
docs: convert virsh man page from pod to rst
docs: convert virkeycode*/virkeyname* man pages from pod to rst
docs: remove build recipes related to pod2man usage
docs/Makefile.am | 118 +
docs/docs.html.in | 3 +
docs/manpages/index.rst | 37 +
docs/manpages/libvirtd.rst | 259 +
docs/manpages/virsh.rst | 7096 +++++++++++++++++
docs/manpages/virt-admin.rst | 610 ++
docs/manpages/virt-host-validate.rst | 95 +
docs/manpages/virt-login-shell.rst | 144 +
docs/manpages/virt-pki-validate.rst | 89 +
docs/manpages/virt-sanlock-cleanup.rst | 79 +
.../manpages/virt-xml-validate.rst | 107 +-
docs/manpages/virtlockd.rst | 177 +
docs/manpages/virtlogd.rst | 179 +
docs/styleguide.rst | 86 +
libvirt.spec.in | 7 +-
m4/virt-external-programs.m4 | 5 +
src/Makefile.am | 18 -
src/keycodemapdb | 2 +-
src/locking/Makefile.inc.am | 18 -
src/locking/virtlockd.pod | 165 -
src/logging/Makefile.inc.am | 13 -
src/logging/virtlogd.pod | 165 -
src/remote/Makefile.inc.am | 15 -
src/remote/libvirtd.pod | 235 -
src/util/Makefile.inc.am | 47 +-
tools/Makefile.am | 68 -
tools/virsh.pod | 5526 -------------
tools/virt-admin.pod | 497 --
tools/virt-host-validate.pod | 68 -
tools/virt-login-shell.pod | 112 -
tools/virt-pki-validate.pod | 61 -
tools/virt-sanlock-cleanup.pod | 49 -
32 files changed, 9052 insertions(+), 7098 deletions(-)
create mode 100644 docs/manpages/index.rst
create mode 100644 docs/manpages/libvirtd.rst
create mode 100644 docs/manpages/virsh.rst
create mode 100644 docs/manpages/virt-admin.rst
create mode 100644 docs/manpages/virt-host-validate.rst
create mode 100644 docs/manpages/virt-login-shell.rst
create mode 100644 docs/manpages/virt-pki-validate.rst
create mode 100644 docs/manpages/virt-sanlock-cleanup.rst
rename tools/virt-xml-validate.pod => docs/manpages/virt-xml-validate.rst (53%)
create mode 100644 docs/manpages/virtlockd.rst
create mode 100644 docs/manpages/virtlogd.rst
delete mode 100644 src/locking/virtlockd.pod
delete mode 100644 src/logging/virtlogd.pod
delete mode 100644 src/remote/libvirtd.pod
delete mode 100644 tools/virsh.pod
delete mode 100644 tools/virt-admin.pod
delete mode 100644 tools/virt-host-validate.pod
delete mode 100644 tools/virt-login-shell.pod
delete mode 100644 tools/virt-pki-validate.pod
delete mode 100644 tools/virt-sanlock-cleanup.pod
--
2.23.0
5 years
[libvirt] [jenkins-ci PATCH] Update comment for virt-manager
by Andrea Bolognani
We have Python 3 on CentOS 7 now, so the existing comment is no
longer accurate.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as trivial.
guests/playbooks/build/projects/virt-manager.yml | 4 +---
jenkins/projects/virt-manager.yaml | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/guests/playbooks/build/projects/virt-manager.yml b/guests/playbooks/build/projects/virt-manager.yml
index c0d4294..9184a74 100644
--- a/guests/playbooks/build/projects/virt-manager.yml
+++ b/guests/playbooks/build/projects/virt-manager.yml
@@ -1,9 +1,7 @@
---
- set_fact:
name: virt-manager
- # virt-manager is Python 3 only, so it can't be built on CentOS 7;
- # Ubuntu 16.04 has Python 3 but not the libxml2 bindings, so it can't
- # build the project either
+ # CentOS 7 and Ubuntu 16.04 have Python 3 but not the libxml2 bindings
machines:
- libvirt-debian-9
- libvirt-debian-10
diff --git a/jenkins/projects/virt-manager.yaml b/jenkins/projects/virt-manager.yaml
index 3dc8e2e..4524831 100644
--- a/jenkins/projects/virt-manager.yaml
+++ b/jenkins/projects/virt-manager.yaml
@@ -1,9 +1,7 @@
---
- project:
name: virt-manager
- # virt-manager is Python 3 only, so it can't be built on CentOS 7;
- # Ubuntu 16.04 has Python 3 but not the libxml2 bindings, so it can't
- # build the project either
+ # CentOS 7 and Ubuntu 16.04 have Python 3 but not the libxml2 bindings
machines:
- libvirt-debian-9
- libvirt-debian-10
--
2.23.0
5 years
[libvirt] [PATCH v4 0/4] qemu: block: implement optional removal of committed snapshot images
by Pavel Mores
This version incorporates Peter's feedback to v3.
Pavel Mores (4):
qemu: block: propagate the delete flag to where it can actually be
used
qemu: block: use the delete flag to delete snapshot images if
requested
qemu: block: store the delete flag in libvirtd's status XML
qemu: block: enable the snapshot image deletion feature
src/qemu/qemu_blockjob.c | 50 ++++++++++++++++++-
src/qemu/qemu_blockjob.h | 4 +-
src/qemu/qemu_domain.c | 4 ++
src/qemu/qemu_driver.c | 12 ++++-
.../blockjob-blockdev-in.xml | 1 +
5 files changed, 67 insertions(+), 4 deletions(-)
--
2.21.0
5 years
[libvirt] [PATCH] docs: fix duplication variable name for rst files
by Daniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
docs/Makefile.am | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 5f5dce28eb..9462f77458 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -173,10 +173,10 @@ gif = \
internals_html_in = \
$(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
-kbase_rst = \
- $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/kbase/*.rst))
-kbase_rst_html_in = \
- $(kbase_rst:%.rst=%.html.in)
+internals_rst = \
+ $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.rst))
+internals_rst_html_in = \
+ $(internals_rst:%.rst=%.html.in)
internals_html = \
$(internals_html_in:%.html.in=%.html) \
$(internals_rst_html_in:%.html.in=%.html)
--
2.23.0
5 years
[libvirt] [PATCH] Revert "qemu: directly create virResctrlInfo ignoring capabilities"
by Daniel P. Berrangé
This reverts commit 7be5fe66cd024b9ffba7c52cdbf5effedeac2c0d.
This commit broke resctrl, because it missed the fact that the
virResctrlInfoGetCache() has side-effects causing it to actually
change the virResctrlInfo parameter, not merely get data from
it.
This code will need some refactoring before we can try separating
it from virCapabilities again.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_process.c | 24 ++++++++++++++++--------
src/util/virresctrl.h | 2 --
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 10259027c9..23cc528817 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2724,24 +2724,29 @@ qemuProcessSetupEmulator(virDomainObjPtr vm)
static int
-qemuProcessResctrlCreate(virDomainObjPtr vm)
+qemuProcessResctrlCreate(virQEMUDriverPtr driver,
+ virDomainObjPtr vm)
{
+ int ret = -1;
size_t i = 0;
+ virCapsPtr caps = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData;
- g_autoptr(virResctrlInfo) resctrl = NULL;
if (!vm->def->nresctrls)
return 0;
- if (!(resctrl = virResctrlInfoNew()))
+ /* Force capability refresh since resctrl info can change
+ * XXX: move cache info into virresctrl so caps are not needed */
+ caps = virQEMUDriverGetCapabilities(driver, true);
+ if (!caps)
return -1;
for (i = 0; i < vm->def->nresctrls; i++) {
size_t j = 0;
- if (virResctrlAllocCreate(resctrl,
+ if (virResctrlAllocCreate(caps->host.resctrl,
vm->def->resctrls[i]->alloc,
priv->machineName) < 0)
- return -1;
+ goto cleanup;
for (j = 0; j < vm->def->resctrls[i]->nmonitors; j++) {
virDomainResctrlMonDefPtr mon = NULL;
@@ -2749,11 +2754,14 @@ qemuProcessResctrlCreate(virDomainObjPtr vm)
mon = vm->def->resctrls[i]->monitors[j];
if (virResctrlMonitorCreate(mon->instance,
priv->machineName) < 0)
- return -1;
+ goto cleanup;
}
}
- return 0;
+ ret = 0;
+ cleanup:
+ virObjectUnref(caps);
+ return ret;
}
@@ -6881,7 +6889,7 @@ qemuProcessLaunch(virConnectPtr conn,
goto cleanup;
VIR_DEBUG("Setting up resctrl");
- if (qemuProcessResctrlCreate(vm) < 0)
+ if (qemuProcessResctrlCreate(driver, vm) < 0)
goto cleanup;
VIR_DEBUG("Setting up managed PR daemon");
diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h
index 759320d0fd..3dd7c96348 100644
--- a/src/util/virresctrl.h
+++ b/src/util/virresctrl.h
@@ -100,8 +100,6 @@ typedef virResctrlInfo *virResctrlInfoPtr;
virResctrlInfoPtr
virResctrlInfoNew(void);
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(virResctrlInfo, virObjectUnref);
-
int
virResctrlInfoGetCache(virResctrlInfoPtr resctrl,
unsigned int level,
--
2.23.0
5 years
[libvirt] [PATCH 00/30] conf: eliminate use of virCapsPtr for parsing/formatting XML
by Daniel P. Berrangé
The virCapsPtr object is a serious source of performance problems for
the QEMU driver, because populating it means probing every QEMU system
emulator binary installed on the host.
This is is crazy because parsing any single XML document only ever needs
information about a single QEMU binary.
We've already done a great job of untangling stuff with the post-parse
and validation functions, but the job was never quite finished. This
series tackles the last pieces so that parsing & formatting XML will
never use the virCapsPtr object directly. Some of the virt drivers will
still use virCapsPtr in their private callbacks, but the QEMU driver
will instead use the QEMU emulator capabilities cache directly.
The first ten patches are the key bits of work to remove use of the
virCapsPtr parameter from domain XML APIs.
The next thirteen patches remove the (now unused) virCapsPtr parameter
from the domain XML APIs & their callers.
The final six patches help various QEMU driver APIs stop relying
on the virCapsPtr, so that it is no longer even created at startup.
This has a nice benefit on libvirtd startup tie when all 30 QEMU
emulators are installed, reducing it from 4 seconds down to a
fraction of a second.
More work is still needed to follow on from this...
A couple of places in the QEMU driver still use virCapsPtr
- The virConnectGetVersion API.
- The virNodeGetSecurityModel API.
- virDomainGetResctrlMonData API.
In all cases we just need to move to store the relevant data directly
in virQEMUDriverPtr, and not use the virCaps.
next, apps can use virDomainGetCapabilities to fetch info about a
specific QEMU binary they care about to avoid the cost of the
virConnectGetCapabilities API.
There are still times when apps need info in virConnectGetCapabilities
and this will annoyingly probe all QEMU binaries, even though the app
doesn't want the guest info.
virConnectGetCapabilities is one of our very early APIs which now flags
parameter, so this problem is unfixable in that API.
I'm thus included to introduce a new virNodeGetCapabilities that is
specifically only returning information about the host hypervisor.
Essentially the <capabilities> schema, but only the <host> sub-tree.
I do, however, wonder if even this is overkill & we should aim for a
much more fine grained way for reporting host capabilities.
eg if an app wants the host CPU, do they really want to pay the
penality to probe host cache nformation, or NUMA topology and
vica-verca.
I'm not sure what the right kind of tradeoff here is, whether we should
try individual APIs, or have one API and a set of flags to control what
info is filled in.
Daniel P. Berrangé (30):
qemu: cache host arch separately from virCapsPtr
qemu: add machines & arch to fake test capabilities cache
conf: sanitize virDomainSaveStatus & virDomainSaveConfig APIs
conf: sanitize virDomainObjFormat & virDomainDefFormat* APIs
conf: pass in default architecture via domain XML options
conf: move virt type / os type / arch validation to post-parse
conf: don't use passed in caps in post parse method
conf: pass netprefix in the domain parser config struct
conf: move seclabel validation into post-parse phase
conf: pass default sec model in parser config
conf: drop virCapsPtr param from assign addresses callback
conf: drop virCapsPtr param from basic post parse callback
conf: drop virCapsPtr param from post parse data alloc callback
conf: drop virCapsPtr param from post parse callback
conf: drop virCapsPtr param from device post parse callback
conf: drop virCapsPtr param from domain validate callback
conf: drop virCapsPtr param from domain formatting APIs
conf: drop virCapsPtr param from domain post parse & validate APIs
conf: drop virCapsPtr param from domain parse APIs
conf: drop virCapsPtr param from domain APIs for copying config
conf: drop virCapsPtr param from APIs for saving domains
conf: drop virCapsPtr param from domain obj list APIs
conf: drop virCapsPtr param from snapshot & checkpoint APIs
qemu: drop virCapsPtr param & vars from many APIs
conf: move NUMA capabilities into self contained object
qemu: use NUMA capabilities object directly
conf: make virCPUDef into a ref counted struct
qemu: use host CPU object directly
qemu: directly create virResctrlInfo ignoring capabilities
qemu: stop creating capabilities at driver startup
docs/formatdomain.html.in | 6 +-
src/bhyve/bhyve_domain.c | 16 +-
src/bhyve/bhyve_driver.c | 46 +-
src/bhyve/bhyve_process.c | 22 +-
src/conf/capabilities.c | 217 +++++---
src/conf/capabilities.h | 34 +-
src/conf/checkpoint_conf.c | 21 +-
src/conf/checkpoint_conf.h | 2 -
src/conf/cpu_conf.c | 29 +-
src/conf/cpu_conf.h | 4 +
src/conf/domain_conf.c | 404 ++++++--------
src/conf/domain_conf.h | 84 ++-
src/conf/snapshot_conf.c | 28 +-
src/conf/snapshot_conf.h | 3 -
src/conf/virconftypes.h | 3 +
src/conf/virdomainobjlist.c | 9 +-
src/conf/virdomainobjlist.h | 1 -
src/cpu/cpu.c | 3 +-
src/cpu/cpu_arm.c | 5 +-
src/cpu/cpu_ppc64.c | 3 +-
src/cpu/cpu_x86.c | 6 +-
src/esx/esx_driver.c | 14 +-
src/hyperv/hyperv_driver.c | 1 +
src/libvirt_private.syms | 18 +-
src/libxl/libxl_capabilities.c | 23 +-
src/libxl/libxl_conf.c | 3 +-
src/libxl/libxl_conf.h | 2 +-
src/libxl/libxl_domain.c | 37 +-
src/libxl/libxl_driver.c | 83 ++-
src/libxl/libxl_migration.c | 20 +-
src/libxl/xen_xl.c | 13 +-
src/libxl/xen_xm.c | 2 +-
src/lxc/lxc_conf.c | 9 +-
src/lxc/lxc_conf.h | 2 +-
src/lxc/lxc_controller.c | 44 +-
src/lxc/lxc_domain.c | 13 +-
src/lxc/lxc_driver.c | 98 ++--
src/lxc/lxc_native.c | 4 +-
src/lxc/lxc_process.c | 20 +-
src/openvz/openvz_conf.c | 62 ++-
src/openvz/openvz_conf.h | 1 +
src/openvz/openvz_driver.c | 64 +--
src/phyp/phyp_driver.c | 26 +-
src/qemu/qemu_capabilities.c | 176 ++++---
src/qemu/qemu_capabilities.h | 12 +-
src/qemu/qemu_capspriv.h | 10 +
src/qemu/qemu_checkpoint.c | 32 +-
src/qemu/qemu_checkpoint.h | 1 -
src/qemu/qemu_command.c | 6 +-
src/qemu/qemu_conf.c | 57 +-
src/qemu/qemu_conf.h | 18 +-
src/qemu/qemu_domain.c | 108 ++--
src/qemu/qemu_domain.h | 1 -
src/qemu/qemu_driver.c | 293 ++++-------
src/qemu/qemu_hotplug.c | 8 +-
src/qemu/qemu_migration.c | 36 +-
src/qemu/qemu_migration_cookie.c | 8 +-
src/qemu/qemu_process.c | 196 +++----
src/security/virt-aa-helper.c | 2 +-
src/test/test_driver.c | 45 +-
src/util/virresctrl.h | 2 +
src/vbox/vbox_common.c | 16 +-
src/vmware/vmware_conf.c | 2 +-
src/vmware/vmware_driver.c | 25 +-
src/vmx/vmx.c | 23 +-
src/vmx/vmx.h | 2 +-
src/vz/vz_driver.c | 29 +-
tests/Makefile.am | 17 +-
tests/bhyveargv2xmltest.c | 2 +-
tests/bhyvexml2argvtest.c | 2 +-
tests/cputest.c | 11 +-
tests/domaincapstest.c | 14 +-
tests/domainconftest.c | 2 +-
tests/libxlxml2domconfigtest.c | 22 +-
tests/lxcconf2xmltest.c | 17 +-
tests/lxcxml2xmltest.c | 13 +-
tests/openvzutilstest.c | 8 +-
tests/qemuagenttest.c | 2 +-
tests/qemublocktest.c | 2 +-
tests/qemucapabilitiestest.c | 9 +-
tests/qemudomaincheckpointxml2xmltest.c | 4 +-
tests/qemudomainsnapshotxml2xmltest.c | 4 +-
tests/qemuhotplugtest.c | 11 +-
tests/qemumemlocktest.c | 6 +-
tests/qemusecuritytest.c | 1 -
tests/qemuxml2argvtest.c | 35 +-
tests/qemuxml2xmltest.c | 4 +-
tests/securityselinuxlabeltest.c | 2 +-
tests/testutils.c | 39 +-
tests/testutils.h | 5 +-
tests/testutilslxc.c | 34 +-
tests/testutilslxc.h | 4 +
tests/testutilsqemu.c | 670 +++++++-----------------
tests/testutilsqemu.h | 9 +-
tests/testutilsxen.c | 34 +-
tests/testutilsxen.h | 9 +-
tests/vircaps2xmltest.c | 6 +-
tests/vircapstest.c | 11 +-
tests/vmx2xmltest.c | 4 +-
tests/xlconfigtest.c | 27 +-
tests/xmconfigtest.c | 23 +-
tests/xml2vmxtest.c | 4 +-
102 files changed, 1687 insertions(+), 1993 deletions(-)
--
2.23.0
5 years
[libvirt] [PATCH] qemu: honour parseOpaque instead of refetching caps
by Daniel P. Berrangé
The use of the parseOpaque parameter was mistakenly removed in
commit 4a4132b4625778cf80acb9c92d06351b44468ac3
Author: Daniel P. Berrangé <berrange(a)redhat.com>
Date: Tue Dec 3 10:49:49 2019 +0000
conf: don't use passed in caps in post parse method
causing the method to re-fetch qemuCaps that were already just
fetched and put into parseOpaque.
This is inefficient when parsing incoming XML, but for live
XML this is more serious as it means we use the capabilities
for the current QEMU binary on disk, rather than the running
QEMU.
That commit, however, did have a useful side effect of fixing
a crasher bug in the qemu post parse callback introduced by
commit 5e939cea896fb3373a6f68f86e325c657429ed3d
Author: Jiri Denemark <jdenemar(a)redhat.com>
Date: Thu Sep 26 18:42:02 2019 +0200
qemu: Store default CPU in domain XML
The qemuDomainDefSetDefaultCPU() method in that patch did not
allow for the possibility that qemuCaps would be NULL and thus
resulted in a SEGV.
This shows a risk in letting each check in the post parse
callback look for qemuCaps == NULL. The safer option is to
check once upfront and immediately stop (postpone) further
validation.
Honouring the cached caps for the live status XML, highlights
a second flaw, which is that it shouldn't check the virt
type or arch for running guests. The info needed to check this
is not in the cache caps, only the list of flags are populated.
Thus some of the post parse logic is made to only run for
inactive guests. This showed a bug in one test data file which
lacked an ID attribute for the live guest.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_domain.c | 52 +++++++++++--------
.../qemustatusxml2xmldata/vcpus-multi-in.xml | 2 +-
2 files changed, 31 insertions(+), 23 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 6f53e17b6a..2abe93c829 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4703,16 +4703,17 @@ static int
qemuDomainDefPostParse(virDomainDefPtr def,
unsigned int parseFlags,
void *opaque,
- void *parseOpaque G_GNUC_UNUSED)
+ void *parseOpaque)
{
virQEMUDriverPtr driver = opaque;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
- g_autoptr(virQEMUCaps) qemuCaps = NULL;
+ /* Note that qemuCaps may be NULL when this function is called. This
+ * function shall not fail in that case. It will be re-run on VM startup
+ * with the capabilities populated. */
+ virQEMUCapsPtr qemuCaps = parseOpaque;
- if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
- def->emulator))) {
+ if (!qemuCaps)
return 1;
- }
if (def->os.type != VIR_DOMAIN_OSTYPE_HVM) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -4721,18 +4722,31 @@ qemuDomainDefPostParse(virDomainDefPtr def,
return -1;
}
- if (!virQEMUCapsIsArchSupported(qemuCaps, def->os.arch)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Emulator '%s' does not support arch '%s'"),
- def->emulator, virArchToString(def->os.arch));
- return -1;
- }
+ if (def->id == -1) {
+ if (!virQEMUCapsIsArchSupported(qemuCaps, def->os.arch)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Emulator '%s' does not support arch '%s'"),
+ def->emulator, virArchToString(def->os.arch));
+ return -1;
+ }
- if (!virQEMUCapsIsVirtTypeSupported(qemuCaps, def->virtType)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Emulator '%s' does not support virt type '%s'"),
- def->emulator, virDomainVirtTypeToString(def->virtType));
- return -1;
+ if (!virQEMUCapsIsVirtTypeSupported(qemuCaps, def->virtType)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Emulator '%s' does not support virt type '%s'"),
+ def->emulator, virDomainVirtTypeToString(def->virtType));
+ return -1;
+ }
+ if (!def->os.machine) {
+ const char *machine = virQEMUCapsGetPreferredMachine(qemuCaps,
+ def->virtType);
+ def->os.machine = g_strdup(machine);
+ }
+ } else {
+ if (!def->os.machine) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("missing machine type"));
+ return -1;
+ }
}
if (def->os.bootloader || def->os.bootloaderArgs) {
@@ -4741,12 +4755,6 @@ qemuDomainDefPostParse(virDomainDefPtr def,
return -1;
}
- if (!def->os.machine) {
- const char *machine = virQEMUCapsGetPreferredMachine(qemuCaps,
- def->virtType);
- def->os.machine = g_strdup(machine);
- }
-
qemuDomainNVRAMPathGenerate(cfg, def);
if (qemuDomainDefAddDefaultDevices(def, qemuCaps) < 0)
diff --git a/tests/qemustatusxml2xmldata/vcpus-multi-in.xml b/tests/qemustatusxml2xmldata/vcpus-multi-in.xml
index 11ec74ecf8..be48c55fe0 100644
--- a/tests/qemustatusxml2xmldata/vcpus-multi-in.xml
+++ b/tests/qemustatusxml2xmldata/vcpus-multi-in.xml
@@ -310,7 +310,7 @@
<allowReboot value='yes'/>
<blockjobs active='no'/>
<agentTimeout>-2</agentTimeout>
- <domain type='kvm'>
+ <domain type='kvm' id='1729'>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219100</memory>
--
2.23.0
5 years
[libvirt] [PATCH] virkeyfile: fix compilation error with clang
by Pavel Hrdina
Clang complains about condition being always true:
src/util/virkeyfile.c:113:23: error: result of comparison of constant 128 with expression of type 'const char' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
while (!IS_EOF && IS_ASCII(CUR) && CUR != ']')
^~~~~~~~~~~~~
src/util/virkeyfile.c:80:26: note: expanded from macro 'IS_ASCII'
~~~ ^ ~~~
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/util/virkeyfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virkeyfile.c b/src/util/virkeyfile.c
index 816bfae96d..ee29bd7aa6 100644
--- a/src/util/virkeyfile.c
+++ b/src/util/virkeyfile.c
@@ -77,7 +77,7 @@ struct _virKeyFileParserCtxt {
#define IS_EOF (ctxt->cur >= ctxt->end)
#define IS_EOL(c) (((c) == '\n') || ((c) == '\r'))
#define IS_BLANK(c) (((c) == ' ') || ((c) == '\t'))
-#define IS_ASCII(c) ((c) < 128)
+#define IS_ASCII(c) (((unsigned char) c) < 128)
#define CUR (*ctxt->cur)
#define NEXT if (!IS_EOF) ctxt->cur++;
--
2.23.0
5 years
[libvirt] [perl PATCH 0/6] Misc fixes to perl APIs and new migrate constant
by Daniel P. Berrangé
Daniel P. Berrangé (6):
Fix typo breaking some migrate parameter handling
Add handling for VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS
Add support for VIR_MIGRATE_PARAM_TLS_DESTINATION constant
Add missing create_checkpoint method
Remove docs for has_metadata method which doesn't exist
Fix data type for VIR_CONNECT_IDENTITY_SASL_USER_NAME
Changes | 9 +++++++++
lib/Sys/Virt.xs | 25 +++++++++++++++++++++----
lib/Sys/Virt/Domain.pm | 26 ++++++++++++++++++++++++++
lib/Sys/Virt/DomainCheckpoint.pm | 5 -----
4 files changed, 56 insertions(+), 9 deletions(-)
--
2.23.0
5 years