[libvirt] [PATCH] virNetworkGetDHCPLeases: fix docstring format
by Ilias Stamatis
The docstring of virNetworkGetDHCPLeases is not correctly formatted and
as a result the example code snippet appears as normal text under the
"Returns:" section. This patch fixes the problem.
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
src/libvirt-network.c | 42 ++++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/src/libvirt-network.c b/src/libvirt-network.c
index 6ed32c8ba2..2d7a68eaa1 100644
--- a/src/libvirt-network.c
+++ b/src/libvirt-network.c
@@ -1156,8 +1156,7 @@ virConnectNetworkEventDeregisterAny(virConnectPtr conn,
* lease info about a specific guest interface with @mac. There can be
* multiple leases for a single @mac because this API supports DHCPv6 too.
*
- * Returns the number of leases found or -1 and sets @leases to NULL in
- * case of error. On success, the array stored into @leases is guaranteed to
+ * On success, the array stored into @leases is guaranteed to
* have an extra allocated element set to NULL but not included in the return
* count, to make iteration easier. The caller is responsible for calling
* virNetworkDHCPLeaseFree() on each array element, then calling free() on @leases.
@@ -1167,30 +1166,33 @@ virConnectNetworkEventDeregisterAny(virConnectPtr conn,
*
* Example of usage:
*
- * virNetworkDHCPLeasePtr *leases = NULL;
- * virNetworkPtr network = ... obtain a network pointer here ...;
- * size_t i;
- * int nleases;
- * unsigned int flags = 0;
+ * virNetworkDHCPLeasePtr *leases = NULL;
+ * virNetworkPtr network = ... obtain a network pointer here ...;
+ * size_t i;
+ * int nleases;
+ * unsigned int flags = 0;
+ *
+ * nleases = virNetworkGetDHCPLeases(network, NULL, &leases, flags);
+ * if (nleases < 0)
+ * error();
*
- * nleases = virNetworkGetDHCPLeases(network, NULL, &leases, flags);
- * if (nleases < 0)
- * error();
+ * ... do something with returned values, for example:
*
- * ... do something with returned values, for example:
+ * for (i = 0; i < nleases; i++) {
+ * virNetworkDHCPLeasePtr lease = leases[i];
*
- * for (i = 0; i < nleases; i++) {
- * virNetworkDHCPLeasePtr lease = leases[i];
+ * printf("Time(epoch): %lu, MAC address: %s, "
+ * "IP address: %s, Hostname: %s, ClientID: %s\n",
+ * lease->expirytime, lease->mac, lease->ipaddr,
+ * lease->hostname, lease->clientid);
*
- * printf("Time(epoch): %lu, MAC address: %s, "
- * "IP address: %s, Hostname: %s, ClientID: %s\n",
- * lease->expirytime, lease->mac, lease->ipaddr,
- * lease->hostname, lease->clientid);
+ * virNetworkDHCPLeaseFree(leases[i]);
+ * }
*
- * virNetworkDHCPLeaseFree(leases[i]);
- * }
+ * free(leases);
*
- * free(leases);
+ * Returns the number of leases found or -1 and sets @leases to NULL in
+ * case of error.
*
*/
int
--
2.22.0
5 years, 5 months
[libvirt] [PATCH 0/2] qemu: fix snapshot crasher bug and improve virsh (blockdev-add saga)
by Peter Krempa
While reviewers liked my story plot, the CPU did not. Fix it to make
everyone happy.
Peter Krempa (2):
qemu: driver: Fix off-by-one in qemuDomainSnapshotDiskDataCollect
virsh: snapshot: Don't block --no-metadata with --print-xml
src/qemu/qemu_driver.c | 2 +-
tools/virsh-snapshot.c | 8 +-------
tools/virsh.pod | 4 ++--
3 files changed, 4 insertions(+), 10 deletions(-)
--
2.21.0
5 years, 5 months
[libvirt] [PATCH RFC] test_driver: check that the domain is running in testDomainGetTime
by Ilias Stamatis
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
Currently in the test driver in APIs that would normally require guest
agents and similar we are just checking if the domain is active (using
virDomainObjCheckActive).
But a domain will be active even if stopped, so I would say that most of
the time this is not sufficient since we really want to now that the
domain is actually running, not that it's just active.
So something like what I include in this patch is needed instead.
I wonder if it would make sense to add a new function such as
testDomainAgentAvailable inspired by the QEMU driver.
So the check whether the domain is actually running or not could be done
there.
Also, in that case I'm not sure if calling both virDomainObjCheckActive
and testDomainAgentAvailable is needed. I feel like calling the second
one only is sufficient. However, in the QEMU driver always both are
called.
Should I go ahead with implementing the testDomainAgentAvailable
function and search for all the places in the test driver that it should
be used instead of virDomainObjCheckActive?
src/test/test_driver.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 2a0ffbc6c5..8e5bd4e670 100755
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1984,17 +1984,33 @@ testDomainGetState(virDomainPtr domain,
}
static int
-testDomainGetTime(virDomainPtr dom ATTRIBUTE_UNUSED,
+testDomainGetTime(virDomainPtr dom,
long long *seconds,
unsigned int *nseconds,
unsigned int flags)
{
+ int ret = -1;
+ virDomainObjPtr vm = NULL;
+
virCheckFlags(0, -1);
+ if (!(vm = testDomObjFromDomain(dom)))
+ goto cleanup;
+
+ if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain is not running"));
+ goto cleanup;
+ }
+
*seconds = 627319920;
*nseconds = 0;
- return 0;
+ ret = 0;
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
}
#define TEST_SAVE_MAGIC "TestGuestMagic"
--
2.22.0
5 years, 5 months
[libvirt] [PATCH v3 0/2] Ditch external JavaScript libraries
by Martin Kletzander
This is a response to all the discussions (mainly) other people had about all
the JS code we're currently using, bundling, etc.
CORS [1] is set up on planet.virt-tools.org, so we can just get the XML and use
it.
[1] https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
Martin Kletzander (2):
docs: Use our own implementation for fetching the RSS data
docs: Remove unused JS libraries
docs/Makefile.am | 5 +--
docs/index.html.in | 15 ++-------
docs/js/jquery-3.1.1.min.js | 4 ---
docs/js/jquery.rss.min.js | 11 -------
docs/js/main.js | 62 +++++++++++++++++++++++++++++++++++++
docs/js/moment.min.js | 7 -----
6 files changed, 65 insertions(+), 39 deletions(-)
delete mode 100644 docs/js/jquery-3.1.1.min.js
delete mode 100644 docs/js/jquery.rss.min.js
delete mode 100644 docs/js/moment.min.js
--
2.22.0
5 years, 5 months
[libvirt] [PATCH python 0/5] Fix many screwups in virNetworkPort
by Daniel P. Berrangé
The awesome thing about the python code generator is how it generates
rubbish unless you had the right code hacks in the generator. This
series of fixes correct all the screwups missed first time around.
Pushed as build fixes.
Daniel P. Berrangé (5):
Fix syntax error with missing ; and too many )
Define virNetworkPortPtr typedef on old libvirt
generator: fix naming of getter APIs for virNetworkPort
sanitytest: add some special cases for virNetworkPort APIs
Add missing impl of virNetworkListAllPorts
generator.py | 3 +++
libvirt-override-virNetwork.py | 11 ++++++++
libvirt-override.c | 48 +++++++++++++++++++++++++++++++++-
sanitytest.py | 5 +++-
typewrappers.h | 3 +++
5 files changed, 68 insertions(+), 2 deletions(-)
create mode 100644 libvirt-override-virNetwork.py
--
2.21.0
5 years, 5 months
[libvirt] [PATCH 0/2] qemu: Delete HMP cpu hotplug code
by Peter Krempa
Peter Krempa (2):
qemu: monitor: Remove text monitor support for cpu hot(un)plug
qemu: Remove qemuMonitorTextSetCPU
src/qemu/qemu_monitor_json.c | 15 ++++-----------
src/qemu/qemu_monitor_text.c | 30 ------------------------------
src/qemu/qemu_monitor_text.h | 2 --
3 files changed, 4 insertions(+), 43 deletions(-)
--
2.21.0
5 years, 5 months
[libvirt] [security-notice PATCH] notices: fix some typos
by Ján Tomko
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
notices/2008/0001.xml | 4 ++--
notices/2010/0004.xml | 2 +-
notices/2011/0001.xml | 2 +-
notices/2011/0003.xml | 2 +-
notices/2013/0001.xml | 2 +-
notices/2013/0007.xml | 2 +-
notices/2013/0008.xml | 2 +-
notices/2013/0010.xml | 2 +-
notices/2017/0001.xml | 4 ++--
9 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/notices/2008/0001.xml b/notices/2008/0001.xml
index 7d2bfcf..d4f9355 100644
--- a/notices/2008/0001.xml
+++ b/notices/2008/0001.xml
@@ -6,8 +6,8 @@
<description>
<![CDATA[The APIs virDomainMigrate, virDomainBlockPeek, virDomainMemoryPeek,
virDomainSetAutostart, virNetworkSetAutostart, virConnectFindStoragePoolSources
-and virStoragePoolSetAutostart did not check the read-only flag of the
-connection. This allow unprivileged users to invoke APIs that they should
+and virStoragePoolSetAutostart did not check the read-only flag of the
+connection. This allowed unprivileged users to invoke APIs that they should
not have access to.]]>
</description>
diff --git a/notices/2010/0004.xml b/notices/2010/0004.xml
index 080114d..1f8202a 100644
--- a/notices/2010/0004.xml
+++ b/notices/2010/0004.xml
@@ -18,7 +18,7 @@ virtualization host, by checking if the source port is less than
virtual network to gain access to network services only intended
to be used by the host. For example, an NFS filesystem exported to
the virtualization host relying on IP based security with the "secure"
-option will be inadvertantly accessible to guests.]]>
+option will be inadvertently accessible to guests.]]>
</impact>
<workaround>
diff --git a/notices/2011/0001.xml b/notices/2011/0001.xml
index a24dd0f..a5b275e 100644
--- a/notices/2011/0001.xml
+++ b/notices/2011/0001.xml
@@ -7,7 +7,7 @@
<![CDATA[The APIs virConnectDomainXMLToNative,
virNodeDeviceDettach, virNodeDeviceReAttach, virNodeDeviceReset,
virDomainRevertToSnapshot, virDomainSnapshotDelete did not check
-the read-only flag of the connection. This allow unprivileged
+the read-only flag of the connection. This allowed unprivileged
users to invoke APIs that they should not have access to.]]>
</description>
diff --git a/notices/2011/0003.xml b/notices/2011/0003.xml
index e772ff8..4aa655f 100644
--- a/notices/2011/0003.xml
+++ b/notices/2011/0003.xml
@@ -13,7 +13,7 @@ access to inappropriate host files.]]>
<impact>
<![CDATA[A malicious guest disk image could trick the security
-drivre into providing access to inappropriate host files]]>
+driver into providing access to inappropriate host files]]>
</impact>
<workaround>
diff --git a/notices/2013/0001.xml b/notices/2013/0001.xml
index 97d8949..9425a64 100644
--- a/notices/2013/0001.xml
+++ b/notices/2013/0001.xml
@@ -6,7 +6,7 @@
<description>
<![CDATA[When reading and dispatching of a message failed the
message was freed but was not removed from the message queue.
-When the conneciton was later clsed this would result in an
+When the connection was later closed this would result in an
attempt to free uninitialized memory]]>
</description>
diff --git a/notices/2013/0007.xml b/notices/2013/0007.xml
index 55ba600..2c8f409 100644
--- a/notices/2013/0007.xml
+++ b/notices/2013/0007.xml
@@ -5,7 +5,7 @@
<description>
<![CDATA[The legacy Xen driver code for listing inactive domains
-would stasrt populating an array at index -1. This causes memory
+would start populating an array at index -1. This causes memory
corruption leading to a crash of libvirtd]]>
</description>
diff --git a/notices/2013/0008.xml b/notices/2013/0008.xml
index d690fe7..eb79599 100644
--- a/notices/2013/0008.xml
+++ b/notices/2013/0008.xml
@@ -1,7 +1,7 @@
<security-notice xmlns="http://security.libvirt.org/xmlns/security-notice/1.0">
<id>2013-0008</id>
- <summary>Libvirt security driver does nto clear supplementary groups</summary>
+ <summary>Libvirt security driver does not clear supplementary groups</summary>
<description>
<![CDATA[When parsing the process security label for the DAC driver
diff --git a/notices/2013/0010.xml b/notices/2013/0010.xml
index 27515b0..056fc2b 100644
--- a/notices/2013/0010.xml
+++ b/notices/2013/0010.xml
@@ -6,7 +6,7 @@
<description>
<![CDATA[The code handling the virDomainMemoryStats API in the
libvirtd daemon dispatch did not correctly initialize variables
-to NULL. This if RPC parameter validation failed it was possible
+to NULL. Thus if RPC parameter validation failed it was possible
for libvirtd to access uninitialized memory during cleanup.]]>
</description>
diff --git a/notices/2017/0001.xml b/notices/2017/0001.xml
index 0c74ca0..3255c24 100644
--- a/notices/2017/0001.xml
+++ b/notices/2017/0001.xml
@@ -5,8 +5,8 @@
<description>
<![CDATA[When calling the virConnectGetAllDomainStats API on a guest which has
- a CDROM drive with no media present, libvirtd will crash on a NULL pointer
- acess]]>
+ a CDROM drive with no media present, libvirtd will crash on a NULL pointer
+ access]]>
</description>
<impact>
--
2.20.1
5 years, 5 months
[libvirt] [PATCH 0/4] disallow multiple APIs on read-only connections
by Ján Tomko
One patch per CVE for:
CVE-2019-10161
CVE-2019-10166
CVE-2019-10167
CVE-2019-10168
Ján Tomko (4):
api: disallow virDomainSaveImageGetXMLDesc on read-only connections
api: disallow virDomainManagedSaveDefineXML on read-only connections
api: disallow virConnectGetDomainCapabilities on read-only connections
api: disallow virConnect*HypervisorCPU on read-only connections
src/libvirt-domain.c | 13 ++++---------
src/libvirt-host.c | 2 ++
src/qemu/qemu_driver.c | 2 +-
src/remote/remote_protocol.x | 3 +--
4 files changed, 8 insertions(+), 12 deletions(-)
Now pushed.
--
2.20.1
5 years, 5 months
[libvirt] [PATCH v2 0/3] Ditch external JavaScript libraries
by Martin Kletzander
This is a response to all the discussions (mainly) other people had about all
the JS code we're currently using, bundling, etc.
Ideally, we'll set up CORS [1] on planet.virt-tools.org, but for now this is
already a nice clean-up by itself.
[1] https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
Martin Kletzander (3):
docs: Some JavaScript clean-up
docs: Use our own implementation for fetching the RSS data
docs: Remove unused JS libraries
docs/Makefile.am | 5 +-
docs/index.html.in | 15 +-----
docs/js/jquery-3.1.1.min.js | 4 --
docs/js/jquery.rss.min.js | 11 ----
docs/js/main.js | 102 +++++++++++++++++++++++++++---------
docs/js/moment.min.js | 7 ---
6 files changed, 81 insertions(+), 63 deletions(-)
delete mode 100644 docs/js/jquery-3.1.1.min.js
delete mode 100644 docs/js/jquery.rss.min.js
delete mode 100644 docs/js/moment.min.js
--
2.22.0
5 years, 5 months
[libvirt] [PATCH 0/3] Ditch external JavaScript libraries
by Martin Kletzander
This is a response to all the discussions (mainly) other people had about all
the JS code we're currently using, bundling, etc.
I would love some feedback on whether we can work on any of the solutions for
getting rid of that external proxy. We would have to:
- either have our own proxy,
- send a 'Access-Control-Allow-Origin' header from the libvirt.org server to
allow fetching the atom.xml or
- be providing JSONP access to the RSS feed on virt-planet.
I do not have access to any of the infrastructure, so I cannot say if any of
that is possible. It is definitely possible from the technical point of view.
Martin Kletzander (3):
docs: Use our own implementation for fetching the RSS data
docs: use case sensitive javascript
docs: Remove unused JS libraries
docs/Makefile.am | 6 +----
docs/index.html.in | 16 ------------
docs/js/jquery-3.1.1.min.js | 4 ---
docs/js/jquery.rss.min.js | 11 ---------
docs/js/main.js | 49 ++++++++++++++++++++++++++++++++++++-
docs/js/moment.min.js | 7 ------
6 files changed, 49 insertions(+), 44 deletions(-)
delete mode 100644 docs/js/jquery-3.1.1.min.js
delete mode 100644 docs/js/jquery.rss.min.js
delete mode 100644 docs/js/moment.min.js
--
2.21.0
5 years, 5 months