[libvirt] [PATCH] driver: test: Fix the mingw build caused by wrong printf format specifier
by Erik Skultety
Caused by commit 326c3f54.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
Travis build: https://travis-ci.org/eskultety/libvirt/builds/536736446
Pushed under the build breaker rule.
src/test/test_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index b29fd12903..7fd06fcfa8 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -3268,7 +3268,7 @@ testDomainInterfaceAddresses(virDomainPtr dom,
iface->addrs[0].type = VIR_IP_ADDR_TYPE_IPV4;
iface->addrs[0].prefix = 24;
- if (virAsprintf(&iface->addrs[0].addr, "192.168.0.%ld", 1 + i) < 0)
+ if (virAsprintf(&iface->addrs[0].addr, "192.168.0.%zu", 1 + i) < 0)
goto cleanup;
iface->naddrs = 1;
--
2.20.1
5 years, 6 months
[libvirt] [PATCH] spec: Fix permissions of /var/run/libvirt/qemu
by Jiri Denemark
While libvirtd creates this directory with the default 0755 mode, the
spec file stores 0700 in the RPM database. Thus RPM verification always
complains about this directory. Let's fix the spec file to match
reality.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Notes:
Alternatively, we could change libvirt to create the directory with
0700 (instead of 0755), but all other drivers use 0755 (both in
reality and in the spec file) and 0700 wouldn't really enhance
security anyway.
libvirt.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 970d2742ac..dc69920d75 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1661,7 +1661,7 @@ exit 0
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
-%ghost %dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/qemu/
+%ghost %dir %{_localstatedir}/run/libvirt/qemu/
%dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/
%{_datadir}/augeas/lenses/libvirtd_qemu.aug
--
2.21.0
5 years, 6 months
[libvirt] Increasing TasksMax when creating machines via systemd
by Jim Fehlig
Hi All,
I recently received an internal bug report of VM "crashing" due to hitting
thread limits. Seems there was an assert in pthread_create within the VM when
hitting the limit enforced by pids controller on the host
Apr 28 07:45:46 lpcomp02007 kernel: cgroup: fork rejected by pids controller in
/machine.slice/machine-qemu\x2d90028\x2dinstance\x2d0000634b.scope
The user has TasksMax set to infinity in machine.slice, but apparently that is
not inherited by child scopes and appears to be hardcoded to 16384
https://github.com/systemd/systemd/blob/51aba17b88617515e037e8985d3a4ea87...
The TasksMax property can be set when creating the machine as is done in the
attached proof of concept patch. Question is whether this should be a tunable?
My initial thought when seeing the report was TasksMax could be calculated based
on number of vcpus, iothreads, emulator threads, etc. But it appears that could
be quite tricky. The following mail thread describes the basic scenario
encountered by my user
http://lists.ceph.com/pipermail/ceph-users-ceph.com/2016-March/008174.html
As you can see, many rbd images attached to a VM can result in an awful lot of
threads. 300 images could result in 720K threads! We could punt and set the
limit to infinity, but it exists for a reason - fork bomb prevention. A
potential compromise between a hardcoded value and per-VM tunable is a driver
tunable in qemu.conf. If a per-VM tunable is preferred, suggestions on where to
place it and what to call it would be much appreciated :-).
Regards,
Jim
5 years, 6 months
[libvirt] [PATCH v5 00/24] network: refactor to decouple virt drivers from network driver
by Daniel P. Berrangé
An update to
v1: https://www.redhat.com/archives/libvir-list/2018-December/msg00681.html
v2: https://www.redhat.com/archives/libvir-list/2019-February/msg01581.html
v3: https://www.redhat.com/archives/libvir-list/2019-March/msg01259.html
v4: https://www.redhat.com/archives/libvir-list/2019-April/msg01186.html
Currently the network driver registers a set of callbacks with the virt
driver in order to handle allocating/releasing network ports associated
with guest NICs.
This series introduces a virNetworkPortPtr object and associated XML
that describes a network port. The virt drivers now call public APIs
associated with this new object to create/delete ports for guest NICs.
Changed in v5:
- Separately track ports with type=network vs type=bridge to deal with
fallout after reverting patches which merged them
- Add RNG schema and XML format docs
- Change to use classID attr on <bandwidth> isntead of
of separate <class id="xx"/> element
- Drop obsolete driver deps from RPM spec
- Other misc bug fixes found during testing
Changed in v4:
- Merged the ACKd patches which didn't depend on other un-acked
parts
- Improve bandwidth error messages
- Ensure we set floor sum to zero when starting network
- Misc fixes for previous review comments
NB, I have not added missing docs for the new XML doc format
yet. This is work in progress.
Changed in v3:
- Remove unused API symbol
- Fix dist of test data files
Changed in v2:
- Fix many bugs related to upgrades with running VMs
- Convert over bandwidth controls to the new APIs
- Handle reconnecting VIFs to bridges during startup
- Much much more that I can't remember
Daniel P. Berrangé (24):
conf: allow bandwidth parsing / formatting to include class ID
conf: introduce virNetworkPortDefPtr struct and XML support
network: make networkLogAllocation independent of domain conf
conf: add APIs to convert virDomainNetDef to virNetworkPortDef
network: convert networkAllocateActualDevice to virNetworkPortDef
network: convert networkNotifyActualDevice to virNetworkPortDef
network: convert networkReleaseActualDevice to virNetworkPortDef
network: convert hook script to take a network port XML
network: remove the virDomainNetBandwidthChangeAllowed callback
network: introduce networkAllocatePort
network: introduce networkNotifyPort
network: introduce networkReleasePort
network: introduce networkUpdatePortBandwidth
network: add public APIs for network port object
access: add permissions for network port objects
remote: add support for new network port APIs
virsh: add support for network port APIs
conf: support recording ports against virNetworkObjPtr
network: add implementation of network port APIs
lxc, libxl: notify network driver of NICs during reconnect
lxc, libxl: save domain status after reconnect
conf: record a portid against the domain conf
conf: switch over to use network port APIs for virt drivers
rpm: remove dependancy from qemu to network/storage drivers
docs/docs.html.in | 1 +
docs/formatdomain.html.in | 8 +
docs/formatnetworkport.html.in | 212 +++
docs/hooks.html.in | 24 +-
docs/schemas/domaincommon.rng | 5 +
docs/schemas/networkport.rng | 165 +++
include/libvirt/libvirt-network.h | 122 ++
include/libvirt/virterror.h | 3 +
libvirt.spec.in | 3 -
src/access/genpolkit.pl | 2 +-
src/access/viraccessdriver.h | 6 +
src/access/viraccessdrivernop.c | 11 +
src/access/viraccessdriverpolkit.c | 26 +
src/access/viraccessdriverstack.c | 25 +
src/access/viraccessmanager.c | 16 +
src/access/viraccessmanager.h | 6 +
src/access/viraccessperm.c | 6 +
src/access/viraccessperm.h | 44 +
src/conf/Makefile.inc.am | 2 +
src/conf/domain_conf.c | 531 +++++++-
src/conf/domain_conf.h | 49 +-
src/conf/netdev_bandwidth_conf.c | 30 +-
src/conf/netdev_bandwidth_conf.h | 2 +
src/conf/network_conf.c | 8 +-
src/conf/virnetworkobj.c | 303 +++++
src/conf/virnetworkobj.h | 34 +
src/conf/virnetworkportdef.c | 509 +++++++
src/conf/virnetworkportdef.h | 113 ++
src/datatypes.c | 60 +
src/datatypes.h | 41 +
src/driver-network.h | 41 +
src/libvirt-network.c | 444 +++++++
src/libvirt_private.syms | 23 +-
src/libvirt_public.syms | 15 +
src/libxl/libxl_driver.c | 33 +
src/lxc/lxc_process.c | 35 +
src/network/bridge_driver.c | 1182 ++++++++++-------
src/qemu/qemu_driver.c | 8 +-
src/remote/remote_daemon_dispatch.c | 73 +
src/remote/remote_driver.c | 69 +
src/remote/remote_protocol.x | 124 +-
src/remote_protocol-structs | 69 +
src/rpc/gendispatch.pl | 18 +-
src/util/virerror.c | 9 +
src/util/virhook.c | 4 +-
src/util/virhook.h | 4 +-
tests/Makefile.am | 7 +
.../net-virtio-network-portgroup.xml | 6 +-
tests/virnetdevbandwidthtest.c | 1 +
.../plug-bridge-mactbl.xml | 9 +
.../virnetworkportxml2xmldata/plug-bridge.xml | 15 +
.../virnetworkportxml2xmldata/plug-direct.xml | 12 +
.../plug-hostdev-pci.xml | 12 +
.../plug-network.xml | 16 +
tests/virnetworkportxml2xmldata/plug-none.xml | 8 +
tests/virnetworkportxml2xmltest.c | 104 ++
tests/virschematest.c | 1 +
tools/virsh-completer.c | 50 +
tools/virsh-completer.h | 4 +
tools/virsh-network.c | 399 +++++-
tools/virsh-network.h | 5 +
61 files changed, 4506 insertions(+), 661 deletions(-)
create mode 100644 docs/formatnetworkport.html.in
create mode 100644 docs/schemas/networkport.rng
create mode 100644 src/conf/virnetworkportdef.c
create mode 100644 src/conf/virnetworkportdef.h
create mode 100644 tests/virnetworkportxml2xmldata/plug-bridge-mactbl.xml
create mode 100644 tests/virnetworkportxml2xmldata/plug-bridge.xml
create mode 100644 tests/virnetworkportxml2xmldata/plug-direct.xml
create mode 100644 tests/virnetworkportxml2xmldata/plug-hostdev-pci.xml
create mode 100644 tests/virnetworkportxml2xmldata/plug-network.xml
create mode 100644 tests/virnetworkportxml2xmldata/plug-none.xml
create mode 100644 tests/virnetworkportxml2xmltest.c
--
2.21.0
5 years, 6 months
[libvirt] [PATCH] virDomainDefPostParse: use DOMAIN_DEVICE_ITERATE_MISSING_INFO
by Ján Tomko
Apart from virDomainDefValidate, virDomainDefPostParse is another
place where operating on info-less devices makes sense.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/conf/domain_conf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 926c2139b7..006920e954 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5803,7 +5803,8 @@ virDomainDefPostParse(virDomainDefPtr def,
/* iterate the devices */
ret = virDomainDeviceInfoIterateInternal(def,
virDomainDefPostParseDeviceIterator,
- DOMAIN_DEVICE_ITERATE_ALL_CONSOLES,
+ DOMAIN_DEVICE_ITERATE_ALL_CONSOLES |
+ DOMAIN_DEVICE_ITERATE_MISSING_INFO,
&data);
if (virDomainDefPostParseCheckFailure(def, parseFlags, ret) < 0)
--
2.19.2
5 years, 6 months
[libvirt] [PATCH 0/2] Introduce virDomainDeviceIterate
by Ján Tomko
A function for iterating over all devices [0] instead of just the ones
with DeviceInfo.
[0] Terms and conditions apply. Leases might be included as well.
Ján Tomko (2):
Introduce virDomainDeviceIterate
Introduce DOMAIN_DEVICE_ITERATE_MISSING_INFO
src/conf/domain_conf.c | 47 ++++++++++++++++++++++++++++++------------
src/conf/domain_conf.h | 3 +++
2 files changed, 37 insertions(+), 13 deletions(-)
--
2.19.2
5 years, 6 months
[libvirt] [PATCH] docs: Change the 'Launch Security' section id to "launchSecurity"
by Erik Skultety
Although there's currently only support for SEV, it's likely other
solutions will appear, so we should not refer to the documentation
section simply with 'sev'.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
docs/formatdomain.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index e1da878fcc..c843b1d667 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -8924,7 +8924,7 @@ qemu-kvm -net nic,model=? /dev/null
<p>Note: DEA/TDEA is synonymous with DES/TDES.</p>
- <h3><a id="sev">Launch Security</a></h3>
+ <h3><a id="launchSecurity">Launch Security</a></h3>
<p>
The contents of the <code><launchSecurity type='sev'></code> element
--
2.20.1
5 years, 6 months
[libvirt] [PATCH] misc: Drop useless checks from *Dispose() functions
by Michal Privoznik
Due to the way that our virObjectUnref() is written it's not
possible that a NULL is passed into *Dispose() function. However,
some functions check for that regardless.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_conf.c | 3 ---
src/conf/virstorageobj.c | 9 ---------
src/rpc/virnetsshsession.c | 3 ---
src/util/virhostdev.c | 3 ---
4 files changed, 18 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a3a514136b..732d37329f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2602,9 +2602,6 @@ virDomainChrSourceDefDispose(void *obj)
virDomainChrSourceDefPtr def = obj;
size_t i;
- if (!def)
- return;
-
virDomainChrSourceDefClear(def);
virObjectUnref(def->privateData);
diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
index cdd9863eb8..31b5af8e9e 100644
--- a/src/conf/virstorageobj.c
+++ b/src/conf/virstorageobj.c
@@ -156,9 +156,6 @@ virStorageVolObjDispose(void *opaque)
{
virStorageVolObjPtr obj = opaque;
- if (!obj)
- return;
-
virStorageVolDefFree(obj->voldef);
}
@@ -190,9 +187,6 @@ virStorageVolObjListDispose(void *opaque)
{
virStorageVolObjListPtr vols = opaque;
- if (!vols)
- return;
-
virHashFree(vols->objsKey);
virHashFree(vols->objsName);
virHashFree(vols->objsPath);
@@ -362,9 +356,6 @@ virStoragePoolObjDispose(void *opaque)
{
virStoragePoolObjPtr obj = opaque;
- if (!obj)
- return;
-
virStoragePoolObjClearVols(obj);
virObjectUnref(obj->volumes);
diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c
index 324b35b675..04b720014d 100644
--- a/src/rpc/virnetsshsession.c
+++ b/src/rpc/virnetsshsession.c
@@ -135,9 +135,6 @@ virNetSSHSessionDispose(void *obj)
virNetSSHSessionPtr sess = obj;
VIR_DEBUG("sess=0x%p", sess);
- if (!sess)
- return;
-
if (sess->channel) {
libssh2_channel_send_eof(sess->channel);
libssh2_channel_close(sess->channel);
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 19ae001971..fe176f35e4 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -131,9 +131,6 @@ virHostdevManagerDispose(void *obj)
{
virHostdevManagerPtr hostdevMgr = obj;
- if (!hostdevMgr)
- return;
-
virObjectUnref(hostdevMgr->activePCIHostdevs);
virObjectUnref(hostdevMgr->inactivePCIHostdevs);
virObjectUnref(hostdevMgr->activeUSBHostdevs);
--
2.21.0
5 years, 6 months
[libvirt] [PATCH 0/3] network: Delay creating private chains until starting network
by Daniel P. Berrangé
This is an series to delay creating libvirt firewall chains if nothing
needs them during startup.
Daniel P. Berrangé (3):
network: pull global chain init into separate method
network: add more debugging of firewall chain creation
network: delay global firewall setup if no networks are running
src/network/bridge_driver.c | 2 +-
src/network/bridge_driver_linux.c | 99 +++++++++++++++++++++----
src/network/bridge_driver_nop.c | 3 +-
src/network/bridge_driver_platform.h | 2 +-
tests/networkxml2firewalldata/base.args | 34 +++++++++
tests/networkxml2firewalltest.c | 36 +++++++--
6 files changed, 152 insertions(+), 24 deletions(-)
create mode 100644 tests/networkxml2firewalldata/base.args
--
2.21.0
5 years, 6 months