[libvirt] [PATCH v7 00/20] Refactor virQEMUCapsInitQMPCommand (for BaselineHypervisorCPU using QEMU QMP exchanges)
by Jiri Denemark
This series is a replacement for the refactoring part (the first 22
patches) of the "BaselineHypervisorCPU using QEMU QMP exchanges" series
[1] from Chris.
In a nutshell this series moves virQEMUCapsInitQMPCommand related code
to qemu_process.c and refactors it so that it can be used by both the
QEMU capabilities probing code and the upcoming code for calling QMP
commands internally for some CPU related APIs on s390.
I'm sending this refactoring part separated because it's mostly ready
for being pushed. I ACKed most of the patches in v6, but some patches
needed to be modified a bit or replaced by a bit different code. Thus
I'm sending them for review rather than pushing this part right away.
See individual patches for changes since v6.
[1] https://www.redhat.com/archives/libvir-list/2019-January/msg00310.html
Chris Venteicher (15):
qemu_process: Move process code from qemu_capabilities
qemu_process: Rename identifiers moved from qemu_capabilities
qemu_process: Limit qemuProcessQMPNew to const input strings
qemu_process: Refer to proc not cmd in process code
qemu_process: Use consistent name for stop process function
qemu_capabilities: Stop QEMU process before freeing
qemu_process: Use qemuProcessQMP struct for a single process
qemu_process: Introduce qemuProcessQMPStart
qemu_process: Move monitor code to qemuProcessQMPConnectMonitor
qemu_process: Store libDir in qemuProcessQMP struct
qemu_process: Setup paths within qemuProcessQMPInit
qemu_process: Stop retaining monitor config in qemuProcessQMP
qemu_process: Document and cleanup qemuProcessQMPNew
qemu_process: Use unique directories for QMP processes
qemu_process: Enter QMP command mode when starting QEMU Process
Jiri Denemark (5):
qemu_capabilities: Refactor virQEMUCapsInitQMP
qemu_process: Don't ignore errors in virQEMUCapsInit
qemu_capabilities: Log probe failure in virQEMUCapsInitQMPSingle
qemu_process: Hide qmperr inside qemuProcessQMP
qemu_process: Hide qemuProcessQMPStop
src/qemu/qemu_capabilities.c | 356 ++++++-----------------------------
src/qemu/qemu_process.c | 324 +++++++++++++++++++++++++++++++
src/qemu/qemu_process.h | 29 +++
src/qemu/qemu_processpriv.h | 2 +
tests/qemucapabilitiestest.c | 9 +
5 files changed, 419 insertions(+), 301 deletions(-)
--
2.20.1
5 years, 9 months
[libvirt] [jenkins-ci PATCH 0/5] Tidy up top-level directory and fix a few small issues
by Andrea Bolognani
Andrea Bolognani (5):
jenkins: Move all Jenkins-related files
README: Add short overview of the repository
guests: Fix a small issue in README
jenkins: Fix a couple small issues in README
jenkins: Add YAML start of document marker
README.markdown | 56 ++++---------------
guests/README.markdown | 2 +-
README.markdown => jenkins/README.markdown | 18 +++---
{jobs => jenkins/jobs}/autotools.yaml | 2 +-
{jobs => jenkins/jobs}/defaults.yaml | 2 +-
{jobs => jenkins/jobs}/generic.yaml | 2 +-
{jobs => jenkins/jobs}/go.yaml | 2 +-
{jobs => jenkins/jobs}/perl-modulebuild.yaml | 2 +-
{jobs => jenkins/jobs}/python-distutils.yaml | 2 +-
.../projects}/libosinfo+mingw32.yaml | 2 +-
.../projects}/libosinfo+mingw64.yaml | 2 +-
{projects => jenkins/projects}/libosinfo.yaml | 2 +-
.../projects}/libvirt+mingw32.yaml | 2 +-
.../projects}/libvirt+mingw64.yaml | 2 +-
.../projects}/libvirt-cim.yaml | 2 +-
.../projects}/libvirt-dbus.yaml | 2 +-
.../projects}/libvirt-glib+mingw32.yaml | 2 +-
.../projects}/libvirt-glib+mingw64.yaml | 2 +-
.../projects}/libvirt-glib.yaml | 2 +-
.../projects}/libvirt-go-xml.yaml | 2 +-
.../projects}/libvirt-go.yaml | 2 +-
.../projects}/libvirt-ocaml.yaml | 2 +-
.../projects}/libvirt-perl.yaml | 2 +-
.../projects}/libvirt-python.yaml | 2 +-
.../projects}/libvirt-sandbox.yaml | 2 +-
.../projects}/libvirt-tck.yaml | 2 +-
{projects => jenkins/projects}/libvirt.yaml | 2 +-
.../projects}/osinfo-db-tools+mingw32.yaml | 2 +-
.../projects}/osinfo-db-tools+mingw64.yaml | 2 +-
.../projects}/osinfo-db-tools.yaml | 2 +-
{projects => jenkins/projects}/osinfo-db.yaml | 2 +-
.../projects}/virt-manager.yaml | 2 +-
.../projects}/virt-viewer+mingw32.yaml | 2 +-
.../projects}/virt-viewer+mingw64.yaml | 2 +-
.../projects}/virt-viewer.yaml | 2 +-
35 files changed, 51 insertions(+), 89 deletions(-)
copy README.markdown => jenkins/README.markdown (65%)
rename {jobs => jenkins/jobs}/autotools.yaml (99%)
rename {jobs => jenkins/jobs}/defaults.yaml (99%)
rename {jobs => jenkins/jobs}/generic.yaml (99%)
rename {jobs => jenkins/jobs}/go.yaml (99%)
rename {jobs => jenkins/jobs}/perl-modulebuild.yaml (99%)
rename {jobs => jenkins/jobs}/python-distutils.yaml (99%)
rename {projects => jenkins/projects}/libosinfo+mingw32.yaml (98%)
rename {projects => jenkins/projects}/libosinfo+mingw64.yaml (98%)
rename {projects => jenkins/projects}/libosinfo.yaml (99%)
rename {projects => jenkins/projects}/libvirt+mingw32.yaml (98%)
rename {projects => jenkins/projects}/libvirt+mingw64.yaml (98%)
rename {projects => jenkins/projects}/libvirt-cim.yaml (98%)
rename {projects => jenkins/projects}/libvirt-dbus.yaml (99%)
rename {projects => jenkins/projects}/libvirt-glib+mingw32.yaml (98%)
rename {projects => jenkins/projects}/libvirt-glib+mingw64.yaml (98%)
rename {projects => jenkins/projects}/libvirt-glib.yaml (99%)
rename {projects => jenkins/projects}/libvirt-go-xml.yaml (99%)
rename {projects => jenkins/projects}/libvirt-go.yaml (99%)
rename {projects => jenkins/projects}/libvirt-ocaml.yaml (99%)
rename {projects => jenkins/projects}/libvirt-perl.yaml (99%)
rename {projects => jenkins/projects}/libvirt-python.yaml (99%)
rename {projects => jenkins/projects}/libvirt-sandbox.yaml (99%)
rename {projects => jenkins/projects}/libvirt-tck.yaml (99%)
rename {projects => jenkins/projects}/libvirt.yaml (99%)
rename {projects => jenkins/projects}/osinfo-db-tools+mingw32.yaml (98%)
rename {projects => jenkins/projects}/osinfo-db-tools+mingw64.yaml (98%)
rename {projects => jenkins/projects}/osinfo-db-tools.yaml (99%)
rename {projects => jenkins/projects}/osinfo-db.yaml (99%)
rename {projects => jenkins/projects}/virt-manager.yaml (99%)
rename {projects => jenkins/projects}/virt-viewer+mingw32.yaml (98%)
rename {projects => jenkins/projects}/virt-viewer+mingw64.yaml (98%)
rename {projects => jenkins/projects}/virt-viewer.yaml (99%)
--
2.20.1
5 years, 9 months
[libvirt] [PATCH] remove remains of kqemu
by Ján Tomko
We dropped support in commit 8e91a40 (November 2015), but some
occurrences still remained, even in live code.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
Reported-by: Thomas Huth <thuth(a)redhat.com>
---
docs/drvqemu.html.in | 2 +-
docs/formatdomain.html.in | 2 +-
src/qemu/qemu.conf | 2 +-
src/qemu/qemu_cgroup.c | 2 +-
src/qemu/qemu_driver.c | 3 ---
src/qemu/test_libvirtd_qemu.aug.in | 5 ++---
src/security/apparmor/libvirt-qemu | 1 -
7 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/docs/drvqemu.html.in b/docs/drvqemu.html.in
index 5ad956740f..0218b5a7a9 100644
--- a/docs/drvqemu.html.in
+++ b/docs/drvqemu.html.in
@@ -395,7 +395,7 @@ chmod o+x /path/to/directory
<pre>
/dev/null, /dev/full, /dev/zero,
/dev/random, /dev/urandom,
-/dev/ptmx, /dev/kvm, /dev/kqemu,
+/dev/ptmx, /dev/kvm,
/dev/rtc, /dev/hpet
</pre>
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 2ae5006849..7882c54bc1 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -22,7 +22,7 @@
<a id="attributeDomainType"><code>type</code></a>
specifies the hypervisor used for running
the domain. The allowed values are driver specific, but
- include "xen", "kvm", "qemu", "lxc" and "kqemu". The
+ include "xen", "kvm", "qemu" and "lxc". The
second attribute is <code>id</code> which is a unique
integer identifier for the running guest machine. Inactive
machines have no id value.
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index 7820e72dd8..334b4cd4ee 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -489,7 +489,7 @@
#cgroup_device_acl = [
# "/dev/null", "/dev/full", "/dev/zero",
# "/dev/random", "/dev/urandom",
-# "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
+# "/dev/ptmx", "/dev/kvm",
# "/dev/rtc","/dev/hpet"
#]
#
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index e88cb8c45f..c23f0af2aa 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -45,7 +45,7 @@ VIR_LOG_INIT("qemu.qemu_cgroup");
const char *const defaultDeviceACL[] = {
"/dev/null", "/dev/full", "/dev/zero",
"/dev/random", "/dev/urandom",
- "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
+ "/dev/ptmx", "/dev/kvm",
"/dev/rtc", "/dev/hpet",
NULL,
};
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 024ee5b62d..5118f4ad42 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1260,9 +1260,6 @@ qemuConnectGetMaxVcpus(virConnectPtr conn ATTRIBUTE_UNUSED, const char *type)
if (STRCASEEQ(type, "kvm"))
return virHostCPUGetKVMMaxVCPUs();
- if (STRCASEEQ(type, "kqemu"))
- return 1;
-
virReportError(VIR_ERR_INVALID_ARG,
_("unknown type '%s'"), type);
return -1;
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
index 51a7ad5892..fea1d308b7 100644
--- a/src/qemu/test_libvirtd_qemu.aug.in
+++ b/src/qemu/test_libvirtd_qemu.aug.in
@@ -60,9 +60,8 @@ module Test_libvirtd_qemu =
{ "5" = "/dev/urandom" }
{ "6" = "/dev/ptmx" }
{ "7" = "/dev/kvm" }
- { "8" = "/dev/kqemu" }
- { "9" = "/dev/rtc" }
- { "10" = "/dev/hpet" }
+ { "8" = "/dev/rtc" }
+ { "9" = "/dev/hpet" }
}
{ "save_image_format" = "raw" }
{ "dump_image_format" = "raw" }
diff --git a/src/security/apparmor/libvirt-qemu b/src/security/apparmor/libvirt-qemu
index eaa5167525..7d28faa163 100644
--- a/src/security/apparmor/libvirt-qemu
+++ b/src/security/apparmor/libvirt-qemu
@@ -23,7 +23,6 @@
/dev/net/tun rw,
/dev/kvm rw,
/dev/ptmx rw,
- /dev/kqemu rw,
@{PROC}/*/status r,
# When qemu is signaled to terminate, it will read cmdline of signaling
# process for reporting purposes. Allowing read access to a process
--
2.19.2
5 years, 9 months
[libvirt] [PATCH] util: Use virStorageSourceNew in virStorageFileMetadataNew
by Peter Krempa
Commit dcda2bf4c110 forgot to fix this one instance.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/util/virstoragefile.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 5927140a66..b2e308d81d 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -1119,22 +1119,20 @@ static virStorageSourcePtr
virStorageFileMetadataNew(const char *path,
int format)
{
- virStorageSourcePtr def = NULL;
+ VIR_AUTOUNREF(virStorageSourcePtr) def = NULL;
+ virStorageSourcePtr ret = NULL;
- if (VIR_ALLOC(def) < 0)
+ if (!(def = virStorageSourceNew()))
return NULL;
def->format = format;
def->type = VIR_STORAGE_TYPE_FILE;
if (VIR_STRDUP(def->path, path) < 0)
- goto error;
-
- return def;
+ return NULL;
- error:
- virObjectUnref(def);
- return NULL;
+ VIR_STEAL_PTR(ret, def);
+ return ret;
}
--
2.20.1
5 years, 9 months
[libvirt] [PATCH 0/5] util: Turn virStorageSource into a virObject (blockdev-add saga)
by Peter Krempa
In todays side story we witness the transmutation of virStorageSource
into a virObject.
Peter Krempa (5):
util: Introduce function for allocating virStorageSource
util: storage: Turn virStorageSource into a virObject
util: alloc: Introduce VIR_AUTOUNREF macro
util: Remove the AUTOPTR func for virStorageSource
util: Replace virStorageSourceFree with virObjectUnref
src/conf/domain_conf.c | 20 +++----
src/conf/snapshot_conf.c | 6 +--
src/conf/storage_conf.c | 2 +-
src/libvirt_private.syms | 3 +-
src/qemu/qemu_blockjob.c | 10 ++--
src/qemu/qemu_domain.c | 8 +--
src/qemu/qemu_driver.c | 14 ++---
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_migration.c | 8 +--
src/storage/storage_backend_gluster.c | 4 +-
src/storage/storage_backend_logical.c | 2 +-
src/storage/storage_util.c | 10 ++--
src/util/viralloc.h | 10 ++++
src/util/virobject.c | 13 +++++
src/util/virobject.h | 3 ++
src/util/virstoragefile.c | 75 ++++++++++++++++++---------
src/util/virstoragefile.h | 5 +-
tests/qemublocktest.c | 6 +--
tests/virstoragetest.c | 14 ++---
19 files changed, 134 insertions(+), 81 deletions(-)
--
2.20.1
5 years, 9 months
[libvirt] [PATCH] bhyve: use virDomainDiskDefNew to instead of VIR_ALLOC
by Peter Krempa
Use the proper function to allocate a disk definition.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/bhyve/bhyve_parse_command.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/bhyve/bhyve_parse_command.c b/src/bhyve/bhyve_parse_command.c
index 1c9191fb96..bd93070dfb 100644
--- a/src/bhyve/bhyve_parse_command.c
+++ b/src/bhyve/bhyve_parse_command.c
@@ -430,10 +430,8 @@ bhyveParsePCIDisk(virDomainDefPtr def,
int idx = -1;
virDomainDiskDefPtr disk = NULL;
- if (VIR_ALLOC(disk) < 0)
+ if (!(disk = virDomainDiskDefNew(NULL)))
goto cleanup;
- if (VIR_ALLOC(disk->src) < 0)
- goto error;
disk->bus = bus;
disk->device = device;
--
2.20.1
5 years, 9 months
[libvirt] [PATCH 0/7] conf: Rework virDomainDeviceDefPostParseCommon()
by Andrea Bolognani
Split actual functionality into a series of small helpers and
turn it into a dispatcher.
Andrea Bolognani (7):
conf: Introduce virDomainChrDefPostParse()
conf: Introduce virDomainRNGDefPostParse()
conf: Introduce virDomainDiskDefPostParse()
conf: Introduce virDomainVideoDefPostParse()
conf: Introduce virDomainControllerDefPostParse()
conf: Introduce virDomainNetDefPostParse()
conf: Rework virDomainDeviceDefPostParseCommon()
src/conf/domain_conf.c | 285 +++++++++++++++++++++++++++--------------
1 file changed, 187 insertions(+), 98 deletions(-)
--
2.20.1
5 years, 9 months
[libvirt] [PATCH v4 00/17] Add authorization support to all network services
by Daniel P. Berrangé
v1: https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg04482.html
v2: https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg05727.html
v3: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg01639.html
This series builds on the core authorization framework:
v8: https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg04253.html
enabling its use with the VNC, chardev, NBD and migration network servers.
In combination with TLS x509 client certificates, this allows these
services to whitelist specific clients, which avoids the need to setup
restricted child certificate authorities.
In VNC it also allows whitelisting based on SASL user names.
Changed in v4:
- Update deprecation versions to 4.0
- Rebased to latest git
Changed in v3:
- Rebased to latest git master
Changed in v2:
- Document that authz objects are resolved at time of use, not
time of network service activation
- Improve docs for tls-authz parameters on services
- Fix 2.13 -> 3.0 version tags
- Remove redundant conditionals around g_strdup
- Fix arg syntax for qemu-nbd s/-/--/
- Remove QAPI (optional) annotation
- Fix some outdated usage example
Based-on: <20190215155709.15777-1-berrange(a)redhat.com>
Daniel P. Berrangé (17):
util: add helper APIs for dealing with inotify in portable manner
qom: don't require user creatable objects to be registered
hw/usb: don't set IN_ISDIR for inotify watch in MTP driver
hw/usb: fix const-ness for string params in MTP driver
hw/usb: switch MTP to use new inotify APIs
authz: add QAuthZ object as an authorization base class
authz: add QAuthZSimple object type for easy whitelist auth checks
authz: add QAuthZList object type for an access control list
authz: add QAuthZListFile object type for a file access control list
authz: add QAuthZPAM object type for authorizing using PAM
authz: delete existing ACL implementation
qemu-nbd: add support for authorization of TLS clients
nbd: allow authorization with nbd-server-start QMP command
migration: add support for a "tls-authz" migration parameter
chardev: add support for authorization for TLS clients
vnc: allow specifying a custom authorization object name
monitor: deprecate acl_show, acl_reset, acl_policy, acl_add,
acl_remove
MAINTAINERS | 15 +
Makefile | 10 +-
Makefile.objs | 10 +-
Makefile.target | 2 +
authz/Makefile.objs | 7 +
authz/base.c | 82 ++++
authz/list.c | 271 +++++++++++++
authz/listfile.c | 283 ++++++++++++++
authz/pamacct.c | 149 +++++++
authz/simple.c | 115 ++++++
authz/trace-events | 18 +
blockdev-nbd.c | 11 +-
chardev/char-socket.c | 12 +-
chardev/char.c | 3 +
configure | 54 ++-
crypto/tlssession.c | 35 +-
crypto/trace-events | 2 +-
hmp.c | 11 +-
hw/usb/dev-mtp.c | 281 ++++++--------
hw/usb/trace-events | 2 +-
include/authz/base.h | 112 ++++++
include/authz/list.h | 106 +++++
include/authz/listfile.h | 111 ++++++
include/authz/pamacct.h | 100 +++++
include/authz/simple.h | 84 ++++
include/block/nbd.h | 4 +-
include/qemu/acl.h | 66 ----
include/qemu/filemonitor.h | 128 ++++++
migration/migration.c | 8 +
migration/tls.c | 2 +-
monitor.c | 202 +++++++---
nbd/server.c | 10 +-
qapi/authz.json | 58 +++
qapi/block.json | 8 +-
qapi/char.json | 6 +
qapi/migration.json | 14 +-
qapi/qapi-schema.json | 1 +
qemu-deprecated.texi | 11 +
qemu-nbd.c | 14 +-
qemu-nbd.texi | 4 +
qemu-options.hx | 149 ++++++-
qom/object.c | 12 +-
qom/object_interfaces.c | 16 +-
tests/Makefile.include | 16 +-
tests/qemu-iotests/233 | 31 +-
tests/qemu-iotests/233.out | 11 +
tests/test-authz-list.c | 159 ++++++++
tests/test-authz-listfile.c | 195 ++++++++++
tests/test-authz-pam.c | 124 ++++++
tests/test-authz-simple.c | 50 +++
tests/test-crypto-tlssession.c | 15 +-
tests/test-io-channel-tls.c | 16 +-
tests/test-util-filemonitor.c | 685 +++++++++++++++++++++++++++++++++
ui/vnc-auth-sasl.c | 23 +-
ui/vnc-auth-sasl.h | 5 +-
ui/vnc-auth-vencrypt.c | 2 +-
ui/vnc-ws.c | 2 +-
ui/vnc.c | 85 +++-
ui/vnc.h | 4 +-
util/Makefile.objs | 4 +-
util/acl.c | 179 ---------
util/filemonitor-inotify.c | 338 ++++++++++++++++
util/filemonitor-stub.c | 59 +++
util/trace-events | 9 +
64 files changed, 4013 insertions(+), 598 deletions(-)
create mode 100644 authz/Makefile.objs
create mode 100644 authz/base.c
create mode 100644 authz/list.c
create mode 100644 authz/listfile.c
create mode 100644 authz/pamacct.c
create mode 100644 authz/simple.c
create mode 100644 authz/trace-events
create mode 100644 include/authz/base.h
create mode 100644 include/authz/list.h
create mode 100644 include/authz/listfile.h
create mode 100644 include/authz/pamacct.h
create mode 100644 include/authz/simple.h
delete mode 100644 include/qemu/acl.h
create mode 100644 include/qemu/filemonitor.h
create mode 100644 qapi/authz.json
create mode 100644 tests/test-authz-list.c
create mode 100644 tests/test-authz-listfile.c
create mode 100644 tests/test-authz-pam.c
create mode 100644 tests/test-authz-simple.c
create mode 100644 tests/test-util-filemonitor.c
delete mode 100644 util/acl.c
create mode 100644 util/filemonitor-inotify.c
create mode 100644 util/filemonitor-stub.c
--
2.20.1
5 years, 9 months
[libvirt] [PATCH] conf: make virPCIDeviceAddressFormat void
by Daniel P. Berrangé
Only one of the three callers of virPCIDeviceAddressFormat correctly
handles an error return status. Fortunately it can't fail so can be
made void.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/conf/device_conf.c | 3 +--
src/conf/device_conf.h | 6 +++---
src/conf/domain_conf.c | 6 ++----
src/conf/network_conf.c | 7 +++----
src/conf/storage_adapter_conf.c | 4 ++--
5 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c
index 32628c6448..cd994057c5 100644
--- a/src/conf/device_conf.c
+++ b/src/conf/device_conf.c
@@ -308,7 +308,7 @@ virPCIDeviceAddressParseXML(xmlNodePtr node,
return ret;
}
-int
+void
virPCIDeviceAddressFormat(virBufferPtr buf,
virPCIDeviceAddress addr,
bool includeTypeInAddr)
@@ -320,7 +320,6 @@ virPCIDeviceAddressFormat(virBufferPtr buf,
addr.bus,
addr.slot,
addr.function);
- return 0;
}
bool
diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h
index 56745707d9..7a3455f99f 100644
--- a/src/conf/device_conf.h
+++ b/src/conf/device_conf.h
@@ -202,9 +202,9 @@ bool virDeviceInfoPCIAddressExtensionIsPresent(const virDomainDeviceInfo *info);
int virPCIDeviceAddressParseXML(xmlNodePtr node,
virPCIDeviceAddressPtr addr);
-int virPCIDeviceAddressFormat(virBufferPtr buf,
- virPCIDeviceAddress addr,
- bool includeTypeInAddr);
+void virPCIDeviceAddressFormat(virBufferPtr buf,
+ virPCIDeviceAddress addr,
+ bool includeTypeInAddr);
bool virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddressPtr addr);
int virDomainDeviceCCWAddressParseXML(xmlNodePtr node,
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index cd69323f28..95510a5157 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -25136,10 +25136,8 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf,
}
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
- if (virPCIDeviceAddressFormat(buf, pcisrc->addr,
- includeTypeInAddr) != 0)
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("PCI address Formatting failed"));
+ virPCIDeviceAddressFormat(buf, pcisrc->addr,
+ includeTypeInAddr);
if ((flags & VIR_DOMAIN_DEF_FORMAT_PCI_ORIG_STATES) &&
(def->origstates.states.pci.unbind_from_stub ||
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index ac0069cbec..87bf158049 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -2485,10 +2485,9 @@ virNetworkDefFormatBuf(virBufferPtr buf,
virBufferAddLit(buf, "/>\n");
} else {
if (def->forward.ifs[i].type == VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_PCI) {
- if (virPCIDeviceAddressFormat(buf,
- def->forward.ifs[i].device.pci,
- true) < 0)
- goto error;
+ virPCIDeviceAddressFormat(buf,
+ def->forward.ifs[i].device.pci,
+ true);
}
}
}
diff --git a/src/conf/storage_adapter_conf.c b/src/conf/storage_adapter_conf.c
index 3118b1a310..18bcb5eb9e 100644
--- a/src/conf/storage_adapter_conf.c
+++ b/src/conf/storage_adapter_conf.c
@@ -326,8 +326,8 @@ virStorageAdapterFormatSCSIHost(virBufferPtr buf,
virBufferAsprintf(buf, "<parentaddr unique_id='%d'>\n",
scsi_host->unique_id);
virBufferAdjustIndent(buf, 2);
- ignore_value(virPCIDeviceAddressFormat(buf, scsi_host->parentaddr,
- false));
+ virPCIDeviceAddressFormat(buf, scsi_host->parentaddr,
+ false);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</parentaddr>\n");
virBufferAdjustIndent(buf, -2);
--
2.20.1
5 years, 9 months