[libvirt] [PATCH 0/4] Fix a couple PCI controller/addressing problems
by Laine Stump
1 - makes an error message less specific because it was
misleading/incorrect in many/most cases
2+3 - log a more informative message when you try to put a pcie-root in a 440fx
domain, or a pci-root in a Q35 (or arm/virt) domain
4 - makes it possible to create a Q35 domain in libvirt that doesn't
have a dmi-to-pci-bridge controller (as long as you have something
else in its place).
Laine Stump (4):
qemu: fix error log in qemuAssignPCIAddresses()
conf: make virDomainDefAddController() public
conf: log error when incorrect PCI root controller is added to domain
qemu: don't be as insistent about adding dmi-to-pci-bridge or
pci-bridge
src/conf/domain_conf.c | 2 +-
src/conf/domain_conf.h | 2 ++
src/libvirt_private.syms | 1 +
src/qemu/qemu_domain.c | 55 +++++++++++++++++++++++++++++++-----------
src/qemu/qemu_domain_address.c | 7 +++---
5 files changed, 48 insertions(+), 19 deletions(-)
--
2.5.5
8 years, 8 months
[libvirt] [PATCH] libvirtd.service: add NotifyService=all
by Serge Hallyn
systemd.service(5) says that this should be set when using Type=notify,
and indeed we seem to have a bug report resulting from this not being set:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1574566
Signed-off-by: Serge Hallyn <serge.hallyn(a)ubuntu.com>
---
daemon/libvirtd.service.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in
index 1616e7a..a13f9af 100644
--- a/daemon/libvirtd.service.in
+++ b/daemon/libvirtd.service.in
@@ -24,6 +24,7 @@ KillMode=process
Restart=on-failure
# Override the maximum number of opened files
#LimitNOFILE=2048
+NotifyAccess=all
[Install]
WantedBy=multi-user.target
--
2.7.4
8 years, 8 months
[libvirt] [PATCH 00/13] build: Fix and improve man pages handling
by Andrea Bolognani
There are a bunch of issues in the way we handle man pages;
most importantly, installed man pages (like libvirtd.8) end
up having stuff like
SYSCONFDIR/libvirtd.conf
in the FILES section.
This series makes it so all man pages are generated through the
same steps:
1. process $command.pod (shipped) with pod2man(1) to
convert pod markup to groff markup and obtain
$command.$section.in (shipped)
2. process $command.$section.in with sed(1) to insert
host-specific information such as @sysconfdir@
and obtain $command.$section (not shipped)
As a follow-up improvement, it would be great if we could
abstract those two steps into macros to reduce code duplication
even further. Please provide hints on the best way to
achieve that :)
A number of other minor issues are fixed along the way.
Cheers.
Andrea Bolognani (13):
build: Ship virt-admin.pod
build: Extract pod from source files
build: Build man pages in $(builddir)
build: Perform post-processing on all man pages
build: Standardize on .pod -> .x.in -> .x
build: Never ship man pages
build: Group files
build: Ensure intermediate files are cleaned up properly
build: Replace variables in man pages
build: Always ship virt-login-shell.conf
man: Fix NAME section
man: Fix SYNOPSIS section
man: Fix links
daemon/Makefile.am | 43 +++++----
daemon/{libvirtd.pod.in => libvirtd.pod} | 4 +-
src/Makefile.am | 69 ++++++++------
src/locking/{virtlockd.pod.in => virtlockd.pod} | 4 +-
src/logging/{virtlogd.pod.in => virtlogd.pod} | 4 +-
tools/Makefile.am | 114 +++++++++++++++---------
tools/virsh.pod | 6 +-
tools/virt-admin.pod | 6 +-
tools/virt-host-validate.c | 74 ---------------
tools/virt-host-validate.pod | 68 ++++++++++++++
tools/virt-login-shell.pod | 3 +-
tools/virt-pki-validate.in | 64 -------------
tools/virt-pki-validate.pod | 61 +++++++++++++
tools/virt-sanlock-cleanup.in | 52 -----------
tools/virt-sanlock-cleanup.pod | 49 ++++++++++
tools/virt-xml-validate.in | 113 -----------------------
tools/virt-xml-validate.pod | 111 +++++++++++++++++++++++
17 files changed, 440 insertions(+), 405 deletions(-)
rename daemon/{libvirtd.pod.in => libvirtd.pod} (97%)
rename src/locking/{virtlockd.pod.in => virtlockd.pod} (97%)
rename src/logging/{virtlogd.pod.in => virtlogd.pod} (97%)
create mode 100644 tools/virt-host-validate.pod
create mode 100644 tools/virt-pki-validate.pod
create mode 100644 tools/virt-sanlock-cleanup.pod
create mode 100644 tools/virt-xml-validate.pod
--
2.5.5
8 years, 8 months
[libvirt] [PATCH 1/2] rpc: protocol: Clarify VIR_NET_ERROR usage with streams
by Cole Robinson
The described protocol semantics really only apply to server initiated
stream messages. Document the semantics for client messages.
---
AFAICT, the only time a server will receive VIR_NET_ERROR stream
message from a client is via an explicit virStreamAbort call
(which hits remote_driver.c:remoteStreamAbort)
src/rpc/virnetprotocol.x | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/rpc/virnetprotocol.x b/src/rpc/virnetprotocol.x
index 327a334..9ce33b0 100644
--- a/src/rpc/virnetprotocol.x
+++ b/src/rpc/virnetprotocol.x
@@ -104,7 +104,9 @@ const VIR_NET_MESSAGE_NUM_FDS_MAX = 32;
* - type == VIR_NET_STREAM
* * VIR_NET_CONTINUE if more data is following
* * VIR_NET_OK if stream is complete
- * * VIR_NET_ERROR if stream had an error
+ * * VIR_NET_ERROR
+ * server message: stream had an error
+ * client message: client aborted the stream
*
* Payload varies according to type and status:
*
@@ -125,7 +127,8 @@ const VIR_NET_MESSAGE_NUM_FDS_MAX = 32;
* * status == VIR_NET_CONTINUE
* byte[] raw stream data
* * status == VIR_NET_ERROR
- * remote_error error information
+ * server message: remote_error error information
+ * client message: <empty>
* * status == VIR_NET_OK
* <empty>
*
--
2.7.3
8 years, 8 months
[libvirt] [PATCH 0/3] Yet some install fixes
by Michal Privoznik
After my patches fixing install & uninstall [1] I've found some
other flaws.
The last patch is essential as the problem I'm seeing there
I'm seeing in libvirt-php too. I've came up with an ugly fix
in libvirt-php. But then found a better way of dealing with
it, so if this gets in, I'll mimic it there too.
1: https://www.redhat.com/archives/libvir-list/2016-April/msg01192.html
Michal Privoznik (3):
Makefile: Enable distuninstallcheck again
tools: Introduce install-nss targets
wireshark: Fix distcheck
Makefile.am | 3 ---
m4/virt-wireshark.m4 | 8 +++++++-
tools/Makefile.am | 11 +++++++----
3 files changed, 14 insertions(+), 8 deletions(-)
--
2.7.3
8 years, 8 months
[libvirt] [PATCH] qemuProcessCreatePretendCmd: Rework FIPS handling
by Michal Privoznik
This function - in contrast with qemuBuildCommandLine - merely
constructs our internal command representation of a domain. This
is then later compared against expected output. Or, this function
is used also in virConnectDomainXMLToNative(). But due to a copy
paste error this function, just like its image - has @forceFips
argument that if enabled forces FIPS, otherwise mimics FIPS state
in the host. If FIPS is enabled or forced the generated command
line is different to state in which FIPS is disabled. Problem is,
while this could be desired in the virConnectDomainXMLToNative()
case, this is undesirable in the test suite as it will produce
unpredicted results.
Solution to this is to rename argument to @enableFips to
specifically tell whether we expect command line to be build in
either of fashions and make virConnectDomainXMLToNative()
implementation fetch FIPS state and pass it to
qemuProcessCreatePretendCmd().
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
This flaw has been identified by my big test mock patch set that
has been not merged yet.
src/qemu/qemu_driver.c | 3 ++-
src/qemu/qemu_process.c | 4 ++--
src/qemu/qemu_process.h | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 90f541c..f8b4ab7 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7060,7 +7060,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
}
}
- if (!(cmd = qemuProcessCreatePretendCmd(conn, driver, vm, NULL, false, true,
+ if (!(cmd = qemuProcessCreatePretendCmd(conn, driver, vm, NULL,
+ qemuCheckFips(), true,
VIR_QEMU_PROCESS_START_COLD)))
goto cleanup;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 8a2f65f..0ccc3ac 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5715,7 +5715,7 @@ qemuProcessCreatePretendCmd(virConnectPtr conn,
virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *migrateURI,
- bool forceFips,
+ bool enableFips,
bool standalone,
unsigned int flags)
{
@@ -5747,7 +5747,7 @@ qemuProcessCreatePretendCmd(virConnectPtr conn,
NULL,
VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
standalone,
- forceFips ? true : qemuCheckFips(),
+ enableFips,
priv->autoNodeset,
NULL,
NULL,
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index 98cc9a8..b7262a7 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -85,7 +85,7 @@ virCommandPtr qemuProcessCreatePretendCmd(virConnectPtr conn,
virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *migrateURI,
- bool forceFips,
+ bool enableFips,
bool standalone,
unsigned int flags);
--
2.7.3
8 years, 8 months
[libvirt] [PATCH] virsh: host: Use bitmap size in bytes rather than bit count
by Peter Krempa
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1329819
---
tools/virsh-host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 80ac4bd..c9b2646 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -699,7 +699,7 @@ cmdNodeCpuMap(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
vshPrint(ctl, "%-15s ", _("CPU map:"));
if (pretty) {
- char *str = virBitmapDataToString(cpumap, cpunum);
+ char *str = virBitmapDataToString(cpumap, VIR_DIV_UP(cpunum, 8));
if (!str)
goto cleanup;
--
2.8.1
8 years, 8 months
[libvirt] [PATCH] qemu: Fix off-by-one error in block I/O throttle messages
by Martin Kletzander
QEMU_BLOCK_IOTUNE_MAX is the maximum inclusively, so let's modify the
message so it makes sense.
https://bugzilla.redhat.com/show_bug.cgi?id=1329041
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_driver.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ef4a62dafb5b..9597b307e9de 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1409,7 +1409,7 @@ qemuBuildDriveStr(virConnectPtr conn,
disk->blkdeviotune.size_iops_sec > QEMU_BLOCK_IOTUNE_MAX) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
_("block I/O throttle limit must "
- "be less than %llu using QEMU"), QEMU_BLOCK_IOTUNE_MAX);
+ "be no more than %llu using QEMU"), QEMU_BLOCK_IOTUNE_MAX);
goto error;
}
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 90f541cf6d74..91ed0fa4595a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17529,7 +17529,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
if (param->value.ul > QEMU_BLOCK_IOTUNE_MAX) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
_("block I/O throttle limit value must"
- " be less than %llu"), QEMU_BLOCK_IOTUNE_MAX);
+ " be no more than %llu"), QEMU_BLOCK_IOTUNE_MAX);
goto endjob;
}
--
2.8.1
8 years, 8 months
[libvirt] [PATCH] docs: apibuild: Fix VPATH build
by Peter Krempa
libvirt-common.h is generated into builddir/include/libvirt. apibuild.py
only operated on srcdir/inlcude/libvirt. With VPATH build
srcdir/docs/libvirt-libvirt-common.html would not get generated and make
RPM failed.
---
We still generate the html files and other stuff into the srcdir which is gross,
but's that for a different fix.
docs/Makefile.am | 2 +-
docs/apibuild.py | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 3ca53a4..1b21b5c 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -325,7 +325,7 @@ $(APIBUILD_STAMP): $(srcdir)/apibuild.py \
$(top_srcdir)/src/util/virerror.c \
$(top_srcdir)/src/util/virevent.c \
$(top_srcdir)/src/util/virtypedparam.c
- $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(APIBUILD)
+ $(AM_V_GEN)srcdir=$(srcdir) builddir=$(abs_builddir) $(PYTHON) $(APIBUILD)
touch $@
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 8882759..648036f 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -2584,13 +2584,18 @@ def rebuild(name):
self.warning("rebuild() failed, unknown module %s") % name
return None
builder = None
- srcdir = os.environ["srcdir"]
+ srcdir = os.path.abspath((os.environ["srcdir"]))
+ builddir = os.path.abspath((os.environ["builddir"]))
+ if srcdir == builddir:
+ builddir = None
if glob.glob(srcdir + "/../src/libvirt.c") != [] :
if not quiet:
print "Rebuilding API description for %s" % name
dirs = [srcdir + "/../src",
srcdir + "/../src/util",
srcdir + "/../include/libvirt"]
+ if builddir:
+ dirs.append(builddir + "/../include/libvirt")
if glob.glob(srcdir + "/../include/libvirt/libvirt.h") == [] :
dirs.append("../include/libvirt")
builder = docBuilder(name, srcdir, dirs, [])
--
2.8.1
8 years, 8 months
[libvirt] [libvirt-python][PATCH] sanitytest: Sanitize VIR_TYPED_PARAM_*
by Michal Privoznik
This test checks whether all enums that we produce in libvirt.py
have some reasonable value. But because of some crazy backcompat
we have the following in libvirt-domain.h:
VIR_DOMAIN_SCHED_FIELD_UINT = VIR_TYPED_PARAM_UINT
VIR_DOMAIN_SCHED_FIELD_ULLONG = VIR_TYPED_PARAM_ULLONG
with repetitions for other types. Now, when generating libvirt.py
those values are special cased and thus assigned correct integer
values. But sanitytest is missing the special treatment of
VIR_TYPED_PARAM_* and therefore produces following error:
/usr/bin/python sanitytest.py build/lib.linux-x86_64-2.7 /home/jenkins/build/libvirt/share/libvirt/api/libvirt-api.xml
Cannot get a value of enum VIR_TYPED_PARAM_UINT (originally VIR_DOMAIN_SCHED_FIELD_UINT)
Cannot get a value of enum VIR_TYPED_PARAM_ULLONG (originally VIR_DOMAIN_SCHED_FIELD_ULLONG)
While the test is technically correct, "VIR_TYPED_PARAM_UINT" is
not an integer value, it's a name for an enum value. Yet again,
special handling is missing here, as VIR_DOMAIN_SCHED_FIELD_* has
correct integer value in libvirt.py.
Same applies for VIR_DOMAIN_BLKIO_PARAM_* and
VIR_DOMAIN_MEMORY_PARAM_* which are fixed by this too.
This has been exposed by previous commit of 3026a0593bd040 which
started to generate values for symbols from libvirt-common.h too.
The symbols I'm mentioning above live just in that very file.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
sanitytest.py | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
mode change 100644 => 100755 sanitytest.py
diff --git a/sanitytest.py b/sanitytest.py
old mode 100644
new mode 100755
index faabccb..23163f1
--- a/sanitytest.py
+++ b/sanitytest.py
@@ -22,6 +22,21 @@ def get_libvirt_api_xml_path():
sys.exit(proc.returncode)
return stdout.splitlines()[0]
+def sanitize_enum_val(value):
+ if value == 'VIR_TYPED_PARAM_INT':
+ value = 1
+ elif value == 'VIR_TYPED_PARAM_UINT':
+ value = 2
+ elif value == 'VIR_TYPED_PARAM_LLONG':
+ value = 3
+ elif value == 'VIR_TYPED_PARAM_ULLONG':
+ value = 4
+ elif value == 'VIR_TYPED_PARAM_DOUBLE':
+ value = 5
+ elif value == 'VIR_TYPED_PARAM_BOOLEAN':
+ value = 6
+ return value
+
# Path to the libvirt API XML file
if len(sys.argv) >= 3:
xml = sys.argv[2]
@@ -66,7 +81,7 @@ for n in set:
for n in second_pass:
typ = n.attrib['type']
name = n.attrib['name']
- val = n.attrib['value']
+ val = sanitize_enum_val(n.attrib['value'])
for v in enumvals.values():
if val in v:
--
2.7.3
8 years, 8 months