[libvirt] [PATCH 0/4] Various snapshot fixes for qemu
by Peter Krempa
Peter Krempa (4):
qemu: snapshot: Use typecasted switch in qemuDomainSnapshotPrepare()
qemu: snapshot: Forbid partial internal snapshots
qemu: snapshot: Forbid empty snapshots
qemu: snapshot: Fix return value of external checkpoint with no disks
src/qemu/qemu_driver.c | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
--
1.9.3
10 years, 5 months
[libvirt] Job Control, Google Summer of Code
by Tucker DiNapoli
Hello everyone,
My name is Tucker DiNapoli and I'm going to be working on libvirt this
summer for the google summer of code. My project is to implement job
control in the storage driver. In order to do that I am first going to
create a unified api for job control in libvirt (as it is currently
implemented seperately in both the qemu and libxl drivers). I'm currently
working on the api for job control and I have some ideas that I'll post on
the mailing list soon. If anyone has any ideas or requests re job control
I'd be happy to hear them. I'm on the #virt irc channel as tuckerD, I look
forward to working on libvrt this summer.
Tucker Dinapoli
10 years, 5 months
[libvirt] [bug] problem with python interface, dom.vcpus() cpu info doesn't match cpu map
by Chris Friesen
Hi,
I was playing around with vcpupin and emulatorpin and managed to get
into a strange state.
From within python I get the following:
(Pdb) dom = self._lookup_by_name(instance.name)
(Pdb) dom.vcpus()
([(0, 1, 5970000000L, 2), (1, 1, 4580000000L, 3)], [(False, False, True,
False), (False, False, True, False)])
The problem is that the cpuinfo for the second vcpu has it running on
physical cpu 3, even though the affinity mask (within python and from
taskset) says it can only run on physical cpu 2.
The VM in question was originally started up running on pysical cpus 2
and 3, then I used the vcpupin/emulatorpin commands to only use physical
cpu 2.
Anyone got any ideas? I'm using libvirt-1.1.2 and libvirt-python-1.1.2
on a 3.4.82 kernel.
Some more data:
I have one VM running, taskset shows affinity as follows:
root@compute-0:~# taskset -pac 7680
pid 7680's current affinity list: 2
pid 7681's current affinity list: 1-3
pid 7683's current affinity list: 2
pid 7684's current affinity list: 0
"virsh" has the following view:
root@compute-0:~# virsh list
Id Name State
----------------------------------------------------
3 instance-0000001d running
root@compute-0:~# virsh emulatorpin 3
emulator: CPU Affinity
----------------------------------
*: 2
root@compute-0:~# virsh vcpupin 3
VCPU: CPU Affinity
----------------------------------
0: 2
1: 2
Thanks,
Chris
10 years, 5 months
[libvirt] [PATCH] bhyve: domain events support
by Roman Bogorodskiy
Tested with a sequance of virsh commands like that:
- Redefine already defined domain (bhyve) using 'define' command
- 'undefine bhyve'
- 'define /path/to/bhyve.xml'
- 'start bhyve'
- 'destroy bhyve'
- 'start --file /path/to/bhyve.xml'
- 'destroy bhyve'
This procudes list of events from 'event --all --loop':
event 'lifecycle' for domain bhyve: Defined Updated
event 'lifecycle' for domain bhyve: Undefined Removed
event 'lifecycle' for domain bhyve: Defined Added
event 'lifecycle' for domain bhyve: Started Booted
event 'lifecycle' for domain bhyve: Stopped Destroyed
event 'lifecycle' for domain bhyve: Started Booted
event 'lifecycle' for domain bhyve: Stopped Destroyed
Roman Bogorodskiy (1):
bhyve: domain events support
src/bhyve/bhyve_driver.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++-
src/bhyve/bhyve_utils.h | 3 ++
2 files changed, 90 insertions(+), 1 deletion(-)
--
1.9.0
10 years, 5 months
[libvirt] [PATCH v5] migration: add support for migrateURI configuration
by Chen Fan
For now, we set the migration URI via command line '--migrate_uri' or
construct the URI by looking up the dest host's hostname which could be
solved by DNS automatically.
But in cases the dest host have two or more NICs to reach, we may need to
send the migration data over a specific NIC which is different from the
automatically resloved one for some reason like performance, security, etc.
thus we must explicitly specify the migrateuri in command line everytime,
but it is too troublesome if there are many such hosts(and don't forget
virt-manager).
This patch adds a configuration file option on dest host to save the
default value set which can be specified to a migration hostname or
one of this host's addresses used for transferring data, thus user doesn't
boring to specify it in command line everytime.
Signed-off-by: Chen Fan <chen.fan.fnst(a)cn.fujitsu.com>
---
v4-v5: using "migrate_host" instead of "migrate_uri" configuration.
src/qemu/qemu.conf | 7 ++++++-
src/qemu/qemu_conf.c | 1 +
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_migration.c | 25 +++++++++++++++++++++----
4 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index f0e802f..421efc4 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -449,7 +449,12 @@
#
#seccomp_sandbox = 1
-
+# Override the migration hostname for transfering the migration data. By
+# default, the migrate hostname is set to the host's configured hostname.
+# This can be used to override the default value set by a migration
+# hostname or an IP address of the host machine. both IPv4 and IPv6
+# addresses are accepted.
+#migrate_host = "localhost"
# Override the listen address for all incoming migrations. Defaults to
# 0.0.0.0, or :: if both host and qemu are capable of IPv6.
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 198ee2f..391fc57 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -574,6 +574,7 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
GET_VALUE_LONG("seccomp_sandbox", cfg->seccompSandbox);
+ GET_VALUE_STR("migrate_host", cfg->migrateHost);
GET_VALUE_STR("migration_address", cfg->migrationAddress);
ret = 0;
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index a36ea63..8e872b9 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -163,6 +163,7 @@ struct _virQEMUDriverConfig {
int seccompSandbox;
+ char *migrateHost;
/* The default for -incoming */
char *migrationAddress;
int migrationPortMin;
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index a9f7fea..963d1ef 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2639,6 +2639,8 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver,
int ret = -1;
virURIPtr uri = NULL;
bool well_formed_uri = true;
+ virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+ const char *migrateHost = cfg->migrateHost;
VIR_DEBUG("driver=%p, dconn=%p, cookiein=%s, cookieinlen=%d, "
"cookieout=%p, cookieoutlen=%p, uri_in=%s, uri_out=%p, "
@@ -2652,8 +2654,9 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver,
/* The URI passed in may be NULL or a string "tcp://somehostname:port".
*
* If the URI passed in is NULL then we allocate a port number
- * from our pool of port numbers and return a URI of
- * "tcp://ourhostname:port".
+ * from our pool of port numbers, and if the migrateHost is configured,
+ * we return a URI of "tcp://migrateHost:port", otherwise return a URI
+ * of "tcp://ourhostname:port".
*
* If the URI passed in is not NULL then we try to parse out the
* port number and use that (note that the hostname is assumed
@@ -2663,8 +2666,21 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver,
if (virPortAllocatorAcquire(driver->migrationPorts, &port) < 0)
goto cleanup;
- if ((hostname = virGetHostname()) == NULL)
- goto cleanup;
+ if (migrateHost != NULL) {
+ if (virSocketAddrIsNumeric(migrateHost)) {
+ /* migrateHost is numeric IPv4 or IPv6 */
+ if (virSocketAddrParse(NULL, migrateHost, AF_UNSPEC) < 0)
+ goto cleanup;
+ } else {
+ /* migrateHost is a hostname */
+ }
+
+ if (VIR_STRDUP(hostname, migrateHost) < 0)
+ goto cleanup;
+ } else {
+ if ((hostname = virGetHostname()) == NULL)
+ goto cleanup;
+ }
if (STRPREFIX(hostname, "localhost")) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -2746,6 +2762,7 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver,
cleanup:
virURIFree(uri);
VIR_FREE(hostname);
+ virObjectUnref(cfg);
if (ret != 0) {
VIR_FREE(*uri_out);
if (autoPort)
--
1.8.1.4
10 years, 5 months
[libvirt] [PATCH] cleanup: clamp max info with MIN().
by Dongsheng Yang
Rather than using a open coded implementation,
this patch use MIN macro to clamp infomation
to allowed maxmum.
Signed-off-by: Dongsheng Yang <yangds.fnst(a)cn.fujitsu.com>
---
src/qemu/qemu_driver.c | 18 ++++++------------
src/test/test_driver.c | 10 +++-------
2 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 52ca47c..b3782dd 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4542,12 +4542,9 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
goto cleanup;
maxcpu = maplen * 8;
- if (maxcpu > hostcpus)
- maxcpu = hostcpus;
- /* Clamp to actual number of vcpus */
- if (ncpumaps > targetDef->vcpus)
- ncpumaps = targetDef->vcpus;
+ maxcpu = MIN(maxcpu, hostcpus);
+ ncpumaps = MIN(ncpumaps, targetDef->vcpus);
if (ncpumaps < 1) {
goto cleanup;
@@ -4786,8 +4783,8 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
goto cleanup;
maxcpu = maplen * 8;
- if (maxcpu > hostcpus)
- maxcpu = hostcpus;
+
+ maxcpu = MIN(maxcpu, hostcpus);
/* initialize cpumaps */
memset(cpumaps, 0xff, maplen);
@@ -4852,12 +4849,9 @@ qemuDomainGetVcpus(virDomainPtr dom,
goto cleanup;
maxcpu = maplen * 8;
- if (maxcpu > hostcpus)
- maxcpu = hostcpus;
- /* Clamp to actual number of vcpus */
- if (maxinfo > priv->nvcpupids)
- maxinfo = priv->nvcpupids;
+ maxcpu = MIN(maxcpu, hostcpus);
+ maxinfo = MIN(maxinfo, priv->nvcpupids);
if (maxinfo >= 1) {
if (info != NULL) {
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 37756e7..4e591f2 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -2773,12 +2773,9 @@ static int testDomainGetVcpus(virDomainPtr domain,
hostcpus = VIR_NODEINFO_MAXCPUS(privconn->nodeInfo);
maxcpu = maplen * 8;
- if (maxcpu > hostcpus)
- maxcpu = hostcpus;
- /* Clamp to actual number of vcpus */
- if (maxinfo > privdom->def->vcpus)
- maxinfo = privdom->def->vcpus;
+ maxcpu = MIN(maxcpu, hostcpus);
+ maxinfo = MIN(maxinfo, privdom->def->vcpus);
/* Populate virVcpuInfo structures */
if (info != NULL) {
@@ -2858,8 +2855,7 @@ static int testDomainPinVcpu(virDomainPtr domain,
privmaplen = VIR_CPU_MAPLEN(hostcpus);
maxcpu = maplen * 8;
- if (maxcpu > hostcpus)
- maxcpu = hostcpus;
+ maxcpu = MIN(maxcpu, hostcpus);
privcpumap = VIR_GET_CPUMAP(privdomdata->cpumaps, privmaplen, vcpu);
memset(privcpumap, 0, privmaplen);
--
1.8.2.1
10 years, 5 months
[libvirt] [PATCH] util: refactor virNetlinkCommand to fix several bugs / style problems
by Laine Stump
Inspired by a simpler patch from "Wangrui (K) <moon.wangrui(a)huawei.com>".
A submitted patch pointed out that virNetlinkCommand() was doing an
improper typecast of the return value from nl_recv() (int to
unsigned), causing it to miss error returns, and that even after
remedying that problem, virNetlinkCommand() was calling VIR_FREE() on
the pointer returned from nl_recv() (*resp) even if nl_recv() had
returned an error, and that in this case the pointer was verifiably
invalid, as it was pointing to memory that had been allocated by
libnl, but then freed prior to returning the error.
While reviewing this patch, I noticed several other problems with this
seemingly simple function (at least one of them as serious as the
problem being reported/fixed by the aforementioned patch), and decided
they all deserved to be fixed. Here is the list:
1) The return value from nl_recv() must be assigned to an int (rather
than unsigned int) in order to detect failure.
2) When nl_recv() returns an error, the contents of *resp is invalid,
and should be simply set to 0, *not* VIR_FREE()'d.
3) The first error return from virNetlinkCommand returns -EINVAL,
incorrectly implying that the caller can expect the return value to
be of the "-errno" variety, which is not true in any other case.
4) The 2nd error return returns directly with garbage in *resp. While
the caller should never use *resp in this case, it's still good
practice to set it to NULL.
5) For the next 5 (!!) error conditions, *resp will contain garbage,
and virNetlinkCommand() will goto it's cleanup code which will
VIR_FREE(*resp), almost surely leading to a segfault.
In addition to fixing these 5 problems, this patch also makes the
following two changes to make the function conform more closely to the
style of other libvirt code:
1) Change the handling of return code from "named rc and defaulted to
0, but changed to -1 on error" to the more common "named ret and
defaulted to -1, but changed to 0 on success".
2) Rename the "error" label to "cleanup", since the code that follows
is executed in success cases as well as failure.
---
src/util/virnetlink.c | 42 ++++++++++++++++++++----------------------
1 file changed, 20 insertions(+), 22 deletions(-)
diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index 0cf18f2..db8d59e 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2013 Red Hat, Inc.
+ * Copyright (C) 2010-2014 Red Hat, Inc.
* Copyright (C) 2010-2012 IBM Corporation
*
* This library is free software; you can redistribute it and/or
@@ -180,7 +180,7 @@ int virNetlinkCommand(struct nl_msg *nl_msg,
uint32_t src_pid, uint32_t dst_pid,
unsigned int protocol, unsigned int groups)
{
- int rc = 0;
+ int ret = -1;
struct sockaddr_nl nladdr = {
.nl_family = AF_NETLINK,
.nl_pid = dst_pid,
@@ -192,41 +192,39 @@ int virNetlinkCommand(struct nl_msg *nl_msg,
int n;
struct nlmsghdr *nlmsg = nlmsg_hdr(nl_msg);
virNetlinkHandle *nlhandle = NULL;
+ int len = 0;
if (protocol >= MAX_LINKS) {
virReportSystemError(EINVAL,
_("invalid protocol argument: %d"), protocol);
- return -EINVAL;
+ goto cleanup;
}
nlhandle = virNetlinkAlloc();
if (!nlhandle) {
virReportSystemError(errno,
"%s", _("cannot allocate nlhandle for netlink"));
- return -1;
+ goto cleanup;
}
if (nl_connect(nlhandle, protocol) < 0) {
virReportSystemError(errno,
_("cannot connect to netlink socket with protocol %d"),
protocol);
- rc = -1;
- goto error;
+ goto cleanup;
}
fd = nl_socket_get_fd(nlhandle);
if (fd < 0) {
virReportSystemError(errno,
"%s", _("cannot get netlink socket fd"));
- rc = -1;
- goto error;
+ goto cleanup;
}
if (groups && nl_socket_add_membership(nlhandle, groups) < 0) {
virReportSystemError(errno,
"%s", _("cannot add netlink membership"));
- rc = -1;
- goto error;
+ goto cleanup;
}
nlmsg_set_dst(nl_msg, &nladdr);
@@ -237,8 +235,7 @@ int virNetlinkCommand(struct nl_msg *nl_msg,
if (nbytes < 0) {
virReportSystemError(errno,
"%s", _("cannot send to netlink socket"));
- rc = -1;
- goto error;
+ goto cleanup;
}
memset(fds, 0, sizeof(fds));
@@ -253,26 +250,27 @@ int virNetlinkCommand(struct nl_msg *nl_msg,
if (n == 0)
virReportSystemError(ETIMEDOUT, "%s",
_("no valid netlink response was received"));
- rc = -1;
- goto error;
+ goto cleanup;
}
- *respbuflen = nl_recv(nlhandle, &nladdr,
- (unsigned char **)resp, NULL);
- if (*respbuflen <= 0) {
+ len = nl_recv(nlhandle, &nladdr, (unsigned char **)resp, NULL);
+ if (len <= 0) {
virReportSystemError(errno,
"%s", _("nl_recv failed"));
- rc = -1;
+ goto cleanup;
}
- error:
- if (rc == -1) {
- VIR_FREE(*resp);
+
+ ret = 0;
+ cleanup:
+ if (ret < 0) {
*resp = NULL;
*respbuflen = 0;
+ } else {
+ *respbuflen = len;
}
virNetlinkFree(nlhandle);
- return rc;
+ return ret;
}
static void
--
1.9.0
10 years, 5 months
[libvirt] [libvirt-python][PATCH] Implement virDomain{Get, Set}Time APIs
by Michal Privoznik
While the setter can be generated automatically, the getter is not.
However, it would be a lot easier if they both share the same logic:
a python dictionary to represent the time: dict['seconds'] to
represent seconds, and dict['nseconds'] to represent microseconds.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
generator.py | 2 +
libvirt-override-virDomain.py | 13 ++++++
libvirt-override.c | 95 +++++++++++++++++++++++++++++++++++++++++++
sanitytest.py | 2 +-
4 files changed, 111 insertions(+), 1 deletion(-)
diff --git a/generator.py b/generator.py
index e7b4643..bdac877 100755
--- a/generator.py
+++ b/generator.py
@@ -519,6 +519,8 @@ skip_function = (
'virDomainFSFreeze', # overridden in virDomain.py
'virDomainFSThaw', # overridden in virDomain.py
+ 'virDomainGetTime', # overridden in virDomain.py
+ 'virDomainSetTime', # overridden in virDomain.py
# 'Ref' functions have no use for bindings users.
"virConnectRef",
diff --git a/libvirt-override-virDomain.py b/libvirt-override-virDomain.py
index e61ad00..a50ec0d 100644
--- a/libvirt-override-virDomain.py
+++ b/libvirt-override-virDomain.py
@@ -59,3 +59,16 @@
ret = libvirtmod.virDomainFSThaw(self._o, mountpoints, flags)
if ret == -1: raise libvirtError ('virDomainFSThaw() failed', dom=self)
return ret
+
+ def getTime(self, flags=0):
+ """Extract information about guest time """
+ ret = libvirtmod.virDomainGetTime(self._o, flags)
+ if ret == -1: raise libvirtError ('virDomainGetTime() failed', dom=self)
+ return ret
+
+ def setTime(self, time=None, flags=0):
+ """Set guest time to the given value. @time is a dict conatining
+ 'seconds' field for seconds and 'nseconds' field for nanosecons """
+ ret = libvirtmod.virDomainSetTime(self._o, time, flags)
+ if ret == -1: raise libvirtError ('virDomainSetTime() failed', dom=self)
+ return ret
diff --git a/libvirt-override.c b/libvirt-override.c
index c4ac223..a7a6213 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -7645,6 +7645,99 @@ libvirt_virDomainFSThaw(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
VIR_FREE(mountpoints);
return py_retval;
}
+
+static PyObject *
+libvirt_virDomainGetTime(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval = NULL;
+ PyObject *dict = NULL;
+ PyObject *pyobj_domain, *pyobj_seconds, *pyobj_nseconds;
+ virDomainPtr domain;
+ long long seconds;
+ unsigned int nseconds;
+ unsigned int flags;
+ int c_retval;
+
+ if (!PyArg_ParseTuple(args, (char*)"Oi:virDomainGetTime",
+ &pyobj_domain, &flags))
+ return NULL;
+ domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
+
+ if (!(dict = PyDict_New()))
+ goto cleanup;
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ c_retval = virDomainGetTime(domain, &seconds, &nseconds, flags);
+ LIBVIRT_END_ALLOW_THREADS;
+
+ if (c_retval < 0)
+ goto cleanup;
+
+ if (!(pyobj_seconds = libvirt_longlongWrap(seconds)) ||
+ PyDict_SetItemString(dict, "seconds", pyobj_seconds) < 0)
+ goto cleanup;
+ Py_DECREF(pyobj_seconds);
+
+ if (!(pyobj_nseconds = libvirt_uintWrap(nseconds)) ||
+ PyDict_SetItemString(dict, "nseconds", pyobj_nseconds) < 0)
+ goto cleanup;
+ Py_DECREF(pyobj_nseconds);
+
+ py_retval = dict;
+ dict = NULL;
+ cleanup:
+ Py_XDECREF(dict);
+ return py_retval;
+}
+
+
+static PyObject *
+libvirt_virDomainSetTime(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval = NULL;
+ PyObject *pyobj_domain;
+ PyObject *py_dict;
+ virDomainPtr domain;
+ long long seconds = 0;
+ unsigned int nseconds = 0;
+ unsigned int flags;
+ ssize_t py_dict_size;
+ int c_retval;
+
+ if (!PyArg_ParseTuple(args, (char*)"OOi:virDomainSetTime",
+ &pyobj_domain, &py_dict, &flags))
+ return NULL;
+ domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
+
+ py_dict_size = PyDict_Size(py_dict);
+
+ if (py_dict_size == 2) {
+ PyObject *pyobj_seconds, *pyobj_nseconds;
+
+ if (!(pyobj_seconds = PyDict_GetItemString(py_dict, "seconds")) ||
+ (libvirt_longlongUnwrap(pyobj_seconds, &seconds) < 0)) {
+ PyErr_Format(PyExc_LookupError, "malformed or missing 'seconds'");
+ goto cleanup;
+ }
+
+ if (!(pyobj_nseconds = PyDict_GetItemString(py_dict, "nseconds")) ||
+ (libvirt_uintUnwrap(pyobj_nseconds, &nseconds) < 0)) {
+ PyErr_Format(PyExc_LookupError, "malformed or missing 'nseconds'");
+ goto cleanup;
+ }
+ } else if (py_dict_size > 0) {
+ PyErr_Format(PyExc_LookupError, "Dictionary must contain "
+ "'seconds' and 'nseconds'");
+ goto cleanup;
+ }
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ c_retval = virDomainSetTime(domain, seconds, nseconds, flags);
+ LIBVIRT_END_ALLOW_THREADS;
+
+ py_retval = libvirt_intWrap(c_retval);
+
+ cleanup:
+ return py_retval;
+}
#endif /* LIBVIR_CHECK_VERSION(1, 2, 5) */
/************************************************************************
@@ -7825,6 +7918,8 @@ static PyMethodDef libvirtMethods[] = {
#if LIBVIR_CHECK_VERSION(1, 2, 5)
{(char *) "virDomainFSFreeze", libvirt_virDomainFSFreeze, METH_VARARGS, NULL},
{(char *) "virDomainFSThaw", libvirt_virDomainFSThaw, METH_VARARGS, NULL},
+ {(char *) "virDomainGetTime", libvirt_virDomainGetTime, METH_VARARGS, NULL},
+ {(char *) "virDomainSetTime", libvirt_virDomainSetTime, METH_VARARGS, NULL},
#endif /* LIBVIR_CHECK_VERSION(1, 2, 5) */
{NULL, NULL, 0, NULL}
};
diff --git a/sanitytest.py b/sanitytest.py
index 62fe42b..6067a3f 100644
--- a/sanitytest.py
+++ b/sanitytest.py
@@ -152,7 +152,7 @@ for name in sorted(basicklassmap):
# and virDomainSnapshot namespaces which stupidly used a different
# convention which we now can't fix without breaking API
if func[0:3] == "Get" and klass not in ["virConnect", "virDomainSnapshot", "libvirt"]:
- if func not in ["GetCPUStats"]:
+ if func not in ["GetCPUStats", "GetTime"]:
func = func[3:]
# The object creation and lookup APIs all have to get re-mapped
--
1.9.3
10 years, 5 months
[libvirt] [PATCH] avoid 'sync' as variable name
by Pavel Hrdina
Old gcc complains about shadowing 'sync' variable:
../../src/qemu/qemu_agent.c: In function 'qemuAgentSetTime':
../../src/qemu/qemu_agent.c:1737: warning: declaration of 'sync'
shadows a global declaration [-Wshadow]
/usr/include/unistd.h:464: warning: shadowed declaration is here
[-Wshadow]
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_agent.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 10e2b8d..0421733 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -1734,13 +1734,13 @@ int
qemuAgentSetTime(qemuAgentPtr mon,
long long seconds,
unsigned int nseconds,
- bool sync)
+ bool rtcSync)
{
int ret = -1;
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
- if (sync) {
+ if (rtcSync) {
cmd = qemuAgentMakeCommand("guest-set-time", NULL);
} else {
/* guest agent expect time with nanosecond granularity.
--
1.8.5.5
10 years, 5 months
[libvirt] [PATCH 00/12] Add explicit non-NULL check for virObjectUnlock()
by Roman Bogorodskiy
Background is here:
https://www.redhat.com/archives/libvir-list/2014-May/msg00613.html
Roman Bogorodskiy (12):
Add explicit non-NULL check for virObjectUnlock()
qemu: virObjectUnlock usage cleanup
bhyve: virObjectUnlock usage cleanup
libxl: virObjectUnlock usage cleanup
lxc: virObjectUnlock usage cleanup
openvz: virObjectUnlock usage cleanup
parallels: virObjectUnlock usage cleanup
test: virObjectUnlock usage cleanup
uml: virObjectUnlock usage cleanup
vmware: virObjectUnlock usage cleanup
util: virObjectUnlock usage cleanup
maint: add virObjectUnlock to useless_free_options
cfg.mk | 1 +
src/bhyve/bhyve_driver.c | 9 +-
src/libxl/libxl_domain.c | 3 +-
src/libxl/libxl_driver.c | 124 +++++----------
src/lxc/lxc_driver.c | 129 ++++++----------
src/lxc/lxc_process.c | 3 +-
src/openvz/openvz_driver.c | 69 +++------
src/parallels/parallels_driver.c | 30 ++--
src/qemu/qemu_capabilities.c | 3 +-
src/qemu/qemu_driver.c | 324 +++++++++++++--------------------------
src/qemu/qemu_migration.c | 12 +-
src/qemu/qemu_process.c | 6 +-
src/test/test_driver.c | 156 +++++++------------
src/uml/uml_driver.c | 81 ++++------
src/util/virclosecallbacks.c | 3 +-
src/util/virobject.c | 3 +
src/vmware/vmware_driver.c | 51 ++----
17 files changed, 338 insertions(+), 669 deletions(-)
--
1.9.0
10 years, 5 months