[libvirt] [PATCH v2 0/5] Require GnuTLS
by Michal Privoznik
v2 of:
diff to v1:
- Reworded commit message of 1/3
- Broken 2/3 into three separate patches:
1) removing WITH_GNUTLS conditional from src/
2) removing libvirt_gnutls.syms
3) removing WITH_GNUTLS conditional from tests/
Michal Privoznik (5):
configure: Require GnuTLS
src: Always build virnettlscontext into libvirt-net-rpc.la
src: Dissolve libvirt_gnutls.syms in libvirt_remote.syms
tests: Always build TLS related tests
src: Drop most of #ifdef WITH_GNUTLS
configure.ac | 2 --
m4/virt-gnutls.m4 | 4 ---
src/Makefile.am | 6 ----
src/libvirt_gnutls.syms | 48 -------------------------------
src/libvirt_remote.syms | 25 ++++++++++++++++
src/locking/lock_daemon.c | 4 ---
src/logging/log_daemon.c | 4 ---
src/lxc/lxc_controller.c | 2 --
src/qemu/qemu_migration_cookie.c | 12 +++-----
src/remote/remote_daemon.c | 23 ---------------
src/remote/remote_daemon_dispatch.c | 2 --
src/rpc/Makefile.inc.am | 14 ++-------
src/rpc/virnetdaemon.h | 4 +--
src/rpc/virnetserver.c | 6 ----
src/rpc/virnetserver.h | 6 +---
src/rpc/virnetserverclient.c | 57 +++----------------------------------
src/rpc/virnetserverclient.h | 8 ------
src/rpc/virnetserverservice.c | 24 ----------------
src/rpc/virnetserverservice.h | 10 -------
src/util/vircrypto.c | 43 ++--------------------------
tests/Makefile.am | 12 ++------
tests/qemuxml2argvtest.c | 15 ----------
tests/vircryptotest.c | 24 +++++-----------
tests/virfilecachetest.c | 18 +++---------
tests/virnetdaemontest.c | 8 ------
tests/virnetserverclienttest.c | 2 --
tests/virrandommock.c | 8 ++----
27 files changed, 56 insertions(+), 335 deletions(-)
delete mode 100644 src/libvirt_gnutls.syms
--
2.16.4
6 years, 5 months
[libvirt] [PATCH v9 00/11] x86: Secure Encrypted Virtualization (AMD)
by Brijesh Singh
This patch series provides support for launching an encrypted guest using
AMD's new Secure Encrypted Virtualization (SEV) feature.
SEV is an extension to the AMD-V architecture which supports running
multiple VMs under the control of a hypervisor. When enabled, SEV feature
allows the memory contents of a virtual machine (VM) to be transparently
encrypted with a key unique to the guest VM.
At very high level the flow looks this:
1. mgmt tool calls virConnectGetDomainCapabilities. This returns an XML document
that includes the following
<feature>
...
<sev supported='yes'>
<cbitpos> </cbitpos>
<reduced-phys-bits> </reduced-phys-bits>
</sev>
</feature>
If <sev> is provided then we indicate that hypervisor is capable of launching
SEV guest. mgmt tool can call virNodeGetSEVCapabilities() to get the additional
informations like PDH and certificate chain etc.
2. (optional) mgmt tool can provide the PDH and Cert-chain to guest owner in case
if guest owner wish to establish a secure connection with SEV firmware to
negotiate a key used for validating the measurement.
3. mgmt tool requests to start a guest calling virCreateXML(), passing \
VIR_DOMAIN_START_PAUSED. The xml would include
<launch-security type='sev'>
<cbitpos>47</cbitpos>
<reduced-phys-bits>1</reduced-phys-bits>
<policy>0x1</policy>
(optional)
<dh-cert> </dh-cert> /* Guest owners Diffie-Hellman key */
<session> </session> /* Guest owners Session blob */
</launch-security>
4. Libvirt generate the QEMU cli arg to enable the SEV feature, a typical
args looks like this:
# $QEMU ..
-machine memory-encryption=sev0 \
-object sev-guest,id=sev0,dh-cert-file=<file>....
5. Libvirt generates lifecycle VIR_DOMAIN_EVENT_SUSPENDED_PAUSED event
6. mgmt tool gets the VIR_DOMAIN_EVENT_SUSPENDED_PAUSED and calls \
virDomainGetLaunchSecretInfo() to retrieve the measurement of encrypted memory.
7. (optional) mgmt tool can provide the measurement value to guest owner, which can
validate the measurement and gives GO/NO-GO answer. If mgmt tool gets GO then
it resumes the guest otherwise it calls destroy() to kill the guest.
8. mgmt tool resumes the guest
TODO:
* SEV guest require to use DMA apis for the virtio devices. In order to use the DMA
apis the virtio devices must have this tag
<driver iommu=on ats=on>
It is a bit unclear to me where these changes need to go. Do we need to
modify the libvirt to automatically add these when SEV is enabled or
we ask mgmt tool to make sure that it creates XML with right tag to enable
the DMA APIs for virtio devices. I am looking for some suggestions.
Using these patches we have succesfully booted and tested a guest both with and
without SEV enabled.
SEV Firmware API spec is available at:
https://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf
Changes sicne v8:
* rename qemuGetSEVInfo -> qemuGetSEVInfoToParams
* use virQEMUCapsCacheLookupByArch to get qemuCaps
Change since v7:
* rename virNodeSEVCapability() -> virNodeSEVInfo()
* rebase the series
Changes since v6:
* add API to get SEV PDH and Certificate chain data
* drop virsh command changes. We can revisit this later when we have
more visibility on setter.
Change since v5:
* drop the seperate test patch and merge the code with other patches.
* rename the xml from sev -> launch-security-sev
* make policy field mandatory
* address multiple feedback from previous reviews.
Changes since v4:
* add /dev/sev in shared device list
Changes since v3:
* rename QEMU_CAPS_SEV -> QEMU_CAPS_SEV_GUEST
* update caps_2.12.0.x86_64.replies to include query-sev-capabilities data
Changes since v2:
* make cbitpos, policy and reduced-phys-bits as unsigned int
* update virDomainGetLaunchSecurityInfo to accept virTypedParameterPtr *params
instead of virTypedParameterPtr params.
Changes since v1:
* rename <sev> -> <launch-security> for domain
* add more information about policy and other fields in domaincaps.html
* split the domain_conf support in two patches
* add virDomainGetLaunchInfo() to retrieve the SEV measurement
* extend virsh command to show the domain's launch security information
* add test cases to validate newly added <launch-security> element
* fix issues reported with 'make check' and 'make syntax-check'
The complete git tree is available at:
https://github.com/codomania/libvirt/tree/v9
Brijesh Singh (11):
qemu: provide support to query the SEV capability
conf: expose SEV feature in domain capabilities
libvirt: Introduce virNodeGetSEVInfo public API
remote: implement the remote protocol for virNodeGetSEVInfo()
qemu: Implement the driver backend for virNodeGetSEVInfo()
conf: introduce launch-security element in domain
qemu/cgroup: add /dev/sev in shared devices list
qemu: add support to launch SEV guest
libvirt: Introduce virDomainGetLaunchSecurityInfo public API
remote: implement the remote protocol for launch security
qemu: Implement the driver backend for virDomainGetLaunchSecurityInfo
docs/drvqemu.html.in | 3 +-
docs/formatdomain.html.in | 115 ++++++++++++++++
docs/formatdomaincaps.html.in | 30 ++++
docs/schemas/domaincaps.rng | 14 ++
docs/schemas/domaincommon.rng | 37 +++++
include/libvirt/libvirt-domain.h | 17 +++
include/libvirt/libvirt-host.h | 42 ++++++
src/conf/domain_capabilities.c | 30 ++++
src/conf/domain_capabilities.h | 13 ++
src/conf/domain_conf.c | 133 ++++++++++++++++++
src/conf/domain_conf.h | 27 ++++
src/driver-hypervisor.h | 14 ++
src/libvirt-domain.c | 48 +++++++
src/libvirt-host.c | 49 +++++++
src/libvirt_private.syms | 1 +
src/libvirt_public.syms | 2 +
src/qemu/qemu.conf | 2 +-
src/qemu/qemu_capabilities.c | 90 +++++++++++-
src/qemu/qemu_capabilities.h | 6 +
src/qemu/qemu_capspriv.h | 4 +
src/qemu/qemu_cgroup.c | 2 +-
src/qemu/qemu_command.c | 41 ++++++
src/qemu/qemu_driver.c | 151 +++++++++++++++++++++
src/qemu/qemu_monitor.c | 18 +++
src/qemu/qemu_monitor.h | 6 +
src/qemu/qemu_monitor_json.c | 121 +++++++++++++++++
src/qemu/qemu_monitor_json.h | 5 +
src/qemu/qemu_process.c | 62 +++++++++
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/remote/remote_daemon_dispatch.c | 91 +++++++++++++
src/remote/remote_driver.c | 80 +++++++++++
src/remote/remote_protocol.x | 39 +++++-
src/remote_protocol-structs | 23 ++++
tests/genericxml2xmlindata/launch-security-sev.xml | 24 ++++
tests/genericxml2xmltest.c | 2 +
.../caps_2.12.0.x86_64.replies | 10 ++
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 3 +-
tests/qemuxml2argvdata/launch-security-sev.args | 29 ++++
tests/qemuxml2argvdata/launch-security-sev.xml | 37 +++++
tests/qemuxml2argvtest.c | 4 +
40 files changed, 1420 insertions(+), 6 deletions(-)
create mode 100644 tests/genericxml2xmlindata/launch-security-sev.xml
create mode 100644 tests/qemuxml2argvdata/launch-security-sev.args
create mode 100644 tests/qemuxml2argvdata/launch-security-sev.xml
--
2.7.4
6 years, 5 months
[libvirt] KVM Forum 2018: Call For Participation
by Paolo Bonzini
================================================================
KVM Forum 2018: Call For Participation
October 24-26, 2018 - Edinburgh International Conference Centre - Edinburgh, UK
(All submissions must be received before midnight June 14, 2018)
=================================================================
KVM Forum is an annual event that presents a rare opportunity
for developers and users to meet, discuss the state of Linux
virtualization technology, and plan for the challenges ahead.
We invite you to lead part of the discussion by submitting a speaking
proposal for KVM Forum 2018.
At this highly technical conference, developers driving innovation
in the KVM virtualization stack (Linux, KVM, QEMU, libvirt) can
meet users who depend on KVM as part of their offerings, or to
power their data centers and clouds.
KVM Forum will include sessions on the state of the KVM
virtualization stack, planning for the future, and many
opportunities for attendees to collaborate. After more than ten
years of development in the Linux kernel, KVM continues to be a
critical part of the FOSS cloud infrastructure.
This year, KVM Forum is joining Open Source Summit in Edinburgh, UK. Selected
talks from KVM Forum will be presented on Wednesday October 24 to the full
audience of the Open Source Summit. Also, attendees of KVM Forum will have
access to all of the talks from Open Source Summit on Wednesday.
https://events.linuxfoundation.org/events/kvm-forum-2018/program/cfp/
Suggested topics:
* Scaling, latency optimizations, performance tuning, real-time guests
* Hardening and security
* New features
* Testing
KVM and the Linux kernel:
* Nested virtualization
* Resource management (CPU, I/O, memory) and scheduling
* VFIO: IOMMU, SR-IOV, virtual GPU, etc.
* Networking: Open vSwitch, XDP, etc.
* virtio and vhost
* Architecture ports and new processor features
QEMU:
* Management interfaces: QOM and QMP
* New devices, new boards, new architectures
* Graphics, desktop virtualization and virtual GPU
* New storage features
* High availability, live migration and fault tolerance
* Emulation and TCG
* Firmware: ACPI, UEFI, coreboot, U-Boot, etc.
Management and infrastructure
* Managing KVM: Libvirt, OpenStack, oVirt, etc.
* Storage: Ceph, Gluster, SPDK, etc.r
* Network Function Virtualization: DPDK, OPNFV, OVN, etc.
* Provisioning
===============
SUBMITTING YOUR PROPOSAL
===============
Abstracts due: June 14, 2018
Please submit a short abstract (~150 words) describing your presentation
proposal. Slots vary in length up to 45 minutes. Also include the proposal
type -- one of:
- technical talk
- end-user talk
Submit your proposal here:http://events.linuxfoundation.org/cfp
Please only use the categories "presentation" and "panel discussion"
You will receive a notification whether or not your presentation proposal
was accepted by August 10, 2018.
Speakers will receive a complimentary pass for the event. In the instance
that case your submission has multiple presenters, only the primary speaker for a
proposal will receive a complimentary event pass. For panel discussions, all
panelists will receive a complimentary event pass.
TECHNICAL TALKS
A good technical talk should not just report on what has happened over
the last year; it should present a concrete problem and how it impacts
the user and/or developer community. Whenever applicable, focus on
work that needs to be done, difficulties that haven't yet been solved,
and on decisions that other developers should be aware of. Summarizing
recent developments is okay but it should not be more than a small
portion of the overall talk.
END-USER TALKS
One of the big challenges as developers is to know what, where and how
people actually use our software. We will reserve a few slots for end
users talking about their deployment challenges and achievements.
If you are using KVM in production you are encouraged submit a speaking
proposal. Simply mark it as an end-user talk. As an end user, this is a
unique opportunity to get your input to developers.
HANDS-ON / BOF SESSIONS
We will reserve some time for people to get together and discuss
strategic decisions as well as other topics that are best solved within
smaller groups.
These sessions will be announced during the event. If you are interested
in organizing such a session, please add it to the list at
http://www.linux-kvm.org/page/KVM_Forum_2018_BOF
Let people you think who might be interested know about your BOF, and encourage
them to add their names to the wiki page as well. Please try to
add your ideas to the list before KVM Forum starts.
PANEL DISCUSSIONS
If you are proposing a panel discussion, please make sure that you list
all of your potential panelists in your the abstract. We will request full
biographies if a panel is acceped.
===============
HOTEL / TRAVEL
===============
This year's event will take place at the Edinburgh International Conference Centre.
For information about discounted hotel room rate for conference attendees
at the nearby Sheraton Grand Hotel & Spa, Edinburgh, please visit
https://events.linuxfoundation.org/events/kvm-forum-2018/attend/venue-tra...
===============
IMPORTANT DATES
===============
Submission deadline: June 14, 2018
Notification: August 10, 2018
Schedule announced: August 16, 2018
Event dates: October 24-26, 2018
Thank you for your interest in KVM. We're looking forward to your
submissions and seeing you at the KVM Forum 2018 in October!
-your KVM Forum 2018 Program Committee
Please contact us with any questions or comments at
kvm-forum-2018-pc(a)redhat.com
6 years, 5 months
[libvirt] [PATCH] qemu: add qemu_monitor_priv.h to sources list
by Daniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a build fix
src/qemu/Makefile.inc.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am
index 46797af4be..2afa67f195 100644
--- a/src/qemu/Makefile.inc.am
+++ b/src/qemu/Makefile.inc.am
@@ -40,6 +40,7 @@ QEMU_DRIVER_SOURCES = \
qemu/qemu_migration_paramspriv.h \
qemu/qemu_monitor.c \
qemu/qemu_monitor.h \
+ qemu/qemu_monitor_priv.h \
qemu/qemu_monitor_text.c \
qemu/qemu_monitor_text.h \
qemu/qemu_monitor_json.c \
--
2.17.0
6 years, 5 months
[libvirt] [PATCH] conf: remove duplicated typedefs for virDomainSevDef
by Daniel P. Berrangé
The typedefs were present twice in the header file which causes failures
with some compilers, eg FreeBSD 10 CLang:
../../src/conf/domain_conf.h:2330:33: error: redefinition of typedef 'virDomainSevDef' is a C11 feature
+[-Werror,-Wtypedef-redefinition]
typedef struct _virDomainSevDef virDomainSevDef;
^
../../src/conf/domain_conf.h:145:33: note: previous definition is here
typedef struct _virDomainSevDef virDomainSevDef;
^
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a build fix
src/conf/domain_conf.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index fe7a6bb21b..ea8ddb2b39 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -142,9 +142,6 @@ typedef virDomainPanicDef *virDomainPanicDefPtr;
typedef struct _virDomainMemoryDef virDomainMemoryDef;
typedef virDomainMemoryDef *virDomainMemoryDefPtr;
-typedef struct _virDomainSevDef virDomainSevDef;
-typedef virDomainSevDef *virDomainSevDefPtr;
-
/* forward declarations virDomainChrSourceDef, required by
* virDomainNetDef
*/
--
2.17.0
6 years, 5 months
[libvirt] [PATCH] AppArmor: allow virt-aa-helper read access to Nova's qcow backing files.
by intrigeri+libvirt@boum.org
From: intrigeri <intrigeri+libvirt(a)boum.org>
As reported on https://bugs.debian.org/892431, without this rule, when launching
a QEMU KVM instance, an error occurs immediately upon launching the QEMU
process such as:
Could not open backing file: Could not open
'/var/lib/nova/instances/_base/affe96668a4c64ef380ff1c71b4caec17039080e':
Permission denied
The other instance disk images are already covered by the existing rule:
/**/disk{,.*} r
---
examples/apparmor/usr.lib.libvirt.virt-aa-helper | 1 +
1 file changed, 1 insertion(+)
diff --git a/examples/apparmor/usr.lib.libvirt.virt-aa-helper b/examples/apparmor/usr.lib.libvirt.virt-aa-helper
index 6869685c05..e32402a904 100644
--- a/examples/apparmor/usr.lib.libvirt.virt-aa-helper
+++ b/examples/apparmor/usr.lib.libvirt.virt-aa-helper
@@ -50,6 +50,7 @@ profile virt-aa-helper /usr/{lib,lib64}/libvirt/virt-aa-helper {
@{HOME}/** r,
/var/lib/libvirt/images/ r,
/var/lib/libvirt/images/** r,
+ /var/lib/nova/instances/_base/* r
/{media,mnt,opt,srv}/** r,
# For virt-sandbox
/{,var/}run/libvirt/**/[sv]d[a-z] r,
--
2.17.1
6 years, 5 months
[libvirt] [python PATCH 0/4] Random fixes
by Pavel Hrdina
Pavel Hrdina (4):
libvirt-utils: remove unused py_str function
typewrappers: Fix libvirt_charPtrUnwrap to set an exception if it
fails
libvirt-override: Reset exception if the error is ignored
libvirt_charPtrUnwrap: remove unnecessary check of returned string
libvirt-override.c | 16 +++++++---------
libvirt-utils.c | 24 +++---------------------
libvirt-utils.h | 1 -
typewrappers.c | 5 ++++-
4 files changed, 14 insertions(+), 32 deletions(-)
--
2.17.1
6 years, 5 months
[libvirt] [dbus PATCH] util: Introduce virtDBusUtil(En|De)codeStr helpers
by Pavel Hrdina
D-Bus object path element can contain only [a-zA-Z0-9_] characters so
we need to encode existing unique IDs. In case of UUID it's simple, we
just change '-' into '_' but in case of storage volumes we need to use
'key' which is arbitrary string.
This helpers encode the string using this algorithm:
[a-zA-Z0-9] > [a-zA-Z0-9]
anything else > _XX where XX is hex representation
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
.gitignore | 4 ++-
src/util.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++
src/util.h | 6 +++++
tests/Makefile.am | 20 +++++++++++++++
tests/test_util.c | 47 ++++++++++++++++++++++++++++++++++
5 files changed, 140 insertions(+), 1 deletion(-)
create mode 100644 tests/test_util.c
diff --git a/.gitignore b/.gitignore
index 0bf09cf..c5e16a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
*Makefile
*Makefile.in
*~
+.deps
__pycache__
vgcore.*
@@ -31,6 +32,7 @@ vgcore.*
/docs/*.1
-/src/.deps/
/src/libvirt-dbus
/src/org.libvirt.service
+
+/tests/test_util
diff --git a/src/util.c b/src/util.c
index 53dbc57..1268736 100644
--- a/src/util.c
+++ b/src/util.c
@@ -181,6 +181,70 @@ virtDBusUtilDecodeUUID(const gchar *uuid)
return g_strdelimit(ret, "_", '-');
}
+static guchar
+virtDBusUtilNumToHexchar(const guchar c)
+{
+ if (c < 10)
+ return '0' + c;
+ return 'a' + (c & 0x0f) - 10;
+}
+
+static guchar
+virtDBusUtilHexcharToNum(const guchar c)
+{
+ if (c >= 'a')
+ return 10 + c - 'a';
+ return c - '0';
+}
+
+gchar *
+virtDBusUtilEncodeStr(const gchar *str)
+{
+ gint len = strlen(str);
+ gint j = 0;
+ gchar *ret = g_new(gchar, len * 3 + 1);
+
+ for (gint i = 0; i < len; i++) {
+ guchar c = str[i];
+ if ((c >= 'A' && c <= 'Z') ||
+ (c >= 'a' && c <= 'z') ||
+ (c >= '0' && c <= '9')) {
+ ret[j++] = c;
+ } else {
+ ret[j] = '_';
+ ret[j + 1] = virtDBusUtilNumToHexchar(c >> 4);
+ ret[j + 2] = virtDBusUtilNumToHexchar(c);
+ j += 3;
+ }
+ }
+ ret[j] = 0;
+
+ return ret;
+}
+
+gchar *
+virtDBusUtilDecodeStr(const gchar *str)
+{
+ gint len = strlen(str);
+ gint j = 0;
+ gchar *ret = g_new(gchar, len + 1);
+
+ for (gint i = 0; i < len; i++) {
+ gchar c = str[i];
+ if (c != '_' || (i + 2) >= len) {
+ ret[j++] = c;
+ } else {
+ guchar a = virtDBusUtilHexcharToNum(str[i + 1]);
+ guchar b = virtDBusUtilHexcharToNum(str[i + 2]);
+ ret[j++] = (a << 4) + b;
+ i += 2;
+ }
+ }
+ ret[j] = 0;
+
+ return ret;
+}
+
gchar *
virtDBusUtilBusPathForVirDomain(virDomainPtr domain,
const gchar *domainPath)
diff --git a/src/util.h b/src/util.h
index 4d87549..56e0409 100644
--- a/src/util.h
+++ b/src/util.h
@@ -42,6 +42,12 @@ virtDBusUtilGVariantToTypedParams(GVariantIter *iter,
void
virtDBusUtilSetLastVirtError(GError **error);
+gchar *
+virtDBusUtilEncodeStr(const gchar *str);
+
+gchar *
+virtDBusUtilDecodeStr(const gchar *str);
+
gchar *
virtDBusUtilBusPathForVirDomain(virDomainPtr domain,
const gchar *domainPath);
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5e224f8..4cae303 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,11 +3,31 @@ test_helpers = \
conftest.py
test_programs = \
+ $(check_PROGRAMS) \
test_connect.py \
test_domain.py \
test_network.py \
test_storage.py
+check_PROGRAMS = \
+ test_util
+
+test_util_SOURCES = \
+ test_util.c $(top_srcdir)/src/util.c
+test_util_CFLAGS = \
+ -I$(top_srcdir)/src \
+ $(GIO2_CFLAGS) \
+ $(GLIB2_CFLAGS) \
+ $(LIBVIRT_CFLAGS)
+test_util_LDFLAGS = \
+ $(GIO2_LDFLAGS) \
+ $(GLIB2_LDFLAGS) \
+ $(LIBVIRT_LDFLAGS)
+test_util_LDADD = \
+ $(GIO2_LIBS) \
+ $(GLIB2_LIBS) \
+ $(LIBVIRT_LIBS)
+
EXTRA_DIST = \
$(test_helpers) \
$(test_programs) \
diff --git a/tests/test_util.c b/tests/test_util.c
new file mode 100644
index 0000000..9611192
--- /dev/null
+++ b/tests/test_util.c
@@ -0,0 +1,47 @@
+#include "util.h"
+
+static gint
+virtTestEncodeStr(const gchar *input,
+ const gchar *expected)
+{
+ g_autofree gchar *encoded = virtDBusUtilEncodeStr(input);
+
+ if (!g_str_equal(encoded, expected)) {
+ g_printerr("encode failed: expected '%s' actual '%s'\n",
+ expected, encoded);
+ return -1;
+ }
+
+ return 0;
+}
+
+static gint
+virtTestDecodeStr(const gchar *input,
+ const gchar *expected)
+{
+ g_autofree gchar *decoded = virtDBusUtilDecodeStr(input);
+
+ if (!g_str_equal(decoded, expected)) {
+ g_printerr("decode failed: expected '%s' actual '%s'\n",
+ expected, decoded);
+ return -1;
+ }
+
+ return 0;
+}
+
+gint
+main(void)
+{
+#define TEST_ENCODE_DECODE(input, output) \
+ if (virtTestEncodeStr(input, output) < 0) \
+ return EXIT_FAILURE; \
+ if (virtTestDecodeStr(output, input) < 0) \
+ return EXIT_FAILURE;
+
+ TEST_ENCODE_DECODE("foobar", "foobar");
+ TEST_ENCODE_DECODE("_", "_5f");
+ TEST_ENCODE_DECODE("/path/to/some/file.img", "_2fpath_2fto_2fsome_2ffile_2eimg");
+
+ return EXIT_SUCCESS;
+}
--
2.17.1
6 years, 5 months
[libvirt] [PATCH v2] qemu: Fixing uninitialised variable inside virQEMUDriverConfigLoadFile.
by Julio Faracco
Since virConfGetValueBool() can return earlier, the parameter 'value'
might be not initialised properly inside this method. Another proof:
Valgrind is returning this error during the libvirtd daemon startup:
==16199== Conditional jump or move depends on uninitialised value(s)
==16199== at 0x27FFFEF4: virQEMUDriverConfigLoadFile (qemu_conf.c:809)
==16199== by 0x2807665C: qemuStateInitialize (qemu_driver.c:654)
==16199== by 0x5535428: virStateInitialize (libvirt.c:662)
==16199== by 0x12AED8: daemonRunStateInit (remote_daemon.c:802)
==16199== by 0x536DE18: virThreadHelper (virthread.c:206)
==16199== by 0x6CB36DA: start_thread (pthread_create.c:463)
==16199== by 0x6FEC88E: clone (clone.S:95)
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
src/qemu/qemu_conf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index f079ae3221..a4f545ef92 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -804,9 +804,9 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
goto cleanup;
if (virConfGetValueBool(conf, "clear_emulator_capabilities", &cfg->clearEmulatorCapabilities) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "allow_disk_format_probing", &tmp) < 0)
+ if ((rv = virConfGetValueBool(conf, "allow_disk_format_probing", &tmp)) < 0)
goto cleanup;
- if (tmp) {
+ if (rv == 1 && tmp) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("allow_disk_format_probing is no longer supported"));
goto cleanup;
--
2.17.1
6 years, 5 months
[libvirt] [jenkins-ci PATCH] guests: Drop Ubuntu 14.04 support
by Andrea Bolognani
We were only keeping it around so that we could generate
package lists to use on Travis CI, so now that (with commit
01c0179fbec0) libvirt has switched to building on newer
Ubuntu releases through Docker, we can finally drop it.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/host_vars/libvirt-ubuntu-14/install.yml | 3 ---
guests/host_vars/libvirt-ubuntu-14/main.yml | 10 ----------
guests/vars/mappings.yml | 11 +----------
3 files changed, 1 insertion(+), 23 deletions(-)
delete mode 100644 guests/host_vars/libvirt-ubuntu-14/install.yml
delete mode 100644 guests/host_vars/libvirt-ubuntu-14/main.yml
diff --git a/guests/host_vars/libvirt-ubuntu-14/install.yml b/guests/host_vars/libvirt-ubuntu-14/install.yml
deleted file mode 100644
index d7862a5..0000000
--- a/guests/host_vars/libvirt-ubuntu-14/install.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-install_url: http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/
-install_config: preseed.cfg
diff --git a/guests/host_vars/libvirt-ubuntu-14/main.yml b/guests/host_vars/libvirt-ubuntu-14/main.yml
deleted file mode 100644
index 839c668..0000000
--- a/guests/host_vars/libvirt-ubuntu-14/main.yml
+++ /dev/null
@@ -1,10 +0,0 @@
----
-projects:
- - libosinfo
- - libvirt
- - libvirt-perl
- - libvirt-python
- - libvirt-tck
- - osinfo-db
- - osinfo-db-tools
- - virt-viewer
diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index af026e1..ad19c30 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -9,7 +9,7 @@
# - default
# - package format (deb, pkg, rpm)
# - OS name (CentOS, Debian, Fedora, FreeBSD, Ubuntu)
-# - OS version (CentOS6, Debian9, FedoraRawhide, Ubuntu14 and so on)
+# - OS version (CentOS6, Debian9, FedoraRawhide, Ubuntu18 and so on)
#
# So something like
#
@@ -140,13 +140,11 @@ mappings:
deb: libgnutls28-dev
pkg: gnutls
rpm: gnutls-devel
- Ubuntu14: libgnutls-dev
go:
default: golang
FreeBSD: go
CentOS6:
- Ubuntu14:
gobject-introspection:
deb: libgirepository1.0-dev
@@ -167,7 +165,6 @@ mappings:
gtk-update-icon-cache:
default: gtk-update-icon-cache
Debian8: libgtk2.0-bin
- Ubuntu14: libgtk2.0-bin
Ubuntu16: libgtk2.0-bin
gtk-vnc2:
@@ -306,7 +303,6 @@ mappings:
libtool:
default: libtool
deb: libtool-bin
- Ubuntu14: libtool
libtoolize:
default: libtool
@@ -499,7 +495,6 @@ mappings:
default: numad
FreeBSD:
Debian8:
- Ubuntu14:
openwsman:
rpm: libwsman-devel
@@ -547,7 +542,6 @@ mappings:
pkg: p5-Digest-MD5
rpm: perl-Digest-MD5
CentOS6:
- Ubuntu14:
perl-File-Slurp:
deb: libfile-slurp-perl
@@ -611,7 +605,6 @@ mappings:
deb: libtime-hr-perl
pkg: p5-Time-HiRes
rpm: perl-Time-HiRes
- Ubuntu14: perl
perl-XML-Twig:
deb: libxml-twig-perl
@@ -686,7 +679,6 @@ mappings:
FreeBSD: py36-libxml2
CentOS:
Debian8:
- Ubuntu14:
Ubuntu16:
python3-lxml:
@@ -784,7 +776,6 @@ mappings:
deb: wireshark-dev
Fedora: wireshark-devel
Debian8:
- Ubuntu14:
xen:
deb: libxen-dev
--
2.17.1
6 years, 5 months