[libvirt] [PATCH] docs: Add missing <p> elements
by Andrea Bolognani
Some of the <li> elements in the "General tips for contributing
patches" section were missing the corresponding inner <p> element,
so they ended up all lumped together.
---
Pushed as trivial.
docs/hacking.html.in | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index 5f19143..13b3640 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -8,20 +8,26 @@
<h2><a name="patches">General tips for contributing patches</a></h2>
<ol>
- <li>Discuss any large changes on the mailing list first. Post patches
- early and listen to feedback.</li>
+ <li>
+ <p>Discuss any large changes on the mailing list first. Post patches
+ early and listen to feedback.</p>
+ </li>
- <li>Official upstream repository is kept in git
+ <li>
+ <p>Official upstream repository is kept in git
(<code>git://libvirt.org/libvirt.git</code>) and is browsable
along with other libvirt-related repositories
- (e.g. libvirt-python) <a href="http://libvirt.org/git/">online</a>.</li>
+ (e.g. libvirt-python) <a href="http://libvirt.org/git/">online</a>.</p>
+ </li>
- <li>Patches to translations are maintained via
+ <li>
+ <p>Patches to translations are maintained via
the <a href="https://fedora.zanata.org/">zanata project</a>.
If you want to fix a translation in a .po file, join the
appropriate language team. The libvirt release process
automatically pulls the latest version of each translation
- file from zanata.</li>
+ file from zanata.</p>
+ </li>
<li><p>Post patches using "git send-email", with git rename
detection enabled. You need a one-time setup of:</p>
@@ -98,8 +104,11 @@
of <code>git bisect</code>, among other things).</p>
</li>
- <li>Make sure your patches apply against libvirt GIT. Developers
- only follow GIT and don't care much about released versions.</li>
+ <li>
+ <p>Make sure your patches apply against libvirt GIT. Developers
+ only follow GIT and don't care much about released versions.</p>
+ </li>
+
<li><p>Run the automated tests on your code before submitting any changes.
In particular, configure with compile warnings set to
-Werror. This is done automatically for a git checkout; from a
--
2.7.4
7 years, 10 months
[libvirt] [PATCH] docs: fix list of domain states in virsh manpage
by Laine Stump
The virsh manpage lists "shutdown" and "dying" as two of the possible
domain states that could be listed in the output of the "virsh list"
command. However, a domain that is being shutdown will be listed as
"in shutdown", and the "dying" state doesn't even exist (and never
has, as far as I can tell from looking through git history - it was
shown in the original import of the virsh.pod file in 2006; there was
no VIR_DOMAIN_DYING state then, there wasn't one when those lines of
virsh.pod were tweaked in 2008, and there still isn't one
today. Apparently it was just something that sounded like a good idea
to someone at some time, but was never implemented...)
Resolves: https://bugzilla.redhat.com/1408778
---
tools/virsh.pod | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 940c646..73b3b09 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -440,7 +440,7 @@ running B<virsh suspend>. When in a paused state the domain will still
consume allocated resources like memory, but will not be eligible for
scheduling by the hypervisor.
-=item B<shutdown>
+=item B<in shutdown>
The domain is in the process of shutting down, i.e. the guest operating system
has been notified and should be in the process of stopping its operations
@@ -457,11 +457,6 @@ The domain has crashed, which is always a violent ending. Usually
this state can only occur if the domain has been configured not to
restart on crash.
-=item B<dying>
-
-The domain is in process of dying, but hasn't completely shutdown or
-crashed.
-
=item B<pmsuspended>
The domain has been suspended by guest power management, e.g. entered
--
2.7.4
7 years, 10 months
[libvirt] [PATCH] libxl: define a per-domain logger.
by Cédric Bosdonnat
libxl doesn't provide a way to write one log for each domain. Thus
we need to demux the messages. If our logger doesn't know to which
domain to attribute a message, then it will write it to the default
log file.
Starting with Xen 4.9 (commit f9858025 and following), libxl will
write the domain ID in an easy to grab manner. The logger introduced
by this commit will use it to demux the libxl log messages.
Thanks to the default log file, this logger will also work with older
versions of Xen.
---
src/Makefile.am | 1 +
src/libxl/libxl_conf.c | 38 +--------
src/libxl/libxl_conf.h | 4 +-
src/libxl/libxl_domain.c | 4 +
src/libxl/libxl_driver.c | 2 +
src/libxl/libxl_logger.c | 217 +++++++++++++++++++++++++++++++++++++++++++++++
src/libxl/libxl_logger.h | 39 +++++++++
7 files changed, 268 insertions(+), 37 deletions(-)
create mode 100644 src/libxl/libxl_logger.c
create mode 100644 src/libxl/libxl_logger.h
diff --git a/src/Makefile.am b/src/Makefile.am
index b71378728..e34d52345 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -851,6 +851,7 @@ LIBXL_DRIVER_SOURCES = \
libxl/libxl_capabilities.c libxl/libxl_capabilities.h \
libxl/libxl_domain.c libxl/libxl_domain.h \
libxl/libxl_driver.c libxl/libxl_driver.h \
+ libxl/libxl_logger.c libxl/libxl_logger.h \
libxl/libxl_migration.c libxl/libxl_migration.h
UML_DRIVER_SOURCES = \
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index b569ddad8..929179903 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -76,9 +76,7 @@ libxlDriverConfigDispose(void *obj)
virObjectUnref(cfg->caps);
libxl_ctx_free(cfg->ctx);
- xtl_logger_destroy(cfg->logger);
- if (cfg->logger_file)
- VIR_FORCE_FCLOSE(cfg->logger_file);
+ libxlLoggerFree(cfg->logger);
VIR_FREE(cfg->configDir);
VIR_FREE(cfg->autostartDir);
@@ -1356,8 +1354,6 @@ libxlDriverConfigPtr
libxlDriverConfigNew(void)
{
libxlDriverConfigPtr cfg;
- char *log_file = NULL;
- xentoollog_level log_level = XTL_DEBUG;
char ebuf[1024];
unsigned int free_mem;
@@ -1386,9 +1382,6 @@ libxlDriverConfigNew(void)
if (VIR_STRDUP(cfg->channelDir, LIBXL_CHANNEL_DIR) < 0)
goto error;
- if (virAsprintf(&log_file, "%s/libxl-driver.log", cfg->logDir) < 0)
- goto error;
-
if (virFileMakePath(cfg->logDir) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to create log dir '%s': %s"),
@@ -1397,37 +1390,13 @@ libxlDriverConfigNew(void)
goto error;
}
- if ((cfg->logger_file = fopen(log_file, "a")) == NULL) {
- VIR_ERROR(_("Failed to create log file '%s': %s"),
- log_file, virStrerror(errno, ebuf, sizeof(ebuf)));
- goto error;
- }
- VIR_FREE(log_file);
-
- switch (virLogGetDefaultPriority()) {
- case VIR_LOG_DEBUG:
- log_level = XTL_DEBUG;
- break;
- case VIR_LOG_INFO:
- log_level = XTL_INFO;
- break;
- case VIR_LOG_WARN:
- log_level = XTL_WARN;
- break;
- case VIR_LOG_ERROR:
- log_level = XTL_ERROR;
- break;
- }
-
- cfg->logger =
- (xentoollog_logger *)xtl_createlogger_stdiostream(cfg->logger_file,
- log_level, XTL_STDIOSTREAM_SHOW_DATE);
+ cfg->logger = libxlLoggerNew(cfg->logDir, virLogGetDefaultPriority());
if (!cfg->logger) {
VIR_ERROR(_("cannot create logger for libxenlight, disabling driver"));
goto error;
}
- if (libxl_ctx_alloc(&cfg->ctx, LIBXL_VERSION, 0, cfg->logger)) {
+ if (libxl_ctx_alloc(&cfg->ctx, LIBXL_VERSION, 0, (void*)cfg->logger)) {
VIR_ERROR(_("cannot initialize libxenlight context, probably not "
"running in a Xen Dom0, disabling driver"));
goto error;
@@ -1478,7 +1447,6 @@ libxlDriverConfigNew(void)
return cfg;
error:
- VIR_FREE(log_file);
virObjectUnref(cfg);
return NULL;
}
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index 851f3afb4..69d78851a 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -41,6 +41,7 @@
# include "locking/lock_manager.h"
# include "virfirmware.h"
# include "libxl_capabilities.h"
+# include "libxl_logger.h"
# define LIBXL_DRIVER_NAME "xenlight"
# define LIBXL_VNC_PORT_MIN 5900
@@ -74,8 +75,7 @@ struct _libxlDriverConfig {
unsigned int version;
/* log stream for driver-wide libxl ctx */
- FILE *logger_file;
- xentoollog_logger *logger;
+ libxlLoggerPtr logger;
/* libxl ctx for driver wide ops; getVersion, getNodeInfo, ... */
libxl_ctx *ctx;
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 5cde576ef..3bc468f61 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -809,6 +809,8 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
VIR_FREE(xml);
}
+ libxlLoggerCloseFile(cfg->logger, vm->def->id);
+
virDomainObjRemoveTransientDef(vm);
virObjectUnref(cfg);
}
@@ -1291,6 +1293,8 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
*/
vm->def->id = domid;
+ libxlLoggerOpenFile(cfg->logger, domid, vm->def->name);
+
/* Always enable domain death events */
if (libxl_evenable_domain_death(cfg->ctx, vm->def->id, 0, &priv->deathW))
goto destroy_dom;
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 7e5d9b69e..6a4ecddef 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -406,6 +406,8 @@ libxlReconnectDomain(virDomainObjPtr vm,
/* Update domid in case it changed (e.g. reboot) while we were gone? */
vm->def->id = d_info.domid;
+ libxlLoggerOpenFile(cfg->logger, vm->def->id, vm->def->name);
+
/* Update hostdev state */
if (virHostdevUpdateActiveDomainDevices(hostdev_mgr, LIBXL_DRIVER_NAME,
vm->def, hostdev_flags) < 0)
diff --git a/src/libxl/libxl_logger.c b/src/libxl/libxl_logger.c
new file mode 100644
index 000000000..31110d0fd
--- /dev/null
+++ b/src/libxl/libxl_logger.c
@@ -0,0 +1,217 @@
+/*
+ * libxl_logger.c: libxl logger implementation
+ *
+ * Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Cédric Bosdonnat <cbosdonnat(a)suse.com>
+ */
+#include <config.h>
+
+#include <string.h>
+#include <libxl.h>
+
+#include "internal.h"
+#include "libxl_logger.h"
+#include "util/viralloc.h"
+#include "util/virerror.h"
+#include "util/virfile.h"
+#include "util/virhash.h"
+#include "util/virstring.h"
+#include "util/virtime.h"
+
+#define VIR_FROM_THIS VIR_FROM_LIBXL
+
+VIR_LOG_INIT("libxl.libxl_logger");
+
+typedef struct xentoollog_logger_libvirt xentoollog_logger_libvirt;
+
+struct xentoollog_logger_libvirt {
+ xentoollog_logger vtable;
+ xentoollog_level minLevel;
+ const char *logDir;
+
+ /* map storing the opened fds: "domid" -> FILE* */
+ virHashTablePtr files;
+ FILE *defaultLogFile;
+};
+
+static void
+libxlLoggerFileFree(void *payload, const void *key ATTRIBUTE_UNUSED)
+{
+ FILE *file = payload;
+ VIR_FORCE_FCLOSE(file);
+ file = NULL;
+}
+
+ATTRIBUTE_FMT_PRINTF(5, 0) static void
+libvirt_vmessage(xentoollog_logger *logger_in,
+ xentoollog_level level,
+ int errnoval,
+ const char *context,
+ const char *format,
+ va_list args)
+{
+ xentoollog_logger_libvirt *lg = (void*)logger_in;
+ FILE *logFile = lg->defaultLogFile;
+ char timestamp[VIR_TIME_STRING_BUFLEN];
+ char *message = NULL;
+ char *start, *end;
+ char ebuf[1024];
+
+ VIR_DEBUG("libvirt_vmessage: context='%s' format='%s'", context, format);
+
+ if (level < lg->minLevel)
+ return;
+
+ if (virVasprintf(&message, format, args) < 0)
+ return;
+
+ /* Should we print to a domain-specific log file? */
+ if ((start = strstr(message, ": Domain ")) &&
+ (end = strstr(start + 9, ":"))) {
+ FILE *domainLogFile;
+
+ VIR_DEBUG("Found domain log message");
+
+ start = start + 9;
+ *end = '\0';
+
+ domainLogFile = virHashLookup(lg->files, start);
+ if (domainLogFile)
+ logFile = domainLogFile;
+
+ *end = ':';
+ }
+
+ /* Do the actual print to the log file */
+ if (virTimeStringNowRaw(timestamp) < 0)
+ timestamp[0] = '\0';
+
+ fprintf(logFile, "%s: ", timestamp);
+ if (context)
+ fprintf(logFile, "%s: ", context);
+
+ fprintf(logFile, "%s", message);
+
+ if (errnoval >= 0)
+ fprintf(logFile, ": %s", virStrerror(errnoval, ebuf, sizeof(ebuf)));
+
+ fputc('\n', logFile);
+ fflush(logFile);
+
+ VIR_FREE(message);
+}
+
+static void
+libvirt_progress(xentoollog_logger *logger_in ATTRIBUTE_UNUSED,
+ const char *context ATTRIBUTE_UNUSED,
+ const char *doingwhat ATTRIBUTE_UNUSED,
+ int percent ATTRIBUTE_UNUSED,
+ unsigned long done ATTRIBUTE_UNUSED,
+ unsigned long total ATTRIBUTE_UNUSED)
+{
+ /* This function purposedly does nothing: it's no logging info */
+}
+
+static void
+libvirt_destroy(xentoollog_logger *logger_in)
+{
+ xentoollog_logger_libvirt *lg = (void*)logger_in;
+ VIR_FREE(lg);
+}
+
+
+libxlLoggerPtr libxlLoggerNew(const char *logDir,
+ virLogPriority minLevel)
+{
+ xentoollog_logger_libvirt logger;
+ libxlLoggerPtr logger_out = NULL;
+ char *path = NULL;
+
+ switch (minLevel) {
+ case VIR_LOG_DEBUG:
+ logger.minLevel = XTL_DEBUG;
+ break;
+ case VIR_LOG_INFO:
+ logger.minLevel = XTL_INFO;
+ break;
+ case VIR_LOG_WARN:
+ logger.minLevel = XTL_WARN;
+ break;
+ case VIR_LOG_ERROR:
+ logger.minLevel = XTL_ERROR;
+ break;
+ }
+ logger.logDir = logDir;
+
+ if ((logger.files = virHashCreate(3, libxlLoggerFileFree)) == NULL)
+ return NULL;
+
+ if (virAsprintf(&path, "%s/libxl-driver.log", logDir) < 0)
+ goto error;
+
+ if ((logger.defaultLogFile = fopen(path, "a")) == NULL)
+ goto error;
+
+ logger_out = XTL_NEW_LOGGER(libvirt, logger);
+
+ cleanup:
+ VIR_FREE(path);
+ return logger_out;
+
+ error:
+ virHashFree(logger.files);
+ goto cleanup;
+}
+
+void libxlLoggerFree(libxlLoggerPtr logger)
+{
+ xentoollog_logger *xtl_logger = (void*)logger;
+ if (logger->defaultLogFile)
+ VIR_FORCE_FCLOSE(logger->defaultLogFile);
+ virHashFree(logger->files);
+ xtl_logger_destroy(xtl_logger);
+}
+
+void libxlLoggerOpenFile(libxlLoggerPtr logger, int id, const char *name)
+{
+ char *path = NULL;
+ FILE *logFile = NULL;
+ char *domidstr = NULL;
+
+ if (virAsprintf(&path, "%s/%s.log", logger->logDir, name) < 0 ||
+ virAsprintf(&domidstr, "%d", id) < 0)
+ return;
+
+ logFile = fopen(path, "a");
+ ignore_value(virHashAddEntry(logger->files, domidstr, logFile));
+
+ VIR_FREE(path);
+ VIR_FREE(domidstr);
+}
+
+void libxlLoggerCloseFile(libxlLoggerPtr logger, int id)
+{
+ char *domidstr = NULL;
+ if (virAsprintf(&domidstr, "%d", id) < 0)
+ return;
+
+ ignore_value(virHashRemoveEntry(logger->files, domidstr));
+
+ VIR_FREE(domidstr);
+}
diff --git a/src/libxl/libxl_logger.h b/src/libxl/libxl_logger.h
new file mode 100644
index 000000000..88c2868eb
--- /dev/null
+++ b/src/libxl/libxl_logger.h
@@ -0,0 +1,39 @@
+/*
+ * libxl_logger.h: libxl logger implementation
+ *
+ * Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Cédric Bosdonnat <cbosdonnat(a)suse.com>
+ */
+
+#ifndef __LIBXL_LOGGER_H
+# define __LIBXL_LOGGER_H
+
+# include "util/virlog.h"
+
+typedef struct xentoollog_logger_libvirt libxlLogger;
+typedef libxlLogger *libxlLoggerPtr;
+
+libxlLoggerPtr libxlLoggerNew(const char *logDir,
+ virLogPriority minLevel);
+void libxlLoggerFree(libxlLoggerPtr logger);
+
+void libxlLoggerOpenFile(libxlLoggerPtr logger, int id, const char *name);
+void libxlLoggerCloseFile(libxlLoggerPtr logger, int id);
+
+#endif /* __LIBXL_LOGGER_H */
--
2.11.0
7 years, 10 months
[libvirt] [PATCH 00/11] Allow creation of vHBA by parent_wwnn/wwpn or fabric_name
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1349696
Lots of details in the bz, but essentially the problem is that providing
a "parent" scsi_hostX value has drawbacks on reboots because what was
scsi_hostX could turn into scsi_hostY on subsequent reboots.
So add the ability to use the parent wwnn/wwpn or fabric_wwn as 'search'
criteria in order to create either non persistent vHBA's via nodedev or
persistent vHBA's via storage pools.
NB: Documentation of this "process" is on the wiki:
http://wiki.libvirt.org/page/NPIV_in_libvirt
and would need to be adjusted once/if the changes are accepted.
John Ferlan (11):
nodedev: Fix crash in libvirtd on vHBA creation path
nodedev: Create helpers to search for vport capable nodedevs
nodedev: Add ability to find a vport capable vHBA
nodedev: Add the ability to create vHBA by parent wwnn/wwpn or
fabric_wwn
conf: Add more fchost search fields for storage pool vHBA creation
iscsi: Clean up createVport exit paths
iscsi: Change order of checks in createVport
iscsi: Converge more createVport checks
util: Remove need for extra VIR_FREE's in virGetFCHostNameByWWN
util: Introduce virGetFCHostNameByFabricWWN
iscsi: Add parent wwnn/wwpn or fabric capability for createVport
docs/schemas/basictypes.rng | 15 +++
docs/schemas/nodedev.rng | 15 +++
src/conf/node_device_conf.c | 234 +++++++++++++++++++++++++++++++----
src/conf/node_device_conf.h | 17 +++
src/conf/storage_conf.c | 21 +++-
src/conf/storage_conf.h | 3 +
src/libvirt_private.syms | 4 +
src/node_device/node_device_driver.c | 28 ++++-
src/storage/storage_backend_scsi.c | 86 +++++++------
src/util/virutil.c | 113 ++++++++++++-----
src/util/virutil.h | 4 +
11 files changed, 439 insertions(+), 101 deletions(-)
--
2.7.4
7 years, 10 months
[libvirt] [PATCH] qemu: Don't assume secret provided for LUKS encryption
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1405269
If a secret was not provided for what was determined to be a LUKS
encrypted disk (during virStorageFileGetMetadata processing when
called from qemuDomainDetermineDiskChain as a result of hotplug
attach qemuDomainAttachDeviceDiskLive), then do not attempt to
look it up (avoiding a libvirtd crash) and do not alter the format
to "luks" when adding the disk; otherwise, the device_add would
fail with a message such as:
"unable to execute QEMU command 'device_add': Property 'scsi-hd.drive'
can't find value 'drive-scsi0-0-0-0'"
because of assumptions that when the format=luks that libvirt would have
provided the secret to decrypt the volume.
Access to unlock the volume will thus be left to the application.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
I could have spread things over 2 patches (one to create the helper
and one to add the extra check for nsecrets > 0), but just going with
one to fix the issue just felt cleaner (besides makes any possible
backports a bit simpler).
NB: The "extra" !virStorageSourceIsEmpty check for the qemu_command
path is a no-op essentially.
src/qemu/qemu_command.c | 3 +--
src/qemu/qemu_domain.c | 15 +++++++++++++--
src/qemu/qemu_domain.h | 3 +++
src/qemu/qemu_hotplug.c | 3 ++-
4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f8e48d2..28d8146 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1442,8 +1442,7 @@ qemuBuildDriveSourceStr(virDomainDiskDefPtr disk,
if (disk->src->format > 0 &&
disk->src->type != VIR_STORAGE_TYPE_DIR) {
const char *qemuformat = virStorageFileFormatTypeToString(disk->src->format);
- if (disk->src->encryption &&
- disk->src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS)
+ if (qemuDomainDiskHasEncryptionSecret(disk->src))
qemuformat = "luks";
virBufferAsprintf(buf, "format=%s,", qemuformat);
}
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index acfa695..25cb4ad 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1174,6 +1174,18 @@ qemuDomainSecretDiskCapable(virStorageSourcePtr src)
}
+bool
+qemuDomainDiskHasEncryptionSecret(virStorageSourcePtr src)
+{
+ if (!virStorageSourceIsEmpty(src) && src->encryption &&
+ src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS &&
+ src->encryption->nsecrets > 0)
+ return true;
+
+ return false;
+}
+
+
/* qemuDomainSecretDiskPrepare:
* @conn: Pointer to connection
* @priv: pointer to domain private object
@@ -1209,8 +1221,7 @@ qemuDomainSecretDiskPrepare(virConnectPtr conn,
diskPriv->secinfo = secinfo;
}
- if (!virStorageSourceIsEmpty(src) && src->encryption &&
- src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
+ if (qemuDomainDiskHasEncryptionSecret(src)) {
if (VIR_ALLOC(secinfo) < 0)
return -1;
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index b2db45e..cce879f 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -734,6 +734,9 @@ void qemuDomainSecretDiskDestroy(virDomainDiskDefPtr disk)
bool qemuDomainSecretDiskCapable(virStorageSourcePtr src)
ATTRIBUTE_NONNULL(1);
+bool qemuDomainDiskHasEncryptionSecret(virStorageSourcePtr src)
+ ATTRIBUTE_NONNULL(1);
+
int qemuDomainSecretDiskPrepare(virConnectPtr conn,
qemuDomainObjPrivatePtr priv,
virDomainDiskDefPtr disk)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 92a2e73..6b10e63 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3584,7 +3584,8 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
* can remove the luks object password too
*/
if (!virStorageSourceIsEmpty(disk->src) && disk->src->encryption &&
- disk->src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
+ disk->src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS &&
+ disk->src->encryption->nsecrets > 0) {
if (!(encAlias =
qemuDomainGetSecretAESAlias(disk->info.alias, true))) {
--
2.7.4
7 years, 10 months
[libvirt] [PATCH jenkins-ci v2] Add libvirt-go-xml job
by Daniel P. Berrange
Add a job for building the libvirt-go-xml library code
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
Changed in v2:
- Actually committed all changes
projects/libvirt-go-xml.yaml | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 projects/libvirt-go-xml.yaml
diff --git a/projects/libvirt-go-xml.yaml b/projects/libvirt-go-xml.yaml
new file mode 100644
index 0000000..b3b316b
--- /dev/null
+++ b/projects/libvirt-go-xml.yaml
@@ -0,0 +1,13 @@
+
+- project:
+ name: libvirt-go-xml
+ machines:
+ - libvirt-centos-7
+ - libvirt-fedora-23
+ - libvirt-fedora-24
+ - libvirt-fedora-rawhide
+ title: Libvirt Go XML
+ jobs:
+ - go-build-job:
+ - go-check-job:
+ parent_jobs: 'libvirt-go-xml-master-build'
--
2.9.3
7 years, 10 months
[libvirt] [PATCH jenkins-ci] Add libvirt-go-xml job
by Daniel P. Berrange
Add a job for building the libvirt-go-xml library code
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
projects/libvirt-go-xml.yaml | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 projects/libvirt-go-xml.yaml
diff --git a/projects/libvirt-go-xml.yaml b/projects/libvirt-go-xml.yaml
new file mode 100644
index 0000000..3f73505
--- /dev/null
+++ b/projects/libvirt-go-xml.yaml
@@ -0,0 +1,13 @@
+
+- project:
+ name: libvirt-go-xml
+ machines:
+ - libvirt-centos-7
+ - libvirt-fedora-23
+ - libvirt-fedora-24
+ - libvirt-fedora-rawhide
+ title: Libvirt Go
+ jobs:
+ - go-build-job:
+ - go-check-job:
+ parent_jobs: 'libvirt-go-xml-master-build'
--
2.9.3
7 years, 10 months
[libvirt] [PATCH 0/3] Fix networkxml2conftest on FreeBSD
by Martin Kletzander
Yet another approach. If you hate it, we still have this:
https://www.redhat.com/archives/libvir-list/2016-December/msg01123.html
as an option.
Martin Kletzander (3):
networkxml2conftest: Rename outxml to outconf
networkxml2conftest: Indent function parameters properly
networkxml2conftest: Fix build on BSD
tests/networkxml2confdata/dhcp6-nat-network.conf | 2 +-
tests/networkxml2confdata/dhcp6-network.conf | 2 +-
.../dhcp6host-routed-network.conf | 2 +-
tests/networkxml2confdata/isolated-network.conf | 2 +-
.../nat-network-dns-forward-plain.conf | 2 +-
.../nat-network-dns-forwarders.conf | 2 +-
.../networkxml2confdata/nat-network-dns-hosts.conf | 2 +-
.../nat-network-dns-local-domain.conf | 2 +-
.../nat-network-dns-srv-record-minimal.conf | 2 +-
.../nat-network-dns-srv-record.conf | 2 +-
.../nat-network-dns-txt-record.conf | 2 +-
.../nat-network-name-with-quotes.conf | 2 +-
tests/networkxml2confdata/nat-network.conf | 2 +-
tests/networkxml2confdata/netboot-network.conf | 2 +-
.../networkxml2confdata/netboot-proxy-network.conf | 2 +-
tests/networkxml2confdata/open-network.conf | 2 +-
tests/networkxml2confdata/ptr-domains-auto.conf | 2 +-
.../networkxml2confdata/routed-network-no-dns.conf | 2 +-
tests/networkxml2confdata/routed-network.conf | 2 +-
tests/networkxml2conftest.c | 51 +++++++++++++++++++---
20 files changed, 63 insertions(+), 26 deletions(-)
--
2.11.0
7 years, 10 months
[libvirt] [PATCH 0/9] Couple of *BSD fixes
by Michal Privoznik
After Andrea pointed out that FreeBSD build is broken [1], I've
started my freebsd domain and found out couple of problems. Here
are the fixes.
Oh, I've noticed alternative approaches to patch 6/9 on the list
[2] [3]. None of them have been ACKed though. Yet.
1: https://www.redhat.com/archives/libvir-list/2016-December/msg01121.html
2: https://www.redhat.com/archives/libvir-list/2016-December/msg00009.html
3: https://www.redhat.com/archives/libvir-list/2016-December/msg01123.html
Michal Privoznik (9):
tests: Run virmacmaptest iff WITH_YAJL
tests: Move test_libraries a bit higher
virt-nss: Introduce more checks before enabling NSS
tests: Run nss*test iff WITH_NSS
src: Build libvirt_nss.la iff WITH_NSS
networkxml2conftest: s/lo/lo0/ on non-Linux
bhyvexml2argvdata: Fix <drive/> addresses
bhyvexml2argvdata: Add mac address to <interface/>
bhyvexml2xmltest: Test more XMLs
configure.ac | 2 +-
m4/virt-nss.m4 | 36 +++++++---
src/Makefile.am | 2 +
tests/Makefile.am | 77 +++++++++++-----------
.../bhyvexml2argvdata/bhyvexml2argv-acpiapic.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.xml | 3 +-
tests/bhyvexml2argvdata/bhyvexml2argv-base.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-base.xml | 3 +-
.../bhyvexml2argv-bhyveload-bootorder.args | 2 +-
.../bhyvexml2argv-bhyveload-bootorder.xml | 5 +-
.../bhyvexml2argv-bhyveload-bootorder1.args | 2 +-
.../bhyvexml2argv-bhyveload-bootorder1.xml | 5 +-
.../bhyvexml2argv-bhyveload-bootorder2.xml | 3 +-
.../bhyvexml2argv-bhyveload-bootorder3.args | 2 +-
.../bhyvexml2argv-bhyveload-bootorder3.xml | 5 +-
.../bhyvexml2argv-bhyveload-bootorder4.xml | 5 +-
.../bhyvexml2argv-bhyveload-explicitargs.args | 2 +-
.../bhyvexml2argv-bhyveload-explicitargs.xml | 3 +-
tests/bhyvexml2argvdata/bhyvexml2argv-console.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-console.xml | 3 +-
.../bhyvexml2argv-custom-loader.args | 2 +-
.../bhyvexml2argv-custom-loader.xml | 3 +-
.../bhyvexml2argv-disk-cdrom-grub.args | 2 +-
.../bhyvexml2argv-disk-cdrom-grub.xml | 3 +-
.../bhyvexml2argv-disk-cdrom.args | 2 +-
.../bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.xml | 3 +-
.../bhyvexml2argv-disk-virtio.args | 2 +-
.../bhyvexml2argv-disk-virtio.xml | 1 +
.../bhyvexml2argv-grub-bootorder.args | 6 +-
.../bhyvexml2argv-grub-bootorder.xml | 7 +-
.../bhyvexml2argv-grub-bootorder2.args | 6 +-
.../bhyvexml2argv-grub-bootorder2.xml | 7 +-
.../bhyvexml2argv-grub-defaults.args | 2 +-
.../bhyvexml2argv-grub-defaults.xml | 3 +-
.../bhyvexml2argvdata/bhyvexml2argv-localtime.args | 2 +-
.../bhyvexml2argvdata/bhyvexml2argv-localtime.xml | 3 +-
tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.xml | 2 +-
.../bhyvexml2argv-serial-grub-nocons.args | 2 +-
.../bhyvexml2argv-serial-grub-nocons.xml | 3 +-
.../bhyvexml2argv-serial-grub.args | 2 +-
.../bhyvexml2argv-serial-grub.xml | 3 +-
tests/bhyvexml2argvdata/bhyvexml2argv-serial.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-serial.xml | 3 +-
.../bhyvexml2xmlout-acpiapic.xml | 34 ++++++++++
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml | 30 +++++++++
.../bhyvexml2xmlout-bhyveload-bootorder.xml | 37 +++++++++++
.../bhyvexml2xmlout-bhyveload-bootorder1.xml | 37 +++++++++++
.../bhyvexml2xmlout-bhyveload-bootorder2.xml | 30 +++++++++
.../bhyvexml2xmlout-bhyveload-bootorder3.xml | 37 +++++++++++
.../bhyvexml2xmlout-bhyveload-bootorder4.xml | 38 +++++++++++
.../bhyvexml2xmlout-bhyveload-explicitargs.xml | 30 +++++++++
.../bhyvexml2xmlout-console.xml | 38 +++++++++++
.../bhyvexml2xmlout-custom-loader.xml | 31 +++++++++
.../bhyvexml2xmlout-disk-cdrom-grub.xml | 31 +++++++++
.../bhyvexml2xmlout-disk-cdrom.xml | 31 +++++++++
.../bhyvexml2xmlout-disk-virtio.xml | 29 ++++++++
.../bhyvexml2xmlout-grub-bootorder.xml | 43 ++++++++++++
.../bhyvexml2xmlout-grub-bootorder2.xml | 45 +++++++++++++
.../bhyvexml2xmlout-grub-defaults.xml | 30 +++++++++
.../bhyvexml2xmlout-localtime.xml | 30 +++++++++
.../bhyvexml2xmlout-macaddr.xml | 30 +++++++++
.../bhyvexml2xmlout-serial-grub-nocons.xml | 38 +++++++++++
.../bhyvexml2xmlout-serial-grub.xml | 38 +++++++++++
.../bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml | 38 +++++++++++
tests/bhyvexml2xmltest.c | 21 ++++++
tests/networkxml2conftest.c | 15 ++++-
66 files changed, 896 insertions(+), 102 deletions(-)
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-acpiapic.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder1.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder2.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder3.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder4.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-explicitargs.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-custom-loader.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom-grub.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-virtio.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder2.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-defaults.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-localtime.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-macaddr.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml
--
2.11.0
7 years, 10 months
[libvirt] [PATCH] maint: Sync bootstrap after gnulib update
by Andrea Bolognani
7fa7fe22d844 updated gnulib to the latest upstream commit,
but forgot to include the corresponding bootstrap changes.
---
Pushed under the gnulib rule.
bootstrap | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bootstrap b/bootstrap
index 5d3c289..26066b2 100755
--- a/bootstrap
+++ b/bootstrap
@@ -4,7 +4,7 @@ scriptversion=2016-11-03.18; # UTC
# Bootstrap this package from checked-out sources.
-# Copyright (C) 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
--
2.7.4
7 years, 10 months