[libvirt] how can dst know that migration is over?
by Dan Kenigsberg
When migrating a domain from src to dst, it first appears 'suspended' at
the dst. When it's 'running', higher-level management can tell that
migration is done.
However, when bugzilla.redhat.com/519204 is fixed, I can no longer count
on that - migrated domain may still be suspended at the destination.
So how can I tell, at the destination, that migration is over? I could
add higher-level communication from src to dst, but I am reluctant to
add another failure mode. I'd rather have libvirt tell me, "hey
migration is done".
btw, does src libvirt verify with dst libvirt that migration is
successful? src qemu can be oblivious of dst qemu not receiving the last
packet correctly.
Regards,
Dan.
15 years
[libvirt] Suggest to postpone 0.7.3 by one week
by Daniel Veillard
Basically the plan was to enter freeze this week-end and
release 0.7.3 on the 30th, but looking at the current logs and
status on the list, this may not be appropriate, some of the
patches aren't finalized and we would end up with 0.7.3 being
mostly 0.7.2 with bug fixes. So I suggest to introduce a one
week delay, enter the freeze at teh end of the month instead and
push 0.7.3 on Nov 6th.
I assume it's not a serious problem to anybody, right ?
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
15 years
[libvirt] [PATCH] Fix potential false-positive OOM error reporting
by Matthias Bolte
If no matching device was found (cap == NULL) then no strdup() call
was made and *wwnn and *wwpn are untouched. Checking them for NULL
in this situation may result in reporting an false-positive OOM error
because *wwnn and *wwpn may be initialized to NULL by the caller.
Only check *wwnn and *wwpn for NULL if a matching device was found
(cap != NULL) and thus strdup() was called.
* src/conf/node_device_conf.c: only report an OOM error if there
really is one
---
src/conf/node_device_conf.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 77f7be3..c2c5a44 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -1243,9 +1243,7 @@ virNodeDeviceGetWWNs(virConnectPtr conn,
virNodeDeviceReportError(conn, VIR_ERR_NO_SUPPORT,
"%s", _("Device is not a fibre channel HBA"));
ret = -1;
- }
-
- if (*wwnn == NULL || *wwpn == NULL) {
+ } else if (*wwnn == NULL || *wwpn == NULL) {
/* Free the other one, if allocated... */
VIR_FREE(wwnn);
VIR_FREE(wwpn);
--
1.6.0.4
15 years
[libvirt] how to duplicate an vm?
by Dan Bar Dov
I am trying to duplicate an existing vm.
While the VM was down, I copied the image file, copied the xml file and
manually fixed the xml file to have a different VM name, and point to the
copy.
The copy now works, but the original disappraeed from virt-manager. When I
try to "restore" it I get:
Error restoring domain '/var/lib/libvirt/images/fc11-copy.img': operation
failed: image magic is incorrect
What am I doing wrong/how should I replicate a VM?
Thanks,
Dan
15 years
[libvirt] Possible qemu GetVcpus bug?
by Cole Robinson
Playing with the GetVcpus API call (and virsh vcpuinfo), there is a
slight inconsistency that may be a bug.
In qemudDomainGetVcpus, we have:
if (nodeGetInfo(dom->conn, &nodeinfo) < 0)
goto cleanup;
maxcpu = maplen * 8;
if (maxcpu > nodeinfo.cpus)
maxcpu = nodeinfo.cpus;
We clamp the amount of cpus we report affinity against to nodeinfo.cpus.
virsh however expects this to be VIR_NODEINFO_MAXCPUS, and makes the
cpumap appropriately long (and uses this value when pretty printing):
cpumaplen = VIR_CPU_MAPLEN(VIR_NODEINFO_MAXCPUS(nodeinfo));
Is there a bug here? Should qemu be using VIR_NODEINFO_MAXCPUS, or is
there some explicit reason to use nodeinfo.cpus?
Thanks,
Cole
15 years
[libvirt] Xenner status
by Gerry Reno
Can someone tell me if RHEL-6 is planned to have support for Xenner?
Will this be built into qemu? Otherwise what are options for using
Xenner with RHEL-5? We want to run both KVM and Xen guests managed by
KVM hypervisor.
15 years
[libvirt] [PATCH] New APIs for checking some object properties
by Daniel P. Berrange
Introduce a number of new APIs to expose some boolean properties
of objects, which cannot otherwise reliably determined, nor are
aspects of the XML configuration.
* virDomainIsActive: Checking virDomainGetID is not reliable
since it is not possible to distinguish between error condition
and inactive domain for ID of -1.
* virDomainIsPersistent: Check whether a persistent config exists
for the domain
* virNetworkIsActive: Check whether the network is active
* virNetworkIsPersistent: Check whether a persistent config exists
for the network
* virStoragePoolIsActive: Check whether the storage pool is active
* virStoragePoolIsPersistent: Check whether a persistent config exists
for the storage pool
* virInterfaceIsActive: Check whether the host interface is active
* virConnectIsSecure: whether the communication channel to the
hypervisor is secure
* virConnectIsEncrypted: whether any network based commnunication
channels are encrypted
NB, a channel can be secure, even if not encrypted, eg if it does
not involve the network, like a UNIX socket, or pipe.
---
include/libvirt/libvirt.h.in | 16 +++
src/libvirt.c | 298 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 314 insertions(+), 0 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 6186d4e..05a164b 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -1649,6 +1649,22 @@ int virStreamAbort(virStreamPtr st);
int virStreamFree(virStreamPtr st);
+int virDomainIsActive(virDomainPtr dom);
+int virDomainIsPersistent(virDomainPtr dom);
+
+int virNetworkIsActive(virNetworkPtr net);
+int virNetworkIsPersistent(virNetworkPtr net);
+
+int virStoragePoolIsActive(virStoragePoolPtr pool);
+int virStoragePoolIsPersistent(virStoragePoolPtr pool);
+
+int virInterfaceIsActive(virInterfacePtr iface);
+
+int virConnectIsEncrypted(virConnectPtr conn);
+int virConnectIsSecure(virConnectPtr conn);
+
+
+
#ifdef __cplusplus
}
#endif
diff --git a/src/libvirt.c b/src/libvirt.c
index 9e87900..58ea514 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -10321,3 +10321,301 @@ int virStreamFree(virStreamPtr stream)
return (-1);
return (0);
}
+
+
+/**
+ * virDomainIsActive:
+ *
+ * Determine if the domain is currently running
+ *
+ * Returns > 0 if running, 0 if inactive, -1 on error
+ */
+int virDomainIsActive(virDomainPtr dom)
+{
+ DEBUG("dom=%p", dom);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECTED_DOMAIN(dom)) {
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ return (-1);
+ }
+ if (dom->conn->driver->domainIsActive) {
+ int ret;
+ ret = dom->conn->driver->domainIsActive(dom);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(dom->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(dom->conn);
+ return -1;
+}
+
+/**
+ * virDomainIsPersistent:
+ *
+ * Determine if the domain has a persistent configuration
+ *
+ * Returns > 0 if persistent, 0 if transient, -1 on error
+ */
+int virDomainIsPersistent(virDomainPtr dom)
+{
+ DEBUG("dom=%p", dom);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECTED_DOMAIN(dom)) {
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ return (-1);
+ }
+ if (dom->conn->driver->domainIsPersistent) {
+ int ret;
+ ret = dom->conn->driver->domainIsPersistent(dom);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(dom->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(dom->conn);
+ return -1;
+}
+
+/**
+ * virNetworkIsActive:
+ *
+ * Determine if the network is currently running
+ *
+ * Returns > 0 if running, 0 if inactive, -1 on error
+ */
+int virNetworkIsActive(virNetworkPtr net)
+{
+ DEBUG("net=%p", net);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECTED_NETWORK(net)) {
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ return (-1);
+ }
+ if (net->conn->networkDriver->networkIsActive) {
+ int ret;
+ ret = net->conn->networkDriver->networkIsActive(net);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(net->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(net->conn);
+ return -1;
+}
+
+
+/**
+ * virNetworkIsPersistent:
+ *
+ * Determine if the network has a persistent configuration
+ *
+ * Returns > 0 if persistent, 0 if transient, -1 on error
+ */
+int virNetworkIsPersistent(virNetworkPtr net)
+{
+ DEBUG("net=%p", net);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECTED_NETWORK(net)) {
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ return (-1);
+ }
+ if (net->conn->networkDriver->networkIsPersistent) {
+ int ret;
+ ret = net->conn->networkDriver->networkIsPersistent(net);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(net->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(net->conn);
+ return -1;
+}
+
+
+/**
+ * virStoragepoolIsActive:
+ *
+ * Determine if the storagepool is currently running
+ *
+ * Returns > 0 if running, 0 if inactive, -1 on error
+ */
+int virStoragePoolIsActive(virStoragePoolPtr pool)
+{
+ DEBUG("pool=%p", pool);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ return (-1);
+ }
+ if (pool->conn->storageDriver->poolIsActive) {
+ int ret;
+ ret = pool->conn->storageDriver->poolIsActive(pool);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(pool->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(pool->conn);
+ return -1;
+}
+
+
+/**
+ * virStoragepoolIsPersistent:
+ *
+ * Determine if the storagepool has a persistent configuration
+ *
+ * Returns > 0 if persistent, 0 if transient, -1 on error
+ */
+int virStoragePoolIsPersistent(virStoragePoolPtr pool)
+{
+ DEBUG("pool=%p", pool);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ return (-1);
+ }
+ if (pool->conn->storageDriver->poolIsPersistent) {
+ int ret;
+ ret = pool->conn->storageDriver->poolIsPersistent(pool);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(pool->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(pool->conn);
+ return -1;
+}
+
+
+/**
+ * virInterfaceIsActive:
+ *
+ * Determine if the interface is currently running
+ *
+ * Returns > 0 if running, 0 if inactive, -1 on error
+ */
+int virInterfaceIsActive(virInterfacePtr iface)
+{
+ DEBUG("iface=%p", iface);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECTED_INTERFACE(iface)) {
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ return (-1);
+ }
+ if (iface->conn->interfaceDriver->interfaceIsActive) {
+ int ret;
+ ret = iface->conn->interfaceDriver->interfaceIsActive(iface);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(iface->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(iface->conn);
+ return -1;
+}
+
+
+/**
+ * virConnectIsEncrypted:
+ *
+ * Determine if the connection to the hypervisor is encrypted
+ *
+ * Returns > 0 if running, 0 if inactive, -1 on error
+ */
+int virConnectIsEncrypted(virConnectPtr conn)
+{
+ DEBUG("conn=%p", conn);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECT(conn)) {
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ return (-1);
+ }
+ if (conn->driver->isEncrypted) {
+ int ret;
+ ret = conn->driver->isEncrypted(conn);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(conn);
+ return -1;
+}
+
+/**
+ * virConnectIsSecure:
+ *
+ * Determine if the connection to the hypervisor is secure
+ *
+ * A connection will be classed as secure if it is either
+ * encrypted, or running over a channel which is not exposed
+ * to eavesdropping (eg a UNIX domain socket, or pipe)
+ *
+ * Returns > 0 if running, 0 if inactive, -1 on error
+ */
+int virConnectIsSecure(virConnectPtr conn)
+{
+ DEBUG("conn=%p", conn);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECT(conn)) {
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ return (-1);
+ }
+ if (conn->driver->isSecure) {
+ int ret;
+ ret = conn->driver->isSecure(conn);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(conn);
+ return -1;
+}
--
1.6.2.5
15 years