[libvirt] [PATCH] util: Propagate numad failures correctly
by Andrea Bolognani
Right now, if numad fails, we raise an error but return an
empty string to the caller instead of a NULL pointer, which
means processing will continue and the user will see
# virsh start guest
error: Failed to start domain guest
error: invalid argument: Failed to parse bitmap ''
instead of a more reasonable
# virsh start guest
error: Failed to start domain guest
error: operation failed: Failed to query numad for the advisory nodeset
Make sure the user gets a better error message.
https://bugzilla.redhat.com/show_bug.cgi?id=1716387
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/util/virnuma.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/util/virnuma.c b/src/util/virnuma.c
index dd3fb7519e..fee0dfcd5a 100644
--- a/src/util/virnuma.c
+++ b/src/util/virnuma.c
@@ -66,10 +66,12 @@ virNumaGetAutoPlacementAdvice(unsigned short vcpus,
virCommandSetOutputBuffer(cmd, &output);
- if (virCommandRun(cmd, NULL) < 0)
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ if (virCommandRun(cmd, NULL) < 0) {
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Failed to query numad for the "
"advisory nodeset"));
+ VIR_FREE(output);
+ }
return output;
}
--
2.21.0
5 years, 6 months
[libvirt] [PATCH] news: Drop empty section
by Andrea Bolognani
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as trivial.
docs/news.xml | 2 --
1 file changed, 2 deletions(-)
diff --git a/docs/news.xml b/docs/news.xml
index 86f5ffb3f6..f95dfdf3b4 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -56,8 +56,6 @@
</section>
</release>
<release version="v5.4.0" date="2019-06-03">
- <section title="New features">
- </section>
<section title="Security">
<change>
<summary>
--
2.21.0
5 years, 6 months
[libvirt] [PATCH v2 0/7] Check TSC frequency before starting QEMU
by Jiri Denemark
Version 2:
- new patches (1 and 2) fixing qemuargv2xmltest, which was probing host
CPU
When migrating a domain with invtsc CPU feature enabled, the TSC
frequency of the destination host must match the frequency used when the
domain was started on the source host or the destination host has to
support TSC scaling.
If the frequencies do not match and the destination host does not
support TSC scaling, QEMU will fail to set the right TSC frequency when
starting vCPUs on the destination and thus migration will fail. However,
this is quite late since both host might have spent significant time
transferring memory and perhaps even storage data.
By adding the check to libvirt we can let migration fail before any data
starts to be sent over. If for some reason libvirt is unable to detect
the host's TSC frequency or scaling support, we'll just let QEMU try and
the migration will either succeed or fail later.
Luckily, we mandate TSC frequency to be explicitly set in the domain XML
to even allow migration of domains with invtsc. We can just check
whether the requested frequency is compatible with the current host
before starting QEMU.
And to let libvirt client decide whether it should even start the
migration to a specific host, this series adds host's TSC frequency and
scaling support to the host CPU capabilities XML.
https://bugzilla.redhat.com/show_bug.cgi?id=1641702
Jiri Denemark (7):
qemu: Make virQEMUCapsProbeHostCPUForEmulator more generic
qemuargv2xmltest: Use mocked virQEMUCapsProbeHostCPU
util: Add virHostCPUGetTscInfo
conf: Report TSC frequency in host CPU capabilities
cpu_x86: Fix placement of *CheckFeature functions
cpu_x86: Probe TSC frequency and scaling support
qemu: Check TSC frequency before starting QEMU
src/conf/cpu_conf.c | 48 +++++++++++++++++++++
src/conf/cpu_conf.h | 2 +
src/cpu/cpu_x86.c | 81 ++++++++++++++++++++----------------
src/qemu/qemu_capabilities.c | 14 +++----
src/qemu/qemu_capspriv.h | 5 +--
src/qemu/qemu_process.c | 53 +++++++++++++++++++++++
src/util/virhostcpu.c | 71 +++++++++++++++++++++++++++++++
src/util/virhostcpu.h | 11 +++++
tests/Makefile.am | 3 +-
tests/qemuargv2xmltest.c | 3 +-
tests/qemucpumock.c | 5 +--
11 files changed, 243 insertions(+), 53 deletions(-)
--
2.21.0
5 years, 6 months
[libvirt] Release of libvirt-5.4.0
by Daniel Veillard
It's out ! The release is tagged in git, and I provided signed tarball
and source rpms to the usual place:
https://libvirt.org/sources/
I also cut off a 5.4.0 release of the python bindings but code is same a 5.3.0
one, you can find signed tarball and source rpms at:
https://libvirt.org/sources/python/
Main theme of this release is security, there is a set of advisory covered
so users are invited to update, along with some improvements and bug fixes.
Security:
- cpu: Introduce support for the md-clear CPUID bit
This bit is set when microcode provides the mechanism to invoke a flush
of various exploitable CPU buffers by invoking the x86 VERW
instruction. CVE-2018-12126, CVE-2018-12127, CVE-2018-12130,
CVE-2019-11091.
- Restrict user access to virt-admin, virtlogd and virtlockd
The intended users for these facilities are the root user and the
libvirtd service respectively, but these restrictions were not enforced
correctly. CVE-2019-10132.
Improvements:
- test driver: Expand API coverage
Several APIs that were missing from the test driver have now been
implemented.
- Avoid unnecessary static linking
Most binaries shipped as part of libvirt, for example virtlogd and
libvirt_iohelper, were embedding parts of the library even though they
also linked against the libvirt.so dynamic library. This is no longer
the case, which results in both the disk and memory footprint being
reduced.
- qemu: Report stat-htlb-pgalloc and stat-htlb-pgfail balloon stats
These stats have been introduced in QEMU 3.0.
Bug fixes:
- qemu: Fix emulator scheduler support
Setting the scheduler for QEMU's main thread before QEMU had a chance
to start up other threads was misleading as it would affect other
threads (vCPU and I/O) as well. In some particular situations this
could also lead to an error when the thread for vCPU #0 was being moved
to its cpu,cpuacct cgroup. This was fixed so that the scheduler for the
main thread is set after QEMU starts.
- apparmor: Allow hotplug of vhost-scsi devices
Thanks everybody who contributed to this release, be it with bug reports,
patches, reviews, docs ...
Enjoy !
Daniel
--
Daniel Veillard | Red Hat Developers Tools http://developer.redhat.com/
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
5 years, 6 months
[libvirt] [PATCH] maint: Post-release version bump to 5.5.0
by Andrea Bolognani
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as trivial.
configure.ac | 2 +-
docs/news.xml | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 7e01b77fc0..1f05055d6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
-AC_INIT([libvirt], [5.4.0], [libvir-list(a)redhat.com], [], [https://libvirt.org])
+AC_INIT([libvirt], [5.5.0], [libvir-list(a)redhat.com], [], [https://libvirt.org])
AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
diff --git a/docs/news.xml b/docs/news.xml
index 5d5dfb93aa..699fde7b52 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -39,6 +39,14 @@
-->
<libvirt>
+ <release version="v5.5.0" date="unreleased">
+ <section title="New features">
+ </section>
+ <section title="Improvements">
+ </section>
+ <section title="Bug fixes">
+ </section>
+ </release>
<release version="v5.4.0" date="2019-06-03">
<section title="New features">
</section>
--
2.21.0
5 years, 6 months
[libvirt] [PATCH 0/5] Check TSC frequency before starting QEMU
by Jiri Denemark
When migrating a domain with invtsc CPU feature enabled, the TSC
frequency of the destination host must match the frequency used when the
domain was started on the source host or the destination host has to
support TSC scaling.
If the frequencies do not match and the destination host does not
support TSC scaling, QEMU will fail to set the right TSC frequency when
starting vCPUs on the destination and thus migration will fail. However,
this is quite late since both host might have spent significant time
transferring memory and perhaps even storage data.
By adding the check to libvirt we can let migration fail before any data
starts to be sent over. If for some reason libvirt is unable to detect
the host's TSC frequency or scaling support, we'll just let QEMU try and
the migration will either succeed or fail later.
Luckily, we mandate TSC frequency to be explicitly set in the domain XML
to even allow migration of domains with invtsc. We can just check
whether the requested frequency is compatible with the current host
before starting QEMU.
And to let libvirt client decide whether it should even start the
migration to a specific host, this series adds host's TSC frequency and
scaling support to the host CPU capabilities XML.
https://bugzilla.redhat.com/show_bug.cgi?id=1641702
Jiri Denemark (5):
util: Add virHostCPUGetTscInfo
conf: Report TSC frequency in host CPU capabilities
cpu_x86: Fix placement of *CheckFeature functions
cpu_x86: Probe TSC frequency and scaling support
qemu: Check TSC frequency before starting QEMU
src/conf/cpu_conf.c | 48 ++++++++++++++++++++++++
src/conf/cpu_conf.h | 2 +
src/cpu/cpu_x86.c | 81 ++++++++++++++++++++++-------------------
src/qemu/qemu_process.c | 53 +++++++++++++++++++++++++++
src/util/virhostcpu.c | 71 ++++++++++++++++++++++++++++++++++++
src/util/virhostcpu.h | 11 ++++++
6 files changed, 229 insertions(+), 37 deletions(-)
--
2.21.0
5 years, 6 months
[libvirt] [PATCH] test_driver: implement virDomainGetHostname
by Ilias Stamatis
Always return "domain_name" + "host".
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
src/test/test_driver.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 2f58a1da95..aad7bb6036 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1910,6 +1910,27 @@ static int testDomainReboot(virDomainPtr domain,
return ret;
}
+static char *
+testDomainGetHostname(virDomainPtr domain,
+ unsigned int flags)
+{
+ char *ret = NULL;
+ virDomainObjPtr vm = NULL;
+
+ virCheckFlags(0, NULL);
+
+ if (!(vm = testDomObjFromDomain(domain)))
+ goto cleanup;
+
+ if (virDomainObjCheckActive(vm) < 0)
+ goto cleanup;
+
+ ignore_value(virAsprintf(&ret, "%shost", domain->name));
+
+ cleanup:
+ return ret;
+}
+
static int testDomainGetInfo(virDomainPtr domain,
virDomainInfoPtr info)
{
@@ -6950,6 +6971,7 @@ static virHypervisorDriver testHypervisorDriver = {
.domainGetMaxMemory = testDomainGetMaxMemory, /* 0.1.4 */
.domainSetMaxMemory = testDomainSetMaxMemory, /* 0.1.1 */
.domainSetMemory = testDomainSetMemory, /* 0.1.4 */
+ .domainGetHostname = testDomainGetHostname, /* 5.5.0 */
.domainGetInfo = testDomainGetInfo, /* 0.1.1 */
.domainGetState = testDomainGetState, /* 0.9.2 */
.domainGetTime = testDomainGetTime, /* 5.4.0 */
--
2.21.0
5 years, 6 months
[libvirt] [PATCH] virDomainSendKey: validate codeset argument
by Ilias Stamatis
This argument wasn't validated anywhere, neither in the generic
implementation nor in the individual drivers. As a result a call to this
function with a large enough codeset value prior to this change causes
libvirtd to crash.
This happens because all drivers call virKeycodeValueTranslate which
uses codeset as an index to the virKeymapValues array, causing an
out-of-bounds error.
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
src/libvirt-domain.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index df7e405b3e..c09448927b 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -6837,6 +6837,13 @@ virDomainSendKey(virDomainPtr domain,
virCheckNonNullArgGoto(keycodes, error);
virCheckPositiveArgGoto(nkeycodes, error);
+ if (codeset >= VIR_KEYCODE_SET_LAST) {
+ virReportInvalidArg(codeset,
+ _("codeset must be less than %d"),
+ VIR_KEYCODE_SET_LAST);
+ goto error;
+ }
+
if (nkeycodes > VIR_DOMAIN_SEND_KEY_MAX_KEYS) {
virReportInvalidArg(nkeycodes,
_("nkeycodes must be <= %d"),
--
2.21.0
5 years, 6 months
[libvirt] [PATCH] qemu: fix pr-helper0 remain
by Jie Wang
if libvirt receive DISCONNECTED event and set prDaemonRunning to false,
and qemuDomainRemoveDiskDevice is performing in the meantime.
qemuDomainRemoveDiskDevice will return directly by prDaemonRunning
check, so the pr-helper0 object will remain. I think it is no need to
check prDaemonRunning in qemuHotplugRemoveManagedPR.
Signed-off-by: Jie Wang <wangjie88(a)huawei.com>
---
src/qemu/qemu_hotplug.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 34249bd030..5e4a929738 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -465,8 +465,7 @@ qemuHotplugRemoveManagedPR(virQEMUDriverPtr driver,
virErrorPtr orig_err;
int ret = -1;
- if (!priv->prDaemonRunning ||
- virDomainDefHasManagedPR(vm->def))
+ if (virDomainDefHasManagedPR(vm->def))
return 0;
virErrorPreserveLast(&orig_err);
--
2.16.2.windows.1
5 years, 6 months