[libvirt] [PATCH] util: Create virsecret module adding virSecretGetSecretString
by John Ferlan
Commit id 'fb2bd208' essentially copied the qemuGetSecretString
creating an libxlGetSecretString. Rather than have multiple copies
of the same code, create virsecret.{c,h} files and place the common
function in there.
Usage is from both qemu_command.c and libxl_conf.c
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Not for 1.3.3, but I may as well get it "out there" now...
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/libvirt_private.syms | 3 ++
src/libxl/libxl_conf.c | 82 +++-----------------------------
src/qemu/qemu_command.c | 87 ++++------------------------------
src/util/virsecret.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++
src/util/virsecret.h | 35 ++++++++++++++
7 files changed, 174 insertions(+), 155 deletions(-)
create mode 100644 src/util/virsecret.c
create mode 100644 src/util/virsecret.h
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0d7f9f9..e3b8468 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -229,6 +229,7 @@ src/util/virportallocator.c
src/util/virprocess.c
src/util/virrandom.c
src/util/virrotatingfile.c
+src/util/virsecret.c
src/util/virsexpr.c
src/util/virscsi.c
src/util/virsocketaddr.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 1726d06..4783f40 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -156,6 +156,7 @@ UTIL_SOURCES = \
util/virrotatingfile.h util/virrotatingfile.c \
util/virscsi.c util/virscsi.h \
util/virseclabel.c util/virseclabel.h \
+ util/virsecret.c util/virsecret.h \
util/virsexpr.c util/virsexpr.h \
util/virsocketaddr.h util/virsocketaddr.c \
util/virstats.c util/virstats.h \
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 684f06c..fe3d132 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2142,6 +2142,9 @@ virSecurityLabelDefFree;
virSecurityLabelDefNew;
+# util/virsecret.h
+virSecretGetSecretString;
+
# util/virsexpr.h
sexpr2string;
sexpr_append;
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 82ba417..db26511 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -46,7 +46,7 @@
#include "libxl_conf.h"
#include "libxl_utils.h"
#include "virstoragefile.h"
-#include "base64.h"
+#include "virsecret.h"
#define VIR_FROM_THIS VIR_FROM_LIBXL
@@ -935,76 +935,6 @@ libxlDomainGetEmulatorType(const virDomainDef *def)
return ret;
}
-static char *
-libxlGetSecretString(virConnectPtr conn,
- const char *scheme,
- bool encoded,
- virStorageAuthDefPtr authdef,
- virSecretUsageType secretUsageType)
-{
- size_t secret_size;
- virSecretPtr sec = NULL;
- char *secret = NULL;
- char uuidStr[VIR_UUID_STRING_BUFLEN];
-
- /* look up secret */
- switch (authdef->secretType) {
- case VIR_STORAGE_SECRET_TYPE_UUID:
- sec = virSecretLookupByUUID(conn, authdef->secret.uuid);
- virUUIDFormat(authdef->secret.uuid, uuidStr);
- break;
- case VIR_STORAGE_SECRET_TYPE_USAGE:
- sec = virSecretLookupByUsage(conn, secretUsageType,
- authdef->secret.usage);
- break;
- }
-
- if (!sec) {
- if (authdef->secretType == VIR_STORAGE_SECRET_TYPE_UUID) {
- virReportError(VIR_ERR_NO_SECRET,
- _("%s no secret matches uuid '%s'"),
- scheme, uuidStr);
- } else {
- virReportError(VIR_ERR_NO_SECRET,
- _("%s no secret matches usage value '%s'"),
- scheme, authdef->secret.usage);
- }
- goto cleanup;
- }
-
- secret = (char *)conn->secretDriver->secretGetValue(sec, &secret_size, 0,
- VIR_SECRET_GET_VALUE_INTERNAL_CALL);
- if (!secret) {
- if (authdef->secretType == VIR_STORAGE_SECRET_TYPE_UUID) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get value of the secret for "
- "username '%s' using uuid '%s'"),
- authdef->username, uuidStr);
- } else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get value of the secret for "
- "username '%s' using usage value '%s'"),
- authdef->username, authdef->secret.usage);
- }
- goto cleanup;
- }
-
- if (encoded) {
- char *base64 = NULL;
-
- base64_encode_alloc(secret, secret_size, &base64);
- VIR_FREE(secret);
- if (!base64) {
- virReportOOMError();
- goto cleanup;
- }
- secret = base64;
- }
-
- cleanup:
- virObjectUnref(sec);
- return secret;
-}
static char *
libxlMakeNetworkDiskSrcStr(virStorageSourcePtr src,
@@ -1100,11 +1030,11 @@ libxlMakeNetworkDiskSrc(virStorageSourcePtr src, char **srcstr)
if (!(conn = virConnectOpen("xen:///system")))
goto cleanup;
- if (!(secret = libxlGetSecretString(conn,
- protocol,
- true,
- src->auth,
- VIR_SECRET_USAGE_TYPE_CEPH)))
+ if (!(secret = virSecretGetSecretString(conn,
+ protocol,
+ true,
+ src->auth,
+ VIR_SECRET_USAGE_TYPE_CEPH)))
goto cleanup;
}
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 2d0ca97..20a5ea4 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -50,7 +50,7 @@
#include "secret_conf.h"
#include "network/bridge_driver.h"
#include "virnetdevtap.h"
-#include "base64.h"
+#include "virsecret.h"
#include "device_conf.h"
#include "virstoragefile.h"
#include "virtpm.h"
@@ -487,77 +487,6 @@ qemuSafeSerialParamValue(const char *value)
return 0;
}
-static char *
-qemuGetSecretString(virConnectPtr conn,
- const char *scheme,
- bool encoded,
- virStorageAuthDefPtr authdef,
- virSecretUsageType secretUsageType)
-{
- size_t secret_size;
- virSecretPtr sec = NULL;
- char *secret = NULL;
- char uuidStr[VIR_UUID_STRING_BUFLEN];
-
- /* look up secret */
- switch (authdef->secretType) {
- case VIR_STORAGE_SECRET_TYPE_UUID:
- sec = virSecretLookupByUUID(conn, authdef->secret.uuid);
- virUUIDFormat(authdef->secret.uuid, uuidStr);
- break;
- case VIR_STORAGE_SECRET_TYPE_USAGE:
- sec = virSecretLookupByUsage(conn, secretUsageType,
- authdef->secret.usage);
- break;
- }
-
- if (!sec) {
- if (authdef->secretType == VIR_STORAGE_SECRET_TYPE_UUID) {
- virReportError(VIR_ERR_NO_SECRET,
- _("%s no secret matches uuid '%s'"),
- scheme, uuidStr);
- } else {
- virReportError(VIR_ERR_NO_SECRET,
- _("%s no secret matches usage value '%s'"),
- scheme, authdef->secret.usage);
- }
- goto cleanup;
- }
-
- secret = (char *)conn->secretDriver->secretGetValue(sec, &secret_size, 0,
- VIR_SECRET_GET_VALUE_INTERNAL_CALL);
- if (!secret) {
- if (authdef->secretType == VIR_STORAGE_SECRET_TYPE_UUID) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get value of the secret for "
- "username '%s' using uuid '%s'"),
- authdef->username, uuidStr);
- } else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get value of the secret for "
- "username '%s' using usage value '%s'"),
- authdef->username, authdef->secret.usage);
- }
- goto cleanup;
- }
-
- if (encoded) {
- char *base64 = NULL;
-
- base64_encode_alloc(secret, secret_size, &base64);
- VIR_FREE(secret);
- if (!base64) {
- virReportOOMError();
- goto cleanup;
- }
- secret = base64;
- }
-
- cleanup:
- virObjectUnref(sec);
- return secret;
-}
-
static int
qemuNetworkDriveGetPort(int protocol,
@@ -868,11 +797,11 @@ qemuGetDriveSourceString(virStorageSourcePtr src,
secretType = VIR_SECRET_USAGE_TYPE_CEPH;
}
- if (!(secret = qemuGetSecretString(conn,
- protocol,
- encode,
- src->auth,
- secretType)))
+ if (!(secret = virSecretGetSecretString(conn,
+ protocol,
+ encode,
+ src->auth,
+ secretType)))
goto cleanup;
}
}
@@ -4458,8 +4387,8 @@ qemuBuildSCSIiSCSIHostdevDrvStr(virConnectPtr conn,
int secretType = VIR_SECRET_USAGE_TYPE_ISCSI;
username = iscsisrc->auth->username;
- if (!(secret = qemuGetSecretString(conn, protocol, encode,
- iscsisrc->auth, secretType)))
+ if (!(secret = virSecretGetSecretString(conn, protocol, encode,
+ iscsisrc->auth, secretType)))
goto cleanup;
}
diff --git a/src/util/virsecret.c b/src/util/virsecret.c
new file mode 100644
index 0000000..07c052a
--- /dev/null
+++ b/src/util/virsecret.c
@@ -0,0 +1,120 @@
+/*
+ * virsecret.c: secret related utility functions
+ *
+ * Copyright (C) 2016 Red Hat, Inc.
+ *
+ * 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/>.
+ *
+ */
+
+#include <config.h>
+
+#include "virsecret.h"
+#include "viralloc.h"
+#include "virerror.h"
+#include "virlog.h"
+#include "virobject.h"
+#include "viruuid.h"
+#include "base64.h"
+#include "datatypes.h"
+
+#define VIR_FROM_THIS VIR_FROM_SECRET
+
+VIR_LOG_INIT("util.secret");
+
+
+/* virSecretGetSecretString:
+ * @conn: Pointer to the connection driver to make secret driver call
+ * @scheme: Unique enough string for error message to help determine cause
+ * @encoded: Whether the returned secret needs to be base64 encoded
+ * @authdef: Pointer to the disk storage authentication
+ * @secretUsageType: Type of secret usage for authdef lookup
+ *
+ * Lookup the secret for the authdef usage type and return it either as
+ * raw text or encoded based on the caller's need.
+ *
+ * Returns a pointer to memory that needs to be cleared and free'd after
+ * usage or NULL on error.
+ */
+char *
+virSecretGetSecretString(virConnectPtr conn,
+ const char *scheme,
+ bool encoded,
+ virStorageAuthDefPtr authdef,
+ virSecretUsageType secretUsageType)
+{
+ size_t secret_size;
+ virSecretPtr sec = NULL;
+ char *secret = NULL;
+ char uuidStr[VIR_UUID_STRING_BUFLEN];
+
+ /* look up secret */
+ switch (authdef->secretType) {
+ case VIR_STORAGE_SECRET_TYPE_UUID:
+ sec = virSecretLookupByUUID(conn, authdef->secret.uuid);
+ virUUIDFormat(authdef->secret.uuid, uuidStr);
+ break;
+ case VIR_STORAGE_SECRET_TYPE_USAGE:
+ sec = virSecretLookupByUsage(conn, secretUsageType,
+ authdef->secret.usage);
+ break;
+ }
+
+ if (!sec) {
+ if (authdef->secretType == VIR_STORAGE_SECRET_TYPE_UUID) {
+ virReportError(VIR_ERR_NO_SECRET,
+ _("%s no secret matches uuid '%s'"),
+ scheme, uuidStr);
+ } else {
+ virReportError(VIR_ERR_NO_SECRET,
+ _("%s no secret matches usage value '%s'"),
+ scheme, authdef->secret.usage);
+ }
+ goto cleanup;
+ }
+
+ secret = (char *)conn->secretDriver->secretGetValue(sec, &secret_size, 0,
+ VIR_SECRET_GET_VALUE_INTERNAL_CALL);
+ if (!secret) {
+ if (authdef->secretType == VIR_STORAGE_SECRET_TYPE_UUID) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get value of the secret for "
+ "username '%s' using uuid '%s'"),
+ authdef->username, uuidStr);
+ } else {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get value of the secret for "
+ "username '%s' using usage value '%s'"),
+ authdef->username, authdef->secret.usage);
+ }
+ goto cleanup;
+ }
+
+ if (encoded) {
+ char *base64 = NULL;
+
+ base64_encode_alloc(secret, secret_size, &base64);
+ VIR_FREE(secret);
+ if (!base64) {
+ virReportOOMError();
+ goto cleanup;
+ }
+ secret = base64;
+ }
+
+ cleanup:
+ virObjectUnref(sec);
+ return secret;
+}
diff --git a/src/util/virsecret.h b/src/util/virsecret.h
new file mode 100644
index 0000000..8ef0629
--- /dev/null
+++ b/src/util/virsecret.h
@@ -0,0 +1,35 @@
+/*
+ * virsecret.h: secret related utility functions
+ *
+ * Copyright (C) 2016 Red Hat, Inc.
+ *
+ * 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/>.
+ *
+ */
+
+#ifndef __VIR_SECRET_H__
+# define __VIR_SECRET_H__
+
+# include "internal.h"
+# include "virstoragefile.h"
+
+char *virSecretGetSecretString(virConnectPtr conn,
+ const char *scheme,
+ bool encoded,
+ virStorageAuthDefPtr authdef,
+ virSecretUsageType secretUsageType)
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
+ ATTRIBUTE_RETURN_CHECK;
+#endif /* __VIR_SECRET_H__ */
--
2.5.5
8 years, 7 months
[libvirt] Host device assignment driver name vfio/ kvm
by Moshe Levi
Hi,
I was testing Host device assignment in OpenStack environment where the driver name is vfio or kvm.
My setup is as follow:
1. Fedora 21
2. Libvirt 1.3.0 which I compiled
3. OpenStack master
I have also other setups with older Libvirt version and the same OpenStack environment.
I notice that on my fedora environment the driver name is vfio were in my old environment the driver name is kvm.
According to Libvirt documentation default is "vfio" on systems where the VFIO driver is available and loaded, see [1]
I remove the vfio modules by removing vfio, vfio_iommu_type1, vfio_pci but when I boot a vm the drive name is vfio
How can change the driver name to be kvm?
Another thing that I encounter is an error when suspending VM (in OpenStack environment) when the driver name is vfio.
In such case I am getting the following error from Libvirt:
2016-03-28 11:42:59.527 1966 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib64/python2.7/site-packages/libvirt.py", line 560, in attachDeviceFlags
2016-03-28 11:42:59.527 1966 ERROR oslo_messaging.rpc.dispatcher if ret == -1: raise libvirtError ('virDomainAttachDeviceFlags() failed', dom=self)
2016-03-28 11:42:59.527 1966 ERROR oslo_messaging.rpc.dispatcher libvirtError: internal error: unable to execute QEMU command 'device_add': Device initialization failed.
I would appreciate for some pointers on what can cause this issue.
[1] https://libvirt.org/formatdomain.html#elementsHostDev
8 years, 7 months
[libvirt] [PATCH 0/2] Adjust order of calls during qemuDomainRemoveHostDevice
by John Ferlan
While reviewing patch:
http://www.redhat.com/archives/libvir-list/2016-March/msg00194.html
I noted that the order of operations during the code path was slightly
different and could cause issues if the reattachment code was called
first. It would seem that resetting the hostdev label and cgroup prior
to reattaching the device to the host would be a better corollary to
the attachment code path which detaches the devices from the host, then
sets the cgroup, then sets the hostdev label.
John Ferlan (2):
qemu: Restore label before reattach device to host
qemu: Tear down the cgroup before reattach device to host
src/qemu/qemu_hotplug.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
--
2.5.5
8 years, 7 months
[libvirt] [PATCH] apparmor: QEMU monitor socket moved
by Guido Günther
The directory name changed in a89f05ba8df095875f5ec8a9065a585af63a010b.
---
src/security/virt-aa-helper.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index a2d7226..0ded671 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -1366,6 +1366,8 @@ main(int argc, char **argv)
LOCALSTATEDIR, ctl->def->name);
virBufferAsprintf(&buf, " \"%s/lib/libvirt/qemu/domain-%s/monitor.sock\" rw,\n",
LOCALSTATEDIR, ctl->def->name);
+ virBufferAsprintf(&buf, " \"%s/lib/libvirt/qemu/domain-*-%.*s/monitor.sock\" rw,\n",
+ LOCALSTATEDIR, 20, ctl->def->name);
virBufferAsprintf(&buf, " \"%s/run/libvirt/**/%s.pid\" rwk,\n",
LOCALSTATEDIR, ctl->def->name);
virBufferAsprintf(&buf, " \"/run/libvirt/**/%s.pid\" rwk,\n",
--
2.8.0.rc3
8 years, 7 months
[libvirt] [PATCH v2 00/10] Introduce worker tuning APIs
by Erik Skultety
NOTE: patch 2/10 moves typed params definition from libvirt-host.h to
libvirt-common.h.in to enable it for admin as well -> therefore
libvirt-common.h must be regenerated with config.status
- also I'd like to open a discussion about virt-admin commands naming, since
I was sort of of out ideas when I copied numatune,memtune,etc. design into
"workertune"; I thought about srv-threadpool-info and srv-threadpool-set to
be a little consistent with srv-list, but for some reason I found it quite
long-ish so I dropped that...
v2:
- repost of v1 due to rebase conflicts
- due to rebase conflicts and overall changes since the original v1
po/POTFILES.in (patch 1/10) had to be updated
Erik Skultety (10):
po: Fix record ordering in POTFILES.in
libvirt-host: Move virTypedParam* to libvirt-common
admin: Enable usage of typed parameters
util: Refactor thread creation by introducing virThreadPoolExpand
util: Report system error when virThreadCreateFull fails
util: Add more getters to threadpool parameters
admin: Prepare admin protocol for future worker related procedures
admin: Introduce virAdmServerGethreadPoolParameters
admin: Introduce virAdmServerSetThreadPoolParameters
virt-admin: Introduce srv-workertune command
cfg.mk | 2 +-
daemon/admin.c | 102 +++++++++++++++++++
daemon/admin_server.c | 112 +++++++++++++++++++++
daemon/admin_server.h | 11 ++
include/libvirt/libvirt-admin.h | 71 +++++++++++++
include/libvirt/libvirt-common.h.in | 185 ++++++++++++++++++++++++++++++++++
include/libvirt/libvirt-host.h | 186 ----------------------------------
po/POTFILES.in | 4 +-
src/admin/admin_protocol.x | 54 +++++++++-
src/admin/admin_remote.c | 77 ++++++++++++++
src/admin_protocol-structs | 45 +++++++++
src/libvirt-admin.c | 83 +++++++++++++++
src/libvirt_admin_private.syms | 3 +
src/libvirt_admin_public.syms | 2 +
src/libvirt_private.syms | 4 +
src/rpc/virnetserver.c | 37 +++++++
src/rpc/virnetserver.h | 13 +++
src/util/virthreadpool.c | 196 ++++++++++++++++++++++++------------
src/util/virthreadpool.h | 8 ++
tools/virt-admin.c | 132 ++++++++++++++++++++++++
20 files changed, 1073 insertions(+), 254 deletions(-)
--
2.4.3
8 years, 7 months
[libvirt] [PATCH 00/11] vz: change vz driver to be stateful driver and other enhancements
by Maxim Nestratov
There is no benefit in providing two ways of connecting to vz driver:
by connecting via daemon and directly from client. Both ways finally
come to a host where vz daemon sits. Always connecting via daemon allows
us to have a single list of domains and share it among all connections.
Maxim Nestratov (11):
virsh: report when vz driver is compiled
vz: change the order of capabilities reported
vz: remove drivername field from vzConn structure
vz: build driver as module and don't register it on client's side
vz: pass vzConnPtr to prlsdkXxx functions instead of virConnectPtr
vz: make vzConn structure be a new lockable object and use it
vz: implement connectGetSysinfo hypervisor callback
vz: remove close callback implementations
vz: remove vzDriverLock/Unlock function
vz: minor cleanup
vz: change vzConnectIsAlive behavior
daemon/Makefile.am | 4 +
daemon/libvirtd.c | 9 +
src/Makefile.am | 21 ++-
src/libvirt.c | 7 -
src/vz/vz_driver.c | 479 ++++++++++++++++++++++++++++++-----------------------
src/vz/vz_sdk.c | 36 ++--
src/vz/vz_sdk.h | 6 +-
src/vz/vz_utils.c | 18 +-
src/vz/vz_utils.h | 15 +-
tools/virsh.c | 3 +
10 files changed, 341 insertions(+), 257 deletions(-)
--
2.4.3
8 years, 7 months
[libvirt] [PATCH 00/38] Introduce APIs to change daemon's logging settings
by Erik Skultety
This series implements administration APIs to modify daemon's logging settings
which include priority, filters, and outputs. It also performs all necessary
changes to enable this feature. Patches also involve some slight refactors
to the existing code as well as wiring up the APIs to virt-admin client.
The major change in internal code is how definition of filters and outputs is
achieved. Until now each filter/output has been defined and appended to the
global set of filters/outputs individually whilst holding a lock that was
repeatedly released after each filter/output. If modification to filters and
outputs should be exported through public APIs, all these setter operations
must be atomic, i.e. accomplished as a unit, not gradually. For filters and
priority, these are replaced normally, i.e. reset the original and replace it
with the new copy while having the lock. For outputs, there was a slight issue,
since resetting the global set of outputs would result in closing all the file
descriptors, which might not be exactly what we want, since the new set of
outputs that is meant to replace the original set might include outputs that
are also contained within the original set. The logic for such outputs is
following:
Each file-based output that already exists in the original set and
should continue existing in the new set will copy the existing FD from the
global set. For each syslog-based output, closelog and openlog must be called
anyway (because syslog keeps its FD private), but will be called at
the very last moment if such an output already exists to prevent from changing
before the lock for unit replaced is acquired, and thus breaking the atomicity
that we want. For journald-based outputs, the FD is global, we just need to
prevent it from being closed if such an output shall continue to exist.
All outputs that need to continue to exist are prevented from closing when
being destroyed-deallocated. On the other hand, all outputs that do not exist
in the new set of outputs shall be closed correctly.
Erik Skultety (38):
virlog: Return void instead of int in virLogReset<Foo> methods
virlog: Convert virLogOutputs to a list of pointers to outputs
virlog: Convert virLogFilters to a list of pointers to filters
virlog: Export virLogOutputPtr through header
virlog: Export virLogFilterPtr through header
virlog: Introduce virLogSetFilters
virlog: Introduce virLogSetOutputs
daemon: Replace virLogParseOutputs with virLogSetOutputs in callers
daemon: Replace virLogParseFilters with virLogSetFilters in callers
virlog: Introduce virLogDefineOutputs
virlog: Introduce virLogDefineFilters
virlog: Rename virLogAddOutputTo to virLogNewOutput
virlog: Rename virLogDefineOutput to virLogOutputNew
virlog: Rename virLogDefineFilter to virLogFilterNew
virlog: Introduce virLogOutputFree
virlog: Introduce virLogOutputListFree
virlog: Introduce virLogFilterFree
virlog: Introduce virLogFilterListFree
virlog: Make virLogReset methods use of virLog(Output|Filter)ListFree
virlog: Split output parsing and output defining to separate
operations
virlog: Split filter parsing and filter defining to separate
operations
virlog: Split parsing and setting priority
virlog: Introduce virLogOutputExists
virlog: Make use of virLogOutputExists
virlog: Take a special care of syslog when setting new set of log
outputs
virlog: Swap the new copy of outputs with the global existing one
virlog: Rename virLogFiltersSerial to virLogSerial
virlog: Make virLogSetDefaultPriority trigger source update as well
virlog: Introduce an API mutex that serializes all setters
virlog: Acquire virLogAPILock in each setter API
admin: Introduce virAdmConnectGetLoggingLevel
admin: Introduce virAdmConnectGetLoggingFilters
admin: Introduce virAdmConnectGetLoggingOutputs
admin: Introduce virAdmConnectSetLoggingLevel
admin: Introduce virAdmConnectSetLoggingFilters
admin: Introduce virAdmConnectSetLoggingOutputs
admin: Export logging level constants via libvirt-admin.h
virt-admin: Wire-up the logging APIs
daemon/admin.c | 125 +++++++
daemon/libvirtd.c | 8 +-
include/libvirt/libvirt-admin.h | 37 +++
src/admin/admin_protocol.x | 73 ++++-
src/admin/admin_remote.c | 86 +++++
src/admin_protocol-structs | 38 +++
src/libvirt-admin.c | 219 +++++++++++++
src/libvirt_admin_private.syms | 9 +
src/libvirt_admin_public.syms | 6 +
src/libvirt_private.syms | 14 +-
src/locking/lock_daemon.c | 8 +-
src/logging/log_daemon.c | 8 +-
src/util/virlog.c | 698 +++++++++++++++++++++++++++-------------
src/util/virlog.h | 50 +--
tests/eventtest.c | 3 +-
tests/testutils.c | 19 +-
tests/virlogtest.c | 12 +-
tools/virt-admin.c | 208 ++++++++++++
18 files changed, 1361 insertions(+), 260 deletions(-)
--
2.4.3
8 years, 7 months
[libvirt] [PATCH] qemu: perf: Tweak flags before using them
by Peter Krempa
@flags have a valid modification impact only after calling
virDomainObjUpdateModificationImpact. virDomainObjGetOneDef calls it but
doesn't update them in the caller.
---
CC: mprivozn(a)redhat.com
src/qemu/qemu_driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4aa1625..0434438 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -10150,6 +10150,9 @@ qemuDomainGetPerfEvents(virDomainPtr dom,
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
goto cleanup;
+ if (virDomainObjUpdateModificationImpact(vm, &flags) < 0)
+ goto endjob;
+
if (!(def = virDomainObjGetOneDef(vm, flags)))
goto endjob;
--
2.8.0
8 years, 7 months
[libvirt] [PATCH] migration: convert speed from Mb/sec to bytes/sec in drive-mirror jobs
by Rudy Zhang
Block migration speed is differect from memory migration speed, because
it not convert speed from Mb/sec to bytes/sec in the drive-mirror job.
Signed-off-by: Rudy Zhang <rudyflyzhang(a)gmail.com>
---
src/qemu/qemu_migration.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 8bc76bf..7648d8c 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2135,8 +2135,8 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver,
qemuBlockJobSyncBegin(disk);
/* Force "raw" format for NBD export */
- mon_ret = qemuMonitorDriveMirror(priv->mon, diskAlias, nbd_dest,
- "raw", speed, 0, 0, mirror_flags);
+ mon_ret = qemuMonitorDriveMirror(priv->mon, diskAlias, nbd_dest,"raw",
+ (unsigned long long)speed << 20, 0, 0, mirror_flags);
VIR_FREE(diskAlias);
VIR_FREE(nbd_dest);
--
2.6.4
8 years, 7 months