[libvirt] [PATCH] qemu: fix domxml-to-native failing when spice_tls is not enabled
by Jincheng Miao
The default graphics channel mode is 'any', so as to defaultMode attribute.
If defaultMode and channel mode are all the default value 'any',
qemuConnectDomainXMLToNative will set TLSPort.
But in qemuBuildGraphicsSPICECommandLine, if spice_tls is not enabled, libvirtd
will report an error to tell the user that spice TLS is disabled in qemu.conf.
So qemuConnectDomainXMLToNative should check spice_tls is enabled,
then decide to allocate an tlsPort number to this graphics.
If user specified defaultMode is 'secure', qemuConnectDomainXMLToNative
could allocate tlsPort, and then let qemuBuildGraphicsSPICECommandLine reports
the spice_tls disabled error.
The related bug is:
https://bugzilla.redhat.com/show_bug.cgi?id=1113868
Signed-off-by: Jincheng Miao <jmiao(a)redhat.com>
---
src/qemu/qemu_driver.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d34da6f..d1e3b2f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6013,7 +6013,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
break;
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
- needTLSPort = true;
+ if (cfg->spiceTLS)
+ needTLSPort = true;
needPort = true;
break;
}
--
1.7.1
10 years, 10 months
[libvirt] [PATCH 0/3] Few cleanups pointed out in reviews
by Peter Krempa
Peter Krempa (3):
conf: Verify metadata type right away
util: XML: Avoid forward function declaration
lib: Check conditions for VIR_DOMAIN_BLOCK_REBASE_RELATIVE right away
src/conf/domain_conf.c | 10 ++--------
src/libvirt.c | 17 +++++++++++++----
src/qemu/qemu_driver.c | 7 -------
src/util/virxml.c | 5 -----
4 files changed, 15 insertions(+), 24 deletions(-)
--
2.0.0
10 years, 10 months
[libvirt] [PATCH] virEventPollDispatchHandles: Honour array boundaries
by Michal Privoznik
When dispatching events from the event loop, the array of registered
handles is searched to see what handles happened an event on. However,
the array is searched in weird way: the check for the array boundaries
is at the end, so we may touch the elements after the end of the
array:
==10434== Invalid read of size 4
==10434== at 0x52D06B6: virEventPollDispatchHandles (vireventpoll.c:486)
==10434== by 0x52D10E4: virEventPollRunOnce (vireventpoll.c:660)
==10434== by 0x52CF207: virEventRunDefaultImpl (virevent.c:308)
==10434== by 0x1639D1: virNetServerRun (virnetserver.c:1139)
==10434== by 0x1220DC: main (libvirtd.c:1507)
==10434== Address 0xc11ff04 is 4 bytes after a block of size 960 alloc'd
==10434== at 0x4C2CA5E: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10434== by 0x52AD378: virReallocN (viralloc.c:245)
==10434== by 0x52AD46E: virExpandN (viralloc.c:294)
==10434== by 0x52AD5B1: virResizeN (viralloc.c:352)
==10434== by 0x52CF2EC: virEventPollAddHandle (vireventpoll.c:116)
==10434== by 0x52CEF5B: virEventAddHandle (virevent.c:78)
==10434== by 0x11F69A90: nodeStateInitialize (node_device_udev.c:1797)
==10434== by 0x53C3C89: virStateInitialize (libvirt.c:743)
==10434== by 0x120563: daemonRunStateInit (libvirtd.c:919)
==10434== by 0x5317719: virThreadHelper (virthread.c:197)
==10434== by 0x8376F39: start_thread (in /lib64/libpthread-2.17.so)
==10434== by 0x8A7F9FC: clone (in /lib64/libc-2.17.so)
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/util/vireventpoll.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/util/vireventpoll.c b/src/util/vireventpoll.c
index 528b24c..13f40dc 100644
--- a/src/util/vireventpoll.c
+++ b/src/util/vireventpoll.c
@@ -477,46 +477,46 @@ static int virEventPollDispatchTimeouts(void)
static int virEventPollDispatchHandles(int nfds, struct pollfd *fds)
{
size_t i, n;
VIR_DEBUG("Dispatch %d", nfds);
/* NB, use nfds not eventLoop.handlesCount, because new
* fds might be added on end of list, and they're not
* in the fds array we've got */
for (i = 0, n = 0; n < nfds && i < eventLoop.handlesCount; n++) {
- while ((eventLoop.handles[i].fd != fds[n].fd ||
- eventLoop.handles[i].events == 0) &&
- i < eventLoop.handlesCount) {
+ while (i < eventLoop.handlesCount &&
+ (eventLoop.handles[i].fd != fds[n].fd ||
+ eventLoop.handles[i].events == 0)) {
i++;
}
if (i == eventLoop.handlesCount)
break;
VIR_DEBUG("i=%zu w=%d", i, eventLoop.handles[i].watch);
if (eventLoop.handles[i].deleted) {
EVENT_DEBUG("Skip deleted n=%zu w=%d f=%d", i,
eventLoop.handles[i].watch, eventLoop.handles[i].fd);
continue;
}
if (fds[n].revents) {
virEventHandleCallback cb = eventLoop.handles[i].cb;
int watch = eventLoop.handles[i].watch;
void *opaque = eventLoop.handles[i].opaque;
int hEvents = virEventPollFromNativeEvents(fds[n].revents);
PROBE(EVENT_POLL_DISPATCH_HANDLE,
"watch=%d events=%d",
watch, hEvents);
virMutexUnlock(&eventLoop.lock);
(cb)(watch, fds[n].fd, hEvents, opaque);
virMutexLock(&eventLoop.lock);
}
}
return 0;
}
/* Used post dispatch to actually remove any timers that
* were previously marked as deleted. This asynchronous
* cleanup is needed to make dispatch re-entrant safe.
*/
--
1.8.5.5
10 years, 10 months
[libvirt] [PATCH] util: cgroup: Fix build on non-cgroup platforms
by Peter Krempa
Commit 48f44510098cead629ede9a49ea4e840a28ccca introduced a helper
fucntion to convert cgroup device mode to string. The function was only
conditionally compliled on platforms that support cgroup. This broke the
build when attempting to export the symbol:
CCLD libvirt.la
Cannot export virCgroupGetDevicePermsString: symbol not defined
Move the function out of the ifdef, as it doesn't really depend on the
cgroup code being present.
---
src/util/vircgroup.c | 76 ++++++++++++++++++++++++++--------------------------
1 file changed, 38 insertions(+), 38 deletions(-)
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 2eaf265..1ec12ac 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -83,6 +83,44 @@ typedef enum {
} virCgroupFlags;
+/**
+ * virCgroupGetDevicePermsString:
+ *
+ * @perms: Bitwise or of VIR_CGROUP_DEVICE permission bits
+ *
+ * Returns string corresponding to the appropriate bits set.
+ */
+const char *
+virCgroupGetDevicePermsString(int perms)
+{
+ if (perms & VIR_CGROUP_DEVICE_READ) {
+ if (perms & VIR_CGROUP_DEVICE_WRITE) {
+ if (perms & VIR_CGROUP_DEVICE_MKNOD)
+ return "rwm";
+ else
+ return "rw";
+ } else {
+ if (perms & VIR_CGROUP_DEVICE_MKNOD)
+ return "rm";
+ else
+ return "r";
+ }
+ } else {
+ if (perms & VIR_CGROUP_DEVICE_WRITE) {
+ if (perms & VIR_CGROUP_DEVICE_MKNOD)
+ return "wm";
+ else
+ return "w";
+ } else {
+ if (perms & VIR_CGROUP_DEVICE_MKNOD)
+ return "m";
+ else
+ return "";
+ }
+ }
+}
+
+
#ifdef VIR_CGROUP_SUPPORTED
bool
virCgroupAvailable(void)
@@ -2624,44 +2662,6 @@ virCgroupDenyAllDevices(virCgroupPtr group)
/**
- * virCgroupGetDevicePermsString:
- *
- * @perms: Bitwise or of VIR_CGROUP_DEVICE permission bits
- *
- * Returns string corresponding to the appropriate bits set.
- */
-const char *
-virCgroupGetDevicePermsString(int perms)
-{
- if (perms & VIR_CGROUP_DEVICE_READ) {
- if (perms & VIR_CGROUP_DEVICE_WRITE) {
- if (perms & VIR_CGROUP_DEVICE_MKNOD)
- return "rwm";
- else
- return "rw";
- } else {
- if (perms & VIR_CGROUP_DEVICE_MKNOD)
- return "rm";
- else
- return "r";
- }
- } else {
- if (perms & VIR_CGROUP_DEVICE_WRITE) {
- if (perms & VIR_CGROUP_DEVICE_MKNOD)
- return "wm";
- else
- return "w";
- } else {
- if (perms & VIR_CGROUP_DEVICE_MKNOD)
- return "m";
- else
- return "";
- }
- }
-}
-
-
-/**
* virCgroupAllowDevice:
*
* @group: The cgroup to allow a device for
--
2.0.0
10 years, 10 months
[libvirt] [PATCH 0/4] libxl: a few migration improvements
by Jim Fehlig
See individual patches for details.
Jim Fehlig (4):
libxl: rename goto label
libxl: remove domain when migration prepare fails
libxl: acquire job though begin phase only
libxl: fix crash in migrate confirm for transient domains
src/libxl/libxl_driver.c | 7 ++----
src/libxl/libxl_migration.c | 60 ++++++++++++++++++++++-----------------------
src/libxl/libxl_migration.h | 2 +-
3 files changed, 33 insertions(+), 36 deletions(-)
--
1.8.4.5
10 years, 10 months
[libvirt] [PATCH] LXC: fix an improper comments for lxcDomainDestroyFlags
by Chen Hanxiao
Currently @flag is not used yet.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
src/lxc/lxc_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 79c3b4a..5c4ab58 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1420,7 +1420,7 @@ lxcConnectDomainEventDeregisterAny(virConnectPtr conn,
/**
* lxcDomainDestroyFlags:
* @dom: pointer to domain to destroy
- * @flags: an OR'ed set of virDomainDestroyFlags
+ * @flags: extra flags; not used yet.
*
* Sends SIGKILL to container root process to terminate the container
*
--
1.9.0
10 years, 10 months
[libvirt] [PATCH libvirt] qemu: show a warning when using aio=native without cache=none
by Giuseppe Scrivano
Qemu will fallback to aio=threads when the cache mode doesn't use
O_DIRECT, even if aio=native was explictly set.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1086704
Signed-off-by: Giuseppe Scrivano <gscrivan(a)redhat.com>
---
src/qemu/qemu_command.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index fb64cda..92a6c9a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3477,6 +3477,13 @@ qemuBuildDriveStr(virConnectPtr conn,
mode = qemuDiskCacheV1TypeToString(disk->cachemode);
}
+ if (disk->iomode == VIR_DOMAIN_DISK_IO_NATIVE &&
+ disk->cachemode != VIR_DOMAIN_DISK_CACHE_DIRECTSYNC) {
+ VIR_WARN("native I/O needs either no disk cache "
+ "or directsync cache mode, QEMU will fallback "
+ "to aio=threads");
+ }
+
virBufferAsprintf(&opt, ",cache=%s", mode);
} else if (disk->shared && !disk->readonly) {
virBufferAddLit(&opt, ",cache=off");
--
1.9.3
10 years, 10 months
[libvirt] [PATCH] Allow updating names in DHCP hosts by matching IPs.
by Ján Tomko
Also fix the error message if an IPv6 host with no MAC
is not found.
https://bugzilla.redhat.com/show_bug.cgi?id=991290
---
src/conf/network_conf.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 909631b..ce4d4d8 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -3480,11 +3480,13 @@ virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def,
if (command == VIR_NETWORK_UPDATE_COMMAND_MODIFY) {
- /* search for the entry with this (mac|name),
+ /* search for the entry with this (ip|mac|name),
* and update the IP+(mac|name) */
for (i = 0; i < ipdef->nhosts; i++) {
if ((host.mac &&
!virMacAddrCompare(host.mac, ipdef->hosts[i].mac)) ||
+ (VIR_SOCKET_ADDR_VALID(&host.ip) &&
+ virSocketAddrEqual(&host.ip, &ipdef->hosts[i].ip)) ||
(host.name &&
STREQ_NULLABLE(host.name, ipdef->hosts[i].name))) {
break;
@@ -3492,10 +3494,14 @@ virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def,
}
if (i == ipdef->nhosts) {
+ char *ip = virSocketAddrFormat(&host.ip);
virReportError(VIR_ERR_OPERATION_INVALID,
_("couldn't locate an existing dhcp host entry with "
- "\"mac='%s'\" in network '%s'"),
- host.mac, def->name);
+ "\"mac='%s'\" \"name='%s'\" \"ip='%s'\" in"
+ " network '%s'"),
+ host.mac ? host.mac : _("unknown"), host.name,
+ ip ? ip : _("unknown"), def->name);
+ VIR_FREE(ip);
goto cleanup;
}
@@ -3524,8 +3530,8 @@ virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def,
_("there is an existing dhcp host entry in "
"network '%s' that matches "
"\"<host mac='%s' name='%s' ip='%s'/>\""),
- def->name, host.mac, host.name,
- ip ? ip : "unknown");
+ def->name, host.mac ? host.mac : _("unknown"),
+ host.name, ip ? ip : _("unknown"));
VIR_FREE(ip);
goto cleanup;
}
--
1.8.5.5
10 years, 10 months
[libvirt] [PATCH] maint: update to latest gnulib
by Eric Blake
When run under an environment that inherits an ignored SIGPIPE
(hello, annoying buildbots), a syntax-check was producing quite
a bit of noise, such as:
> prohibit_argmatch_without_use
> grep: write error
> grep: write error
> /bin/sed: couldn't write 25 items to stdout: Broken pipe
> sed: couldn't write 1 item to stdout: Broken pipe
> 0.46 prohibit_argmatch_without_use
This has been fixed upstream in gnulib. There are several other
portability improvements in our regular submodule update.
* .gnulib: Update to latest, in part for quieter syntax-check.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the gnulib maintenance rule.
* .gnulib d55899f...9d5efe7 (19):
> maint.mk: less syntax-check noise when SIGPIPE is ignored
> nl_langinfo: CODESET on MS-Windows and more items from localeconv
> Bruno Haible has stepped down as maintainer.
> mktime: merge #if/#ifdef usage from glibc
> git-version-gen: improve option descriptions
> regex: fix memory leak in compiler
> regex: merge patch from libc
> acl: port to gcc -Wredundant-decls
> parse-duration: eliminate 68-year duration limit
> pthread: don't assume AC_CANONICAL_HOST, port better to Solaris, etc.
> pthread: define thread-safe macros on some platforms
> regex: don't be multithreaded if USE_UNLOCKED_IO.
> gettext: update macros to version 0.19
> select,poll: fix console handle check on windows 8
> select: fix waiting on anonymous pipes on MS-Windows
> times: fix to return non constant value on MS-Windows
> isatty: fix to work on windows 8
> maint: fix typo in fdl.texi
> mountlist: avoid hasmntopt const type warning on solaris
.gnulib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gnulib b/.gnulib
index d55899f..9d5efe7 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit d55899fd2c5794ac85ecb14d5e2f646a89e4b4dd
+Subproject commit 9d5efe7d61e1d96a6d7c97ffa4d21c5e33e9bd30
--
1.9.3
10 years, 10 months
[libvirt] [PATCH] Document the need to free vir*Ptr objects per-function
by Ján Tomko
Another patch for
https://bugzilla.redhat.com/show_bug.cgi?id=994731
---
src/libvirt.c | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 134 insertions(+), 5 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 316fdf0..8684298 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1299,6 +1299,9 @@ do_open(const char *name,
*
* URIs are documented at http://libvirt.org/uri.html
*
+ * virConnectClose should be used to release the resources after the connection
+ * is no longer needed.
+ *
* Returns a pointer to the hypervisor connection or NULL in case of error
*/
virConnectPtr
@@ -1331,7 +1334,7 @@ virConnectOpen(const char *name)
* on the available methods to control the domains.
*
* See virConnectOpen for notes about environment variables which can
- * have an effect on opening drivers
+ * have an effect on opening drivers and freeing the connection resources
*
* URIs are documented at http://libvirt.org/uri.html
*
@@ -1369,7 +1372,7 @@ virConnectOpenReadOnly(const char *name)
* credentials via the callback
*
* See virConnectOpen for notes about environment variables which can
- * have an effect on opening drivers
+ * have an effect on opening drivers and freeing the connection resources
*
* URIs are documented at http://libvirt.org/uri.html
*
@@ -1875,6 +1878,9 @@ virDomainGetConnect(virDomainPtr dom)
* libvirtd daemon. Any domains marked for auto destroy will
* block attempts at migration, save-to-file, or snapshots.
*
+ * virDomainFree should be used to free the resources after the
+ * domain object is no longer needed.
+ *
* Returns a new domain object or NULL in case of failure
*/
virDomainPtr
@@ -1937,6 +1943,9 @@ virDomainCreateXML(virConnectPtr conn, const char *xmlDesc,
* libvirtd daemon. Any domains marked for auto destroy will
* block attempts at migration, save-to-file, or snapshots.
*
+ * virDomainFree should be used to free the resources after the
+ * domain object is no longer needed.
+ *
* Returns a new domain object or NULL in case of failure
*/
virDomainPtr
@@ -2000,6 +2009,9 @@ virDomainCreateLinux(virConnectPtr conn, const char *xmlDesc,
* Note that this won't work for inactive domains which have an ID of -1,
* in that case a lookup based on the Name or UUId need to be done instead.
*
+ * virDomainFree should be used to free the resources after the
+ * domain object is no longer needed.
+ *
* Returns a new domain object or NULL in case of failure. If the
* domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.
*/
@@ -2036,6 +2048,9 @@ virDomainLookupByID(virConnectPtr conn, int id)
*
* Try to lookup a domain on the given hypervisor based on its UUID.
*
+ * virDomainFree should be used to free the resources after the
+ * domain object is no longer needed.
+ *
* Returns a new domain object or NULL in case of failure. If the
* domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.
*/
@@ -2072,6 +2087,9 @@ virDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
*
* Try to lookup a domain on the given hypervisor based on its UUID.
*
+ * virDomainFree should be used to free the resources after the
+ * domain object is no longer needed.
+ *
* Returns a new domain object or NULL in case of failure. If the
* domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.
*/
@@ -2108,6 +2126,9 @@ virDomainLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
*
* Try to lookup a domain on the given hypervisor based on its name.
*
+ * virDomainFree should be used to free the resources after the
+ * domain object is no longer needed.
+ *
* Returns a new domain object or NULL in case of failure. If the
* domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.
*/
@@ -5284,6 +5305,9 @@ virDomainMigrateDirect(virDomainPtr domain,
* different processors even with the same architecture, or between
* different types of hypervisor.
*
+ * virDomainFree should be used to free the resources after the
+ * returned domain object is no longer needed.
+ *
* Returns the new domain object if the migration was successful,
* or NULL in case of error. Note that the new domain object
* exists in the scope of the destination connection (dconn).
@@ -5509,6 +5533,9 @@ virDomainMigrate(virDomainPtr domain,
* @dname for that purpose). Domain name in @dxml must match the
* original domain name.
*
+ * virDomainFree should be used to free the resources after the
+ * returned domain object is no longer needed.
+ *
* Returns the new domain object if the migration was successful,
* or NULL in case of error. Note that the new domain object
* exists in the scope of the destination connection (dconn).
@@ -5680,6 +5707,9 @@ virDomainMigrate2(virDomainPtr domain,
* different processors even with the same architecture, or between
* different types of hypervisor.
*
+ * virDomainFree should be used to free the resources after the
+ * returned domain object is no longer needed.
+ *
* Returns the new domain object if the migration was successful,
* or NULL in case of error. Note that the new domain object
* exists in the scope of the destination connection (dconn).
@@ -7916,7 +7946,7 @@ virDomainBlockStats(virDomainPtr dom, const char *disk,
* @dom: pointer to domain object
* @disk: path to the block device, or device shorthand
* @params: pointer to block stats parameter object
- * (return value)
+ * (return value, allocated by the caller)
* @nparams: pointer to number of block stats; input and output
* @flags: bitwise-OR of virTypedParameterFlags
*
@@ -8631,6 +8661,9 @@ virDomainGetBlockInfo(virDomainPtr domain, const char *disk,
* domain being defined; in that case, use virDomainBlockJobAbort() to
* stop the block copy first.
*
+ * virDomainFree should be used to free the resources after the
+ * domain object is no longer needed.
+ *
* Returns NULL in case of error, a pointer to the domain otherwise
*/
virDomainPtr
@@ -10899,6 +10932,9 @@ virConnectListDefinedNetworks(virConnectPtr conn, char **const names,
*
* Try to lookup a network on the given hypervisor based on its name.
*
+ * virNetworkFree should be used to free the resources after the
+ * network object is no longer needed.
+ *
* Returns a new network object or NULL in case of failure. If the
* network cannot be found, then VIR_ERR_NO_NETWORK error is raised.
*/
@@ -10935,6 +10971,9 @@ virNetworkLookupByName(virConnectPtr conn, const char *name)
*
* Try to lookup a network on the given hypervisor based on its UUID.
*
+ * virNetworkFree should be used to free the resources after the
+ * network object is no longer needed.
+ *
* Returns a new network object or NULL in case of failure. If the
* network cannot be found, then VIR_ERR_NO_NETWORK error is raised.
*/
@@ -11008,6 +11047,9 @@ virNetworkLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
* Create and start a new virtual network, based on an XML description
* similar to the one returned by virNetworkGetXMLDesc()
*
+ * virNetworkFree should be used to free the resources after the
+ * network object is no longer needed.
+ *
* Returns a new network object or NULL in case of failure
*/
virNetworkPtr
@@ -11044,6 +11086,9 @@ virNetworkCreateXML(virConnectPtr conn, const char *xmlDesc)
*
* Define a network, but does not create it
*
+ * virNetworkFree should be used to free the resources after the
+ * network object is no longer needed.
+ *
* Returns NULL in case of error, a pointer to the network otherwise
*/
virNetworkPtr
@@ -11788,6 +11833,9 @@ virConnectListDefinedInterfaces(virConnectPtr conn,
*
* Try to lookup an interface on the given hypervisor based on its name.
*
+ * virInterfaceFree should be used to free the resources after the
+ * interface object is no longer needed.
+ *
* Returns a new interface object or NULL in case of failure. If the
* interface cannot be found, then VIR_ERR_NO_INTERFACE error is raised.
*/
@@ -11824,6 +11872,9 @@ virInterfaceLookupByName(virConnectPtr conn, const char *name)
*
* Try to lookup an interface on the given hypervisor based on its MAC.
*
+ * virInterfaceFree should be used to free the resources after the
+ * interface object is no longer needed.
+ *
* Returns a new interface object or NULL in case of failure. If the
* interface cannot be found, then VIR_ERR_NO_INTERFACE error is raised.
*/
@@ -11962,6 +12013,9 @@ virInterfaceGetXMLDesc(virInterfacePtr iface, unsigned int flags)
* automatically removed during the next reboot of the system running
* libvirtd.
*
+ * virInterfaceFree should be used to free the resources after the
+ * interface object is no longer needed.
+ *
* Returns NULL in case of error, a pointer to the interface otherwise
*/
virInterfacePtr
@@ -12634,6 +12688,9 @@ virConnectFindStoragePoolSources(virConnectPtr conn,
*
* Fetch a storage pool based on its unique name
*
+ * virStoragePoolFree should be used to free the resources after the
+ * storage pool object is no longer needed.
+ *
* Returns a virStoragePoolPtr object, or NULL if no matching pool is found
*/
virStoragePoolPtr
@@ -12670,6 +12727,9 @@ virStoragePoolLookupByName(virConnectPtr conn,
*
* Fetch a storage pool based on its globally unique id
*
+ * virStoragePoolFree should be used to free the resources after the
+ * storage pool object is no longer needed.
+ *
* Returns a virStoragePoolPtr object, or NULL if no matching pool is found
*/
virStoragePoolPtr
@@ -12706,6 +12766,9 @@ virStoragePoolLookupByUUID(virConnectPtr conn,
*
* Fetch a storage pool based on its globally unique id
*
+ * virStoragePoolFree should be used to free the resources after the
+ * storage pool object is no longer needed.
+ *
* Returns a virStoragePoolPtr object, or NULL if no matching pool is found
*/
virStoragePoolPtr
@@ -12741,6 +12804,9 @@ virStoragePoolLookupByUUIDString(virConnectPtr conn,
*
* Fetch a storage pool which contains a particular volume
*
+ * virStoragePoolFree should be used to free the resources after the
+ * storage pool object is no longer needed.
+ *
* Returns a virStoragePoolPtr object, or NULL if no matching pool is found
*/
virStoragePoolPtr
@@ -12778,6 +12844,9 @@ virStoragePoolLookupByVolume(virStorageVolPtr vol)
* pool is not persistent, so its definition will disappear
* when it is destroyed, or if the host is restarted
*
+ * virStoragePoolFree should be used to free the resources after the
+ * storage pool object is no longer needed.
+ *
* Returns a virStoragePoolPtr object, or NULL if creation failed
*/
virStoragePoolPtr
@@ -12818,6 +12887,9 @@ virStoragePoolCreateXML(virConnectPtr conn,
* Define a new inactive storage pool based on its XML description. The
* pool is persistent, until explicitly undefined.
*
+ * virStoragePoolFree should be used to free the resources after the
+ * storage pool object is no longer needed.
+ *
* Returns a virStoragePoolPtr object, or NULL if creation failed
*/
virStoragePoolPtr
@@ -13277,7 +13349,7 @@ virStoragePoolGetInfo(virStoragePoolPtr pool,
* storage pool. This is suitable for later feeding back
* into the virStoragePoolCreateXML method.
*
- * Returns a XML document, or NULL on error
+ * Returns a XML document (caller frees), or NULL on error
*/
char *
virStoragePoolGetXMLDesc(virStoragePoolPtr pool,
@@ -13542,6 +13614,9 @@ virStorageVolGetConnect(virStorageVolPtr vol)
* Fetch a pointer to a storage volume based on its name
* within a pool
*
+ * virStorageVolFree should be used to free the resources after the
+ * storage volume object is no longer needed.
+ *
* Returns a storage volume, or NULL if not found / error
*/
virStorageVolPtr
@@ -13579,6 +13654,9 @@ virStorageVolLookupByName(virStoragePoolPtr pool,
* Fetch a pointer to a storage volume based on its
* globally unique key
*
+ * virStorageVolFree should be used to free the resources after the
+ * storage volume object is no longer needed.
+ *
* Returns a storage volume, or NULL if not found / error
*/
virStorageVolPtr
@@ -13616,6 +13694,9 @@ virStorageVolLookupByKey(virConnectPtr conn,
* Fetch a pointer to a storage volume based on its
* locally (host) unique path
*
+ * virStorageVolFree should be used to free the resources after the
+ * storage volume object is no longer needed.
+ *
* Returns a storage volume, or NULL if not found / error
*/
virStorageVolPtr
@@ -13705,6 +13786,9 @@ virStorageVolGetKey(virStorageVolPtr vol)
* qcow2 image files which don't support full preallocation,
* by creating a sparse image file with metadata.
*
+ * virStorageVolFree should be used to free the resources after the
+ * storage volume object is no longer needed.
+ *
* Returns the storage volume, or NULL on error
*/
virStorageVolPtr
@@ -13753,6 +13837,9 @@ virStorageVolCreateXML(virStoragePoolPtr pool,
* qcow2 image files which don't support full preallocation,
* by creating a sparse image file with metadata.
*
+ * virStorageVolFree should be used to free the resources after the
+ * storage volume object is no longer needed.
+ *
* Returns the storage volume, or NULL on error
*/
virStorageVolPtr
@@ -14454,6 +14541,9 @@ virNodeListDevices(virConnectPtr conn,
*
* Lookup a node device by its name.
*
+ * virNodeDeviceFree should be used to free the resources after the
+ * node device object is no longer needed.
+ *
* Returns a virNodeDevicePtr if found, NULL otherwise.
*/
virNodeDevicePtr
@@ -14491,6 +14581,9 @@ virNodeDeviceLookupByName(virConnectPtr conn, const char *name)
*
* Lookup SCSI Host which is capable with 'fc_host' by its WWNN and WWPN.
*
+ * virNodeDeviceFree should be used to free the resources after the
+ * node device object is no longer needed.
+ *
* Returns a virNodeDevicePtr if found, NULL otherwise.
*/
virNodeDevicePtr
@@ -14941,6 +15034,9 @@ virNodeDeviceReset(virNodeDevicePtr dev)
* Create a new device on the VM host machine, for example, virtual
* HBAs created using vport_create.
*
+ * virNodeDeviceFree should be used to free the resources after the
+ * node device object is no longer needed.
+ *
* Returns a node device object if successful, NULL in case of failure
*/
virNodeDevicePtr
@@ -15280,6 +15376,9 @@ virConnectListSecrets(virConnectPtr conn, char **uuids, int maxuuids)
* Try to lookup a secret on the given hypervisor based on its UUID.
* Uses the 16 bytes of raw data to describe the UUID
*
+ * virSecretFree should be used to free the resources after the
+ * secret object is no longer needed.
+ *
* Returns a new secret object or NULL in case of failure. If the
* secret cannot be found, then VIR_ERR_NO_SECRET error is raised.
*/
@@ -15318,6 +15417,9 @@ virSecretLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
* Try to lookup a secret on the given hypervisor based on its UUID.
* Uses the printable string value to describe the UUID
*
+ * virSecretFree should be used to free the resources after the
+ * secret object is no longer needed.
+ *
* Returns a new secret object or NULL in case of failure. If the
* secret cannot be found, then VIR_ERR_NO_SECRET error is raised.
*/
@@ -15357,6 +15459,9 @@ virSecretLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
* The usageID is unique within the set of secrets sharing the
* same usageType value.
*
+ * virSecretFree should be used to free the resources after the
+ * secret object is no longer needed.
+ *
* Returns a new secret object or NULL in case of failure. If the
* secret cannot be found, then VIR_ERR_NO_SECRET error is raised.
*/
@@ -15402,6 +15507,9 @@ virSecretLookupByUsage(virConnectPtr conn,
* Otherwise, creates a new secret with an automatically chosen UUID, and
* initializes its attributes from xml.
*
+ * virSecretFree should be used to free the resources after the
+ * secret object is no longer needed.
+ *
* Returns a secret on success, NULL on failure.
*/
virSecretPtr
@@ -16793,6 +16901,9 @@ virConnectListNWFilters(virConnectPtr conn, char **const names, int maxnames)
*
* Try to lookup a network filter on the given hypervisor based on its name.
*
+ * virNWFilterFree should be used to free the resources after the
+ * nwfilter object is no longer needed.
+ *
* Returns a new nwfilter object or NULL in case of failure. If the
* network filter cannot be found, then VIR_ERR_NO_NWFILTER error is raised.
*/
@@ -16829,6 +16940,9 @@ virNWFilterLookupByName(virConnectPtr conn, const char *name)
*
* Try to lookup a network filter on the given hypervisor based on its UUID.
*
+ * virNWFilterFree should be used to free the resources after the
+ * nwfilter object is no longer needed.
+ *
* Returns a new nwfilter object or NULL in case of failure. If the
* nwfdilter cannot be found, then VIR_ERR_NO_NWFILTER error is raised.
*/
@@ -16865,6 +16979,9 @@ virNWFilterLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
*
* Try to lookup an nwfilter on the given hypervisor based on its UUID.
*
+ * virNWFilterFree should be used to free the resources after the
+ * nwfilter object is no longer needed.
+ *
* Returns a new nwfilter object or NULL in case of failure. If the
* nwfilter cannot be found, then VIR_ERR_NO_NWFILTER error is raised.
*/
@@ -17005,6 +17122,9 @@ virNWFilterGetUUIDString(virNWFilterPtr nwfilter, char *buf)
* Define a new network filter, based on an XML description
* similar to the one returned by virNWFilterGetXMLDesc()
*
+ * virNWFilterFree should be used to free the resources after the
+ * nwfilter object is no longer needed.
+ *
* Returns a new nwfilter object or NULL in case of failure
*/
virNWFilterPtr
@@ -17348,7 +17468,7 @@ virConnectGetCPUModelNames(virConnectPtr conn, const char *arch, char ***models,
* without this flag features that are part of the CPU model will not be
* listed.
*
- * Returns XML description of the computed CPU or NULL on error.
+ * Returns XML description of the computed CPU (caller frees) or NULL on error.
*/
char *
virConnectBaselineCPU(virConnectPtr conn,
@@ -18297,6 +18417,9 @@ virDomainSnapshotGetConnect(virDomainSnapshotPtr snapshot)
* block copy operation; in that case, use virDomainBlockJobAbort()
* to stop the block copy first.
*
+ * virDomainSnapshotFree should be used to free the resources after the
+ * snapshot object is no longer needed.
+ *
* Returns an (opaque) virDomainSnapshotPtr on success, NULL on failure.
*/
virDomainSnapshotPtr
@@ -18966,6 +19089,9 @@ virDomainHasCurrentSnapshot(virDomainPtr domain, unsigned int flags)
*
* Get the current snapshot for a domain, if any.
*
+ * virDomainSnapshotFree should be used to free the resources after the
+ * snapshot object is no longer needed.
+ *
* Returns a domain snapshot object or NULL in case of failure. If the
* current domain snapshot cannot be found, then the VIR_ERR_NO_DOMAIN_SNAPSHOT
* error is raised.
@@ -19005,6 +19131,9 @@ virDomainSnapshotCurrent(virDomainPtr domain,
*
* Get the parent snapshot for @snapshot, if any.
*
+ * virDomainSnapshotFree should be used to free the resources after the
+ * snapshot object is no longer needed.
+ *
* Returns a domain snapshot object or NULL in case of failure. If the
* given snapshot is a root (no parent), then the VIR_ERR_NO_DOMAIN_SNAPSHOT
* error is raised.
--
1.8.5.5
10 years, 10 months