[libvirt] [PATCH 0/2] Update documentation for latest vbox changes.
by Dawid Zamirski
* update docs/drvvbox.html.in to show support for <controller>
* update docs/fomatdomain.html.in to describe autoport behavior in the
vbox driver
Dawid Zamirski (2):
docs: Update vbox driver documentation.
docs: Document autoport behavior in the vbox driver
docs/drvvbox.html.in | 28 +++++++++++++++++++++++++++-
docs/formatdomain.html.in | 5 ++++-
2 files changed, 31 insertions(+), 2 deletions(-)
--
2.14.2
7 years, 1 month
[libvirt] [PATCH v3 00/13] vbox: Improve handling of storage devices
by Dawid Zamirski
v2:
https://www.redhat.com/archives/libvir-list/2017-October/msg01108.html
Changes since v2:
* Rebase on master
* Do not segfault in 'Cleanup partially-defined VM on failure' when
code jumps to cleanup and machine is NULL
* Take out SAS controller handling code into a separate patch
* Split up the snapshot function cleanup code into separate patches
* Fixed code formatting as pointed out in review
* Rename vboxDumpIDEHDDs -> vboxDumpDisks into a separate patch
* Add docs/news.xml patch to describe improvements/fixes in the series
Dawid Zamirski (13):
vbox: Cleanup partially-defined VM on failure
vbox: Process <controller> element in domain XML
vbox: Add vboxDumpStorageControllers
vbox: Rename vboxDumpIDEHDDs to vboxDumpDisks
vbox: Cleanup/prepare snasphot dumpxml functions
vbox: Do not free disk definitions on cleanup
vbox: Swap vboxSnapshotGetReadOnlyDisks arguments
vbox: Correctly generate drive name in dumpxml
vbox: Cleanup vboxDumpDisks implementation
vbox: Process empty removable disks in dumpxml
vbox: Generate disk address element in dumpxml
vbox: Add SAS controller support
docs: Update news.xml with vbox changes.
docs/news.xml | 74 ++++
src/vbox/vbox_common.c | 1105 +++++++++++++++++++++++++++++++-----------------
src/vbox/vbox_common.h | 8 +
3 files changed, 792 insertions(+), 395 deletions(-)
--
2.14.3
7 years, 1 month
[libvirt] [PATCH v2 00/15] vbox: Improve handling of storage devices
by Dawid Zamirski
From: Dawid Zamirski <dzrudy(a)gmail.com>
v1: https://www.redhat.com/archives/libvir-list/2017-October/msg00381.html
Changes since v1:
* split out the original patches into smaller ones, with each bugfix or
cleanup task is in its own isolated and compilable patch
* make sure switch statements are type casted and all cases are handled
* fixed implementation of partial VM cleanup code and isolated into
separate patch (patch #3)
* squashed doc and rng updates into a single patch (#9), updated doc
wording as suggested
* addressed other minor issues (add debug statements, code formatting,
better comments, commit message spelling etc)
Dawid Zamirski (15):
vbox: Update ATTRIBUTE_UNUSED usage
vbox: Close media when undefining domains
vbox: Cleanup partially-defined VM on failure
vbox: vboxAttachDrives now relies on address info
vbox: Cleanup vboxAttachDrives implementation
vbox: Errors in vboxAttachDrives are now critical
vbox: Support empty removable drives.
vbox: Add more IStorageController API mappings
domain: Allow 'model' attribute for ide controller
vbox: Process <controller> element in domain XML
vbox: Add vboxDumpStorageControllers
vbox: Correctly generate drive name in dumpxml
vbox: Cleanup vboxDumpDisks implementation
vbox: Process empty removable disks in dumpxml
vbox: Generate disk address element in dumpxml
docs/formatdomain.html.in | 4 +
docs/schemas/domaincommon.rng | 18 +-
src/conf/domain_conf.c | 9 +
src/conf/domain_conf.h | 9 +
src/libvirt_private.syms | 2 +
src/vbox/vbox_common.c | 1422 +++++++++++++++++++++++++----------------
src/vbox/vbox_common.h | 21 +
src/vbox/vbox_tmpl.c | 93 ++-
src/vbox/vbox_uniformed_api.h | 3 +
9 files changed, 983 insertions(+), 598 deletions(-)
--
2.14.2
7 years, 1 month
[libvirt] [PATCH 0/2] Misc apparmor fixes
by Christian Ehrhardt
Hi,
here a few more apparmor fixes for your review.
One is for an Ubuntu bug [1] which is non fatal, but denies a qemu fix to
fully work.
The other one I was carried in Ubuntu for some time and is related to ipv6
only setups where virt-aa-helper can fail if not permitted inet6.
[1]: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1729626
Christian Ehrhardt (2):
apparmor: allow qemu to read max_segments
apparmor, virt-aa-helper: allow ipv6
examples/apparmor/libvirt-qemu | 3 +++
examples/apparmor/usr.lib.libvirt.virt-aa-helper | 1 +
2 files changed, 4 insertions(+)
--
2.7.4
7 years, 1 month
[libvirt] [PATCH REPOST 0/8] Privatize _virStoragePoolObj and _virStorageVolDefList (Batch #3)
by John Ferlan
Since the original series (19 patches):
https://www.redhat.com/archives/libvir-list/2017-September/msg00594.html
didn't garner any attention, I'm going with smaller patch piles to make
forward progress.
This is the last half of the storage backends plus one missed merge
(because I broke things up <sigh>)
John Ferlan (8):
storage: Use virStoragePoolObjGetDef accessor for iSCSI backend
storage: Use virStoragePoolObjGetDef accessor for MPATH backend
storage: Use virStoragePoolObjGetDef accessor for RBD backend
storage: Use virStoragePoolObjGetDef accessor for SCSI backend
storage: Use virStoragePoolObjGetDef accessor for VSTORAGE backend
storage: Use virStoragePoolObjGetDef accessor for ZFS backend
storage: Use virStoragePoolObjGetDef accessor for new driver events
storage: Privatize virStoragePoolObj and virStorageVolDefList
src/conf/storage_conf.h | 4 ---
src/conf/virstorageobj.c | 20 +++++++++++
src/conf/virstorageobj.h | 15 --------
src/storage/storage_backend_iscsi.c | 41 ++++++++++++----------
src/storage/storage_backend_mpath.c | 8 +++--
src/storage/storage_backend_rbd.c | 64 ++++++++++++++++++----------------
src/storage/storage_backend_scsi.c | 30 +++++++++-------
src/storage/storage_backend_vstorage.c | 31 ++++++++--------
src/storage/storage_backend_zfs.c | 39 ++++++++++++---------
src/storage/storage_driver.c | 8 ++---
10 files changed, 144 insertions(+), 116 deletions(-)
--
2.13.6
7 years, 1 month
[libvirt] [PATCH v2] vz: allow to start vz driver without host cache info
by Mikhail Feoktistov
Show warning message instead of fail operation.
It happens if kernel or cpu doesn't support reporting cpu cache info.
In case of Virtuozzo file "id" doesn't exist.
---
src/vz/vz_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 6f4aee3..eb97e54 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -119,7 +119,7 @@ vzBuildCapabilities(void)
goto error;
if (virCapabilitiesInitCaches(caps) < 0)
- goto error;
+ VIR_WARN("Failed to get host CPU cache info");
verify(ARRAY_CARDINALITY(archs) == ARRAY_CARDINALITY(emulators));
--
1.8.3.1
7 years, 1 month
[libvirt] [RFC] docs: Discourage usage of cache mode=passthrough
by Eduardo Habkost
Cache mode=passthrough can result in a broken cache topology if
the domain topology is not exactly the same as the host topology.
Warn about that in the documentation.
Bug report for reference:
https://bugzilla.redhat.com/show_bug.cgi?id=1184125
Signed-off-by: Eduardo Habkost <ehabkost(a)redhat.com>
---
docs/formatdomain.html.in | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 57ec2ff34..9c21892f3 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1478,7 +1478,9 @@
<dt><code>passthrough</code></dt>
<dd>The real CPU cache data reported by the host CPU will be
- passed through to the virtual CPU.</dd>
+ passed through to the virtual CPU. Using this mode is not
+ recommended unless the domain CPU and NUMA topology is exactly
+ the same as the host CPU and NUMA topology.</dd>
<dt><code>disable</code></dt>
<dd>The virtual CPU will report no CPU cache of the specified
--
2.13.5
7 years, 1 month
[libvirt] [PATCH] conf: Don't inline virDomainNetTypeSharesHostView()
by Andrea Bolognani
Introduced in d86fd2402e9d. Fails to compile on aarch64 with
qemu/qemu_driver.c: In function 'qemuDomainSetInterfaceParameters':
./conf/domain_conf.h:3406:1: error: inlining failed in call to
'virDomainNetTypeSharesHostView': call is unlikely and code size
would grow [-Werror=inline]
virDomainNetTypeSharesHostView(const virDomainNetDef *net)
^
qemu/qemu_driver.c:11240:66: error: called from here [-Werror=inline]
!virDomainNetTypeSharesHostView(net)) < 0 ||
^
Solve the issue by turning it into a regular function.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/conf/domain_conf.c | 35 +++++++++++++++++++++++++++++++++++
src/conf/domain_conf.h | 36 ++----------------------------------
src/libvirt_private.syms | 1 +
3 files changed, 38 insertions(+), 34 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index f9ae05769..2b06250df 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -28091,3 +28091,38 @@ virDomainGenerateMachineName(const char *drivername,
virBufferCheckError(&buf);
return virBufferContentAndReset(&buf);
}
+
+/**
+ * virDomainNetTypeSharesHostView:
+ * @net: interface
+ *
+ * Some types of interfaces "share" the host view. For instance,
+ * for macvtap interface, every domain RX is the host RX too. And
+ * every domain TX is host TX too. IOW, for some types of
+ * interfaces guest and host are on the same side of RX/TX
+ * barrier. This is important so that we set up QoS correctly and
+ * report proper stats.
+ */
+bool
+virDomainNetTypeSharesHostView(const virDomainNetDef *net)
+{
+ virDomainNetType actualType = virDomainNetGetActualType(net);
+ switch (actualType) {
+ case VIR_DOMAIN_NET_TYPE_DIRECT:
+ case VIR_DOMAIN_NET_TYPE_ETHERNET:
+ return true;
+ case VIR_DOMAIN_NET_TYPE_USER:
+ case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
+ case VIR_DOMAIN_NET_TYPE_SERVER:
+ case VIR_DOMAIN_NET_TYPE_CLIENT:
+ case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_NETWORK:
+ case VIR_DOMAIN_NET_TYPE_BRIDGE:
+ case VIR_DOMAIN_NET_TYPE_INTERNAL:
+ case VIR_DOMAIN_NET_TYPE_HOSTDEV:
+ case VIR_DOMAIN_NET_TYPE_UDP:
+ case VIR_DOMAIN_NET_TYPE_LAST:
+ break;
+ }
+ return false;
+}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 0def905b2..7f21f9871 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3391,40 +3391,8 @@ virDomainGenerateMachineName(const char *drivername,
int id,
const char *name,
bool privileged);
-/**
- * virDomainNetTypeSharesHostView:
- * @net: interface
- *
- * Some types of interfaces "share" the host view. For instance,
- * for macvtap interface, every domain RX is the host RX too. And
- * every domain TX is host TX too. IOW, for some types of
- * interfaces guest and host are on the same side of RX/TX
- * barrier. This is important so that we set up QoS correctly and
- * report proper stats.
- */
-static inline bool
-virDomainNetTypeSharesHostView(const virDomainNetDef *net)
-{
- virDomainNetType actualType = virDomainNetGetActualType(net);
- switch (actualType) {
- case VIR_DOMAIN_NET_TYPE_DIRECT:
- case VIR_DOMAIN_NET_TYPE_ETHERNET:
- return true;
- case VIR_DOMAIN_NET_TYPE_USER:
- case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
- case VIR_DOMAIN_NET_TYPE_SERVER:
- case VIR_DOMAIN_NET_TYPE_CLIENT:
- case VIR_DOMAIN_NET_TYPE_MCAST:
- case VIR_DOMAIN_NET_TYPE_NETWORK:
- case VIR_DOMAIN_NET_TYPE_BRIDGE:
- case VIR_DOMAIN_NET_TYPE_INTERNAL:
- case VIR_DOMAIN_NET_TYPE_HOSTDEV:
- case VIR_DOMAIN_NET_TYPE_UDP:
- case VIR_DOMAIN_NET_TYPE_LAST:
- break;
- }
- return false;
-}
+
+bool virDomainNetTypeSharesHostView(const virDomainNetDef *net);
bool
virDomainDefLifecycleActionAllowed(virDomainLifecycle type,
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 2e67366b7..36cd5b55b 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -446,6 +446,7 @@ virDomainNetInsert;
virDomainNetRemove;
virDomainNetRemoveHostdev;
virDomainNetTypeFromString;
+virDomainNetTypeSharesHostView;
virDomainNetTypeToString;
virDomainNostateReasonTypeFromString;
virDomainNostateReasonTypeToString;
--
2.13.6
7 years, 1 month
[libvirt] [PATCH] remote: Fix libvirtd service memory leak when libvirt client was terminated unexpectly
by xinhua.Cao
base on commit 2033e8cc119454bc4273e8a41e66c899c60ba58b and fe8f1c8b8650c8ab5e7d27338f4538582651bd14, we solve libvirt coredump problem, but it introduce a memory leak sense.
the sense follow
1. one client register a domain event such as reboot event
2. and client was terminated unexpectly, then this client will not free at libvirtd service program.
remoteDispatchConnectDomainEventCallbackRegisterAny reference the client, but when client was terminated before it call deRegisterAny, the reference of client will not reduced to zero. so the memory leak take place. this patch will deRegister all event when client was close.
---
daemon/remote.c | 47 +++++++++++++++++++++++++++++------------------
1 file changed, 29 insertions(+), 18 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index 3f7d2d3..2b5a18b 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -1686,25 +1686,16 @@ void remoteRelayConnectionClosedEvent(virConnectPtr conn ATTRIBUTE_UNUSED, int r
VIR_WARN("unexpected %s event deregister failure", name); \
} \
VIR_FREE(eventCallbacks); \
+ neventCallbacks = 0; \
} while (0);
-/*
- * You must hold lock for at least the client
- * We don't free stuff here, merely disconnect the client's
- * network socket & resources.
- * We keep the libvirt connection open until any async
- * jobs have finished, then clean it up elsewhere
- */
-void remoteClientFreeFunc(void *data)
+static void
+remoteFreePrivCallbacks(void *data)
{
struct daemonClientPrivate *priv = data;
/* Deregister event delivery callback */
- if (priv->conn) {
- virIdentityPtr sysident = virIdentityGetSystem();
-
- virIdentitySetCurrent(sysident);
-
+ if (priv && priv->conn) {
DEREG_CB(priv->conn, priv->domainEventCallbacks,
priv->ndomainEventCallbacks,
virConnectDomainEventDeregisterAny, "domain");
@@ -1723,6 +1714,26 @@ void remoteClientFreeFunc(void *data)
DEREG_CB(priv->conn, priv->qemuEventCallbacks,
priv->nqemuEventCallbacks,
virConnectDomainQemuMonitorEventDeregister, "qemu monitor");
+ }
+}
+#undef DEREG_CB
+
+/*
+ * You must hold lock for at least the client
+ * We don't free stuff here, merely disconnect the client's
+ * network socket & resources.
+ * We keep the libvirt connection open until any async
+ * jobs have finished, then clean it up elsewhere
+ */
+void remoteClientFreeFunc(void *data)
+{
+ struct daemonClientPrivate *priv = data;
+
+ if (priv) {
+ virIdentityPtr sysident = virIdentityGetSystem();
+
+ virIdentitySetCurrent(sysident);
+ remoteFreePrivCallbacks(priv);
if (priv->closeRegistered) {
if (virConnectUnregisterCloseCallback(priv->conn,
@@ -1734,18 +1745,18 @@ void remoteClientFreeFunc(void *data)
virIdentitySetCurrent(NULL);
virObjectUnref(sysident);
+ VIR_FREE(priv);
}
-
- VIR_FREE(priv);
}
-#undef DEREG_CB
-
static void remoteClientCloseFunc(virNetServerClientPtr client)
{
struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client);
- daemonRemoveAllClientStreams(priv->streams);
+ if (priv) {
+ daemonRemoveAllClientStreams(priv->streams);
+ remoteFreePrivCallbacks(priv);
+ }
}
--
2.8.3
7 years, 1 month