[libvirt] [PATCH] qemu: do not set wait:false for client sockets
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Qemu commit 767abe7 ("chardev: forbid 'wait' option with client
sockets") effectively deprecates usage of "wait" with client sockets
starting with qemu 4.0, and earlier versions ignored the value.
Cc: Daniel P. Berrangé <berrange(a)redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
src/qemu/qemu_monitor_json.c | 14 ++++++++++----
tests/qemumonitorjsontest.c | 2 --
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 71c452b25b..e7d063a5a8 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -6922,8 +6922,11 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID,
telnet = chr->data.tcp.protocol == VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET;
- if (virJSONValueObjectAppendBoolean(data, "wait", false) < 0 ||
- virJSONValueObjectAppendBoolean(data, "telnet", telnet) < 0 ||
+ if (chr->data.tcp.listen &&
+ virJSONValueObjectAppendBoolean(data, "wait", false) < 0)
+ goto cleanup;
+
+ if (virJSONValueObjectAppendBoolean(data, "telnet", telnet) < 0 ||
virJSONValueObjectAppendBoolean(data, "server", chr->data.tcp.listen) < 0)
goto cleanup;
if (chr->data.tcp.tlscreds) {
@@ -6973,8 +6976,11 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID,
goto cleanup;
addr = NULL;
- if (virJSONValueObjectAppendBoolean(data, "wait", false) < 0 ||
- virJSONValueObjectAppendBoolean(data, "server", chr->data.nix.listen) < 0)
+ if (chr->data.nix.listen &&
+ virJSONValueObjectAppendBoolean(data, "wait", false) < 0)
+ goto cleanup;
+
+ if (virJSONValueObjectAppendBoolean(data, "server", chr->data.nix.listen) < 0)
goto cleanup;
if (qemuMonitorJSONBuildChrChardevReconnect(data, &chr->data.nix.reconnect) < 0)
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 055e201611..f5ad3f6a73 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -874,7 +874,6 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt)
"'data':{'addr':{'type':'inet',"
"'data':{'host':'example.com',"
"'port':'1234'}},"
- "'wait':false,"
"'telnet':false,"
"'server':false}}}");
@@ -920,7 +919,6 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt)
"'backend':{'type':'socket',"
"'data':{'addr':{'type':'unix',"
"'data':{'path':'/path/to/socket'}},"
- "'wait':false,"
"'server':false}}}");
chr = (virDomainChrSourceDef) { .type = VIR_DOMAIN_CHR_TYPE_SPICEVMC };
--
2.21.0.313.ge35b8cb8e2
5 years, 8 months
[libvirt] [PATCH v4] socket: allow wait=false for client socket
by Marc-André Lureau
Commit 767abe7 ("chardev: forbid 'wait' option with client sockets")
is a bit too strict. Current libvirt always set wait=false, and will
thus fail to add client chardev.
Make the code more permissive, allowing wait=false with client socket
chardevs. Deprecate usage of 'wait' with client sockets.
Fixes: 767abe7f49e8be14d29da5db3527817b5d696a52
Cc: Daniel P. Berrangé <berrange(a)redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
chardev/char-socket.c | 12 ++++++++----
qemu-deprecated.texi | 5 +++++
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 3916505d67..b2cf593107 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -1263,10 +1263,14 @@ static bool qmp_chardev_validate_socket(ChardevSocket *sock,
return false;
}
if (sock->has_wait) {
- error_setg(errp, "%s",
- "'wait' option is incompatible with "
- "socket in client connect mode");
- return false;
+ warn_report("'wait' option is deprecated with "
+ "socket in client connect mode");
+ if (sock->wait) {
+ error_setg(errp, "%s",
+ "'wait' option is incompatible with "
+ "socket in client connect mode");
+ return false;
+ }
}
}
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 2219386769..842e71b11d 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -105,6 +105,11 @@ details.
The ``query-events'' command has been superseded by the more powerful
and accurate ``query-qmp-schema'' command.
+@subsection chardev client socket with 'wait' option (since 4.0)
+
+Character devices creating sockets in client mode should not specify
+the 'wait' field, which is only applicable to sockets in server mode
+
@section Human Monitor Protocol (HMP) commands
@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1)
--
2.21.0.313.ge35b8cb8e2
5 years, 8 months
[libvirt] [PATCH] test_driver: provide virDomainGetTime implementation
by Ilias Stamatis
Implement testDomainGetTime by returning the current time.
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
I initially implemented this using clock_gettime, but Pavel suggested
that this might not be a good idea since it isn't a cross-platform
function. So I used virTimeMillisNow instead and set the nanoseconds
part to 0 which can be ok for the test driver.
src/test/test_driver.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index d5eecf4b7f..b6f12e784f 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -64,6 +64,7 @@
#include "virinterfaceobj.h"
#include "virhostcpu.h"
#include "virdomainsnapshotobjlist.h"
+#include "virtime.h"
#define VIR_FROM_THIS VIR_FROM_TEST
@@ -1943,6 +1944,23 @@ testDomainGetState(virDomainPtr domain,
return 0;
}
+static int
+testDomainGetTime(virDomainPtr dom ATTRIBUTE_UNUSED,
+ long long *seconds,
+ unsigned int *nseconds,
+ unsigned int flags ATTRIBUTE_UNUSED)
+{
+ unsigned long long now;
+
+ if (virTimeMillisNow(&now) < 0)
+ return -1;
+
+ *seconds = now / 1000;
+ *nseconds = 0;
+
+ return 0;
+}
+
#define TEST_SAVE_MAGIC "TestGuestMagic"
static int
@@ -6786,6 +6804,7 @@ static virHypervisorDriver testHypervisorDriver = {
.domainSetMemory = testDomainSetMemory, /* 0.1.4 */
.domainGetInfo = testDomainGetInfo, /* 0.1.1 */
.domainGetState = testDomainGetState, /* 0.9.2 */
+ .domainGetTime = testDomainGetTime, /* 5.3.0 */
.domainSave = testDomainSave, /* 0.3.2 */
.domainSaveFlags = testDomainSaveFlags, /* 0.9.4 */
.domainRestore = testDomainRestore, /* 0.3.2 */
--
2.21.0
5 years, 8 months
[libvirt] [PATCH] rpc: Segfaults and memory leak in virNetTLSContextNew function
by Adrian Brzezinski
Failed new gnutls context allocations in virNetTLSContextNew function
results in double free and segfault. Occasional memory leaks may also
occur. You can read detailed description at:
https://bugzilla.redhat.com/show_bug.cgi?id=1699062
Signed-off-by: Adrian Brzezinski <redhat(a)adrb.pl>
---
docs/news.xml | 10 ++++++++++
src/rpc/virnettlscontext.c | 6 ++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/docs/news.xml b/docs/news.xml
index 21807f2..f6157ec 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -350,6 +350,16 @@
<section title="Bug fixes">
<change>
<summary>
+ rpc: Segfaults and memory leak in virNetTLSContextNew function
+ </summary>
+ <description>
+ Failed new gnutls context allocations in virNetTLSContextNew function
+ results in double free and segfault. Occasional memory leaks may also
+ occur.
+ </description>
+ </change>
+ <change>
+ <summary>
qemu: Use CAP_DAC_OVERRIDE during QEMU capabilities probing
</summary>
<description>
diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c
index 72e9ed9..8f6ec8f 100644
--- a/src/rpc/virnettlscontext.c
+++ b/src/rpc/virnettlscontext.c
@@ -703,14 +703,14 @@ static virNetTLSContextPtr virNetTLSContextNew(const char *cacert,
return NULL;
if (VIR_STRDUP(ctxt->priority, priority) < 0)
- goto error;
+ goto ctxt_init_error;
err = gnutls_certificate_allocate_credentials(&ctxt->x509cred);
if (err) {
virReportError(VIR_ERR_SYSTEM_ERROR,
_("Unable to allocate x509 credentials: %s"),
gnutls_strerror(err));
- goto error;
+ goto ctxt_init_error;
}
if (sanityCheckCert &&
@@ -759,6 +759,8 @@ static virNetTLSContextPtr virNetTLSContextNew(const char *cacert,
if (isServer)
gnutls_dh_params_deinit(ctxt->dhParams);
gnutls_certificate_free_credentials(ctxt->x509cred);
+ ctxt_init_error:
+ if (ctxt->priority) VIR_FREE(ctxt->priority);
VIR_FREE(ctxt);
return NULL;
}
--
1.8.3.1
5 years, 8 months
[libvirt] [PATCH] news: document dropping support of VirtualBox versions < 5.0
by Daniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
docs/news.xml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 86c7734694..79b5658cc3 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -49,6 +49,16 @@
release.
</description>
</change>
+ <change>
+ <summary>
+ Removed support for VirtualBox versions < 5.0
+ </summary>
+ <description>
+ Support for managing VirtualBox releases prior to 5.0 has
+ been dropped. The upstream project has declared that these
+ versions are end of life several years ago.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
</section>
--
2.20.1
5 years, 8 months
[libvirt] [PATCH 0/2] refactor virDomainSchedulerFormat
by Ján Tomko
*** BLURB HERE ***
Ján Tomko (2):
conf: pass the element/attribute names to virSchedulerFormat
conf: switch virDomainSchedulerFormat to use virXMLFormatElement
src/conf/domain_conf.c | 36 ++++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)
--
2.19.2
5 years, 8 months
[libvirt] [PATCH 0/1] power: add support for vm,uuid file
by Dimitri John Ledkov
On POWER systems, qemu exports uuid as a firmware devicetree node
vm,uuid. Use that in a similar manner to the product_uuid file as on
DMI based (x86) machines.
Dimitri John Ledkov (1):
viruuid: On POWER, qemu exports uuid as 'vm,uuid' devicetree node.
src/util/viruuid.c | 2 ++
1 file changed, 2 insertions(+)
--
2.20.1
5 years, 8 months
[libvirt] [dbus PATCH] tests: fix test_connect
by Pavel Hrdina
Calling fixtures directly was removed in pytest 4.0, we can change the
fixture to be a wrapper around the original function and use the
original fixture name.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
tests/libvirttest.py | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/tests/libvirttest.py b/tests/libvirttest.py
index 14baf5b..a442196 100644
--- a/tests/libvirttest.py
+++ b/tests/libvirttest.py
@@ -84,13 +84,7 @@ class BaseTestClass():
interface_obj.Create(0)
return path, interface_obj
- @pytest.fixture
def node_device_create(self):
- """ Fixture to create dummy node device on the test driver
-
- This fixture should be used in the setup of every test manipulating
- with node devices.
- """
# We need a usable parent nodedev: possible candidates are
# scsi_host2 (available since libvirt 3.1.0) and
# test-scsi-host-vport (available until libvirt 3.0.0).
@@ -109,6 +103,15 @@ class BaseTestClass():
path = self.connect.NodeDeviceCreateXML(xml, 0)
return path
+ @pytest.fixture(name="node_device_create")
+ def fixture_node_device_create(self):
+ """ Fixture to create dummy node device on the test driver
+
+ This fixture should be used in the setup of every test manipulating
+ with node devices.
+ """
+ return self.node_device_create()
+
@pytest.fixture
def storage_volume_create(self):
""" Fixture to create dummy storage volume on the test driver
--
2.20.1
5 years, 8 months
[libvirt] [PATCH v2 0/7] vbox: drop support for many old versions
by Daniel P. Berrangé
Per this link:
https://www.virtualbox.org/wiki/Download_Old_Builds
VirtualBox 6.0 (active maintenance)
VirtualBox 5.2 (active maintenance)
VirtualBox 5.1 (no longer supported, support ended 2018/04)
VirtualBox 5.0 (no longer supported, support ended 2017/05)
VirtualBox 4.3 (no longer supported, support ended 2015/12)
VirtualBox 4.2 (no longer supported, support ended 2015/12)
VirtualBox 4.1 (no longer supported, support ended 2015/12)
VirtualBox 4.0 (no longer supported, support ended 2015/12)
We can certainly drop all the 4.x versions. The host OS those are
officially supported on are very outdated:
eg
https://www.virtualbox.org/wiki/Download_Old_Builds_4_3
Linux Hosts:
Ubuntu 13.04 ("Raring") / 13.10 ("Saucy") / 14.04 ("Trusty") / 14.10 ("Utopic") i386 | AMD64
Ubuntu 12.10 ("Quantal") i386 | AMD64
Ubuntu 12.04 ("Precise") i386 | AMD64
Ubuntu 10.04 LTS ("Lucid") i386 | AMD64
Debian 7 ("Wheezy") i386 | AMD64
Debian 6 ("Squeeze") i386 | AMD64
openSUSE 12.3 / 13.1 i386 | AMD64
openSUSE 11.4 / 12.1 / 12.2 i386 | AMD64
SUSE Linux Enterprise Server 11 (SLES11) i386 | AMD64
SUSE Linux Enterprise Server 10 (SLES10) i386 | AMD64
Fedora 18 ("Spherical Cow") / Fedora 19 ("Schrödingers Cat") i386 | AMD64
Fedora 17 ("Beefy Miracle") i386 | AMD64
Mandriva 2011.0 i386 | AMD64
Oracle Linux 6 ("OL6") / Red Hat Enterprise Linux 6 ("RHEL6") / CentOS 6 i386 | AMD64
Oracle Linux 5 ("OL5") / Red Hat Enterprise Linux 5 ("RHEL5") / CentOS 5 i386 | AMD64
All distributions i386 | AMD64
Although the catch all "All distributions" suggest it might work with
newer distros, they are clearly a second tier from a support POV. All
these explicitly targetted distros are outside libvirt's support policy.
There is a question as to whether to delete 5.0 and 5.1 support from
libvirt.
There are no remainining #ifdef VBOX_API_VERSION conditionals in the
vbox_tmpl.h file related to code differences between 5.0, 5.1 and 5.2,
so keeping them is not a maint burden in code.
The main burden is distributing the large vbox_CAPI_v5_0.h and
vbox_CAPI_v5_1.h files which are ~1 MB in size (uncompressed)
or ~85 kb (xz compressed). IOW versions 5.0 and 5.1 increase
the release tarballs by a small amount, but nothing that is
too unreasonable vs the overall size of 14 MB for libvirt source.
Thus I have kept 5.0 and 5.1 support.
VirtualBox 6.0 came out in Dec 2018 and given past practice it
would not suprise me if that has API changes impacting libvirt.
So some interested party might want to look at supporting that
in libvirt.
In v2:
- Also remove deleted files from the Makefile
- Stop including the old deleted 4.0 API file
Daniel P. Berrangé (7):
vbox: drop support for VirtualBox 4.x releases
vbox: drop C API definition for release 4.0
vbox: drop C API definition for release 4.1
vbox: drop C API definition for release 4.2
vbox: drop C API definition for release 4.2.20
vbox: drop C API definition for release 4.3
vbox: drop C API definition for release 4.3.4
src/vbox/Makefile.inc.am | 12 -
src/vbox/vbox_CAPI_v4_0.h | 7451 -----------------------
src/vbox/vbox_CAPI_v4_1.h | 7882 ------------------------
src/vbox/vbox_CAPI_v4_2.h | 8855 ---------------------------
src/vbox/vbox_CAPI_v4_2_20.h | 9001 ----------------------------
src/vbox/vbox_CAPI_v4_3.h | 10210 -------------------------------
src/vbox/vbox_CAPI_v4_3_4.h | 10321 --------------------------------
src/vbox/vbox_V4_0.c | 37 -
src/vbox/vbox_V4_1.c | 37 -
src/vbox/vbox_V4_2.c | 13 -
src/vbox/vbox_V4_2_20.c | 13 -
src/vbox/vbox_V4_3.c | 13 -
src/vbox/vbox_V4_3_4.c | 13 -
src/vbox/vbox_XPCOMCGlue.h | 2 +-
src/vbox/vbox_common.h | 14 +-
src/vbox/vbox_storage.c | 14 +-
src/vbox/vbox_tmpl.c | 218 +-
src/vbox/vbox_uniformed_api.h | 10 +-
18 files changed, 8 insertions(+), 54108 deletions(-)
delete mode 100644 src/vbox/vbox_CAPI_v4_0.h
delete mode 100644 src/vbox/vbox_CAPI_v4_1.h
delete mode 100644 src/vbox/vbox_CAPI_v4_2.h
delete mode 100644 src/vbox/vbox_CAPI_v4_2_20.h
delete mode 100644 src/vbox/vbox_CAPI_v4_3.h
delete mode 100644 src/vbox/vbox_CAPI_v4_3_4.h
delete mode 100644 src/vbox/vbox_V4_0.c
delete mode 100644 src/vbox/vbox_V4_1.c
delete mode 100644 src/vbox/vbox_V4_2.c
delete mode 100644 src/vbox/vbox_V4_2_20.c
delete mode 100644 src/vbox/vbox_V4_3.c
delete mode 100644 src/vbox/vbox_V4_3_4.c
--
2.20.1
5 years, 8 months
[libvirt] [PATCH] news: Document firmware autoselection exposure in domcaps
by Michal Privoznik
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/news.xml | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 21807f26d3..eb97d25c80 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -49,6 +49,18 @@
release.
</description>
</change>
+ <change>
+ <summary>
+ qemu: Advertise firmware autoselection in domain capabilities
+ </summary>
+ <description>
+ The firmware autoselection feature is now exposed in
+ domain capabilities and management applications can
+ query for accepted values, i.e. values that are accepted
+ and for which libvirt found firmware descriptor files.
+ Among with that support for Secure Boot is advertised.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
</section>
--
2.21.0
5 years, 8 months