[Libvir] PATCH: Force close of virConnectPtr if client quits abnormally
by Daniel P. Berrange
If a remote client quits abnormally (or if the server forcably drops a
client for misbehaviing), it is possible that the virConnectPtr object
is not closed. This leads to a build up of active connections in the
server. The attached patch simply calls virConnectClose when killing off
a client connection if there is a non-NULL client->conn object.
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
17 years, 3 months
[Libvir] [PATCH] Add the check of the device source
by Masayuki Sunou
Hi
If specified device source does not exist,
Not appropriate error is displayed.
----------------------------------------------------------------------
# virsh attach-disk PV_FC7_14 NOT_EXIST_PATH xvdd
libvir: Xen Daemon error : POST operation failed: (xend.err 'Device
51760 (vbd) could not be connected. Hotplug scripts not working.')
----------------------------------------------------------------------
This patch checks the existence of the device source path,
and correct message is displayed in case of error.
Signed-off-by: Masayuki Sunou <fj1826dm(a)aa.jp.fujitsu.com>
Thanks,
Masayuki Sunou.
--------------------------------------------------------------------------------
Index: include/libvirt/virterror.h
===================================================================
RCS file: /data/cvs/libvirt/include/libvirt/virterror.h,v
retrieving revision 1.26
diff -u -p -r1.26 virterror.h
--- include/libvirt/virterror.h 6 Jul 2007 14:56:15 -0000 1.26
+++ include/libvirt/virterror.h 12 Jul 2007 00:07:27 -0000
@@ -127,6 +127,7 @@ typedef enum {
VIR_WAR_NO_NETWORK, /* failed to start network */
VIR_ERR_NO_DOMAIN, /* domain not found or unexpectedly disappeared */
VIR_ERR_NO_NETWORK, /* network not found */
+ VIR_ERR_NO_DEVICE_SOURCE, /* device source not found */
} virErrorNumber;
/**
Index: src/virterror.c
===================================================================
RCS file: /data/cvs/libvirt/src/virterror.c,v
retrieving revision 1.28
diff -u -p -r1.28 virterror.c
--- src/virterror.c 6 Jul 2007 14:56:15 -0000 1.28
+++ src/virterror.c 12 Jul 2007 00:07:28 -0000
@@ -646,6 +646,12 @@ __virErrorMsg(virErrorNumber error, cons
else
errmsg = _("Network not found: %s");
break;
+ case VIR_ERR_NO_DEVICE_SOURCE:
+ if (info == NULL)
+ errmsg = _("Device source not found");
+ else
+ errmsg = _("Device source not found: %s");
+ break;
}
return (errmsg);
}
Index: src/xml.c
===================================================================
RCS file: /data/cvs/libvirt/src/xml.c,v
retrieving revision 1.81
diff -u -p -r1.81 xml.c
--- src/xml.c 11 Jul 2007 08:41:11 -0000 1.81
+++ src/xml.c 12 Jul 2007 00:07:28 -0000
@@ -18,6 +18,7 @@
#include <xs.h>
#endif
#include <math.h> /* for isnan() */
+#include <sys/stat.h>
#include "internal.h"
#include "hash.h"
#include "sexpr.h"
@@ -720,6 +721,7 @@ virDomainParseXMLDiskDesc(virConnectPtr
int cdrom = 0;
int isNoSrcCdrom = 0;
int ret = 0;
+ struct stat st;
type = xmlGetProp(node, BAD_CAST "type");
if (type != NULL) {
@@ -772,6 +774,12 @@ virDomainParseXMLDiskDesc(virConnectPtr
ret = -1;
goto cleanup;
}
+ } else {
+ if (stat(source, &st) == -1) {
+ virXMLError(conn, VIR_ERR_NO_DEVICE_SOURCE, (const char *) source, 0);
+ ret = -1;
+ goto cleanup;
+ }
}
if (target == NULL) {
virXMLError(conn, VIR_ERR_NO_TARGET, (const char *) source, 0);
17 years, 3 months
[Libvir] [PATCH] If ./configure --enable-debug=yes, print libvirt calls
by Richard W.M. Jones
This can prove useful if we want to track down problems like the
double-call of domainSuspend.
Also attached below is the output of virt-manager when this tracing is
enabled.
Note that if --enable-debug is not set, then no extra code is added to
libvirt.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virInitialize ()
libvirt: virConnectOpen (name=xen)
libvirt: do_open: proceeding with name=xen:///
libvirt: do_open: trying driver 0 (Test) ...
libvirt: do_open: driver 0 returned DECLINED
libvirt: do_open: trying driver 1 (QEMU) ...
libvirt: do_open: driver 1 returned DECLINED
libvirt: do_open: trying driver 2 (Xen) ...
libvirt: do_open: driver 2 returned SUCCESS
libvir: Remote error : No such file or directory
libvir: warning : Failed to find the network: Is the daemon running ?
libvirt: virConnectNumOfNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfNetworks
libvirt: virConnectNumOfDefinedNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfDefinedNetworks
libvirt: virConnectListDomains (conn=0x1052760, ids=0x7fff3a55c510, maxids=500)
libvirt: virConnectNumOfDefinedDomains (conn=0x1052760)
libvirt: virDomainLookupByID (conn=0x1052760, id=0)
libvirt: virDomainGetUUID (domain=0x104c660, uuid=0x7fff3a55ccd0)
libvirt: virDomainLookupByID (conn=0x1052760, id=12)
libvirt: virDomainGetUUID (domain=0x105a510, uuid=0x7fff3a55ccd0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55c400)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55c400)
libvirt: virNodeGetInfo (conn=0x1052760, info=0x7fff3a55cca0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55cad0)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55cad0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetName (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetName (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectGetType (conn=0x1052760)
libvirt: virConnectGetType (conn=0x1052760)
libvirt: virConnectNumOfNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfNetworks
libvirt: virConnectNumOfDefinedNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfDefinedNetworks
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectListDomains (conn=0x1052760, ids=0x7fff3a55c010, maxids=500)
libvirt: virConnectNumOfDefinedDomains (conn=0x1052760)
libvirt: virNodeGetInfo (conn=0x1052760, info=0x7fff3a55c7a0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectNumOfNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfNetworks
libvirt: virConnectNumOfDefinedNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfDefinedNetworks
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectListDomains (conn=0x1052760, ids=0x7fff3a55c010, maxids=500)
libvirt: virConnectNumOfDefinedDomains (conn=0x1052760)
libvirt: virNodeGetInfo (conn=0x1052760, info=0x7fff3a55c7a0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectNumOfNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfNetworks
libvirt: virConnectNumOfDefinedNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfDefinedNetworks
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectListDomains (conn=0x1052760, ids=0x7fff3a55c010, maxids=500)
libvirt: virConnectNumOfDefinedDomains (conn=0x1052760)
libvirt: virNodeGetInfo (conn=0x1052760, info=0x7fff3a55c7a0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectNumOfNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfNetworks
libvirt: virConnectNumOfDefinedNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfDefinedNetworks
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectListDomains (conn=0x1052760, ids=0x7fff3a55c010, maxids=500)
libvirt: virConnectNumOfDefinedDomains (conn=0x1052760)
libvirt: virNodeGetInfo (conn=0x1052760, info=0x7fff3a55c7a0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectNumOfNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfNetworks
libvirt: virConnectNumOfDefinedNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfDefinedNetworks
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectListDomains (conn=0x1052760, ids=0x7fff3a55c010, maxids=500)
libvirt: virConnectNumOfDefinedDomains (conn=0x1052760)
libvirt: virNodeGetInfo (conn=0x1052760, info=0x7fff3a55c7a0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainSuspend (domain=0x105a510)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55bab0)
libvirt: virConnectNumOfNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfNetworks
libvirt: virConnectNumOfDefinedNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfDefinedNetworks
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectListDomains (conn=0x1052760, ids=0x7fff3a55c010, maxids=500)
libvirt: virConnectNumOfDefinedDomains (conn=0x1052760)
libvirt: virNodeGetInfo (conn=0x1052760, info=0x7fff3a55c7a0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectNumOfNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfNetworks
libvirt: virConnectNumOfDefinedNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfDefinedNetworks
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectListDomains (conn=0x1052760, ids=0x7fff3a55c010, maxids=500)
libvirt: virConnectNumOfDefinedDomains (conn=0x1052760)
libvirt: virNodeGetInfo (conn=0x1052760, info=0x7fff3a55c7a0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectNumOfNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfNetworks
libvirt: virConnectNumOfDefinedNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfDefinedNetworks
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectListDomains (conn=0x1052760, ids=0x7fff3a55c010, maxids=500)
libvirt: virConnectNumOfDefinedDomains (conn=0x1052760)
libvirt: virNodeGetInfo (conn=0x1052760, info=0x7fff3a55c7a0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainResume (domain=0x105a510)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55bab0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectNumOfNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfNetworks
libvirt: virConnectNumOfDefinedNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfDefinedNetworks
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectListDomains (conn=0x1052760, ids=0x7fff3a55c010, maxids=500)
libvirt: virConnectNumOfDefinedDomains (conn=0x1052760)
libvirt: virNodeGetInfo (conn=0x1052760, info=0x7fff3a55c7a0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectNumOfNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfNetworks
libvirt: virConnectNumOfDefinedNetworks (conn=0x1052760)
libvir: error : this function is not supported by the hypervisor: virConnectNumOfDefinedNetworks
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virConnectListDomains (conn=0x1052760, ids=0x7fff3a55c010, maxids=500)
libvirt: virConnectNumOfDefinedDomains (conn=0x1052760)
libvirt: virNodeGetInfo (conn=0x1052760, info=0x7fff3a55c7a0)
libvirt: virDomainGetInfo (domain=0x104c660, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetInfo (domain=0x105a510, info=0x7fff3a55c5d0)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x105a510)
libvirt: virDomainGetID (domain=0x104c660)
libvirt: virDomainGetID (domain=0x105a510)
17 years, 3 months
[Libvir] [PATCH] Get rid of QEMUD_PID_FILE
by Richard W.M. Jones
It is no longer used by the code.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
17 years, 3 months
[Libvir] Double call to domainSuspend callback
by Bruce.Evans@Sun.COM
Hi,
I have implemented the 'domainSuspend' callback in
libvirt for my hypervisor (see test.c or qemu_internal.c for reference)
When using the Red Hat Virtual Manager (after connecting
to my hypervisor), clicking on a domain row,
then clicking the 'open' button at the botton right of the
window, I get a new window where I can click the 'Pause'
button for instance.
When I do this, the 'domainSuspend' callback is entered
twice as shown in my debug code below.
Why is this happening? Is it a bug?
So somewhere in the RHVM python code, this call is
getting activated twice.
Thanks,
-Bruce
--> 1st time: DBG: ldomsDomainSuspend(ENTER) name=ldom1
**send_ldom_lifecycle_action..(ENTER) ldom_name=ldom1, action=2
****create_xml_file_4_ldom_action(ENTER), ldom=ldom1, action=stop-domain
**send_xml_file_to_ldm(ENTER)..
**open_ldm_connection(ENTER)
**open_ldm_connection..LDM_INIT_ACK from zeus, Minor sent=0, Minor rcvd=0
**create_pkt_buf(ENTER)
**get_response(ENTER)
**get_response..received 341 bytes for rsp body
**handle_resp(ENTER)
**close_ldm_connection..trying to close LDM socket=18
****parse_xml_get_response_status(ENTER)
****parse_xml_get_response_status.. <response><status> is success
DBG: ldomsDomainGetInfo(ENTER) dom=ldom1
DBG: getDomainIndex(ENTER) domID=1, ldom_cnt=4
DBG: getDomainIndex(EXIT) domidx=1
DBG: ldomsDomainGetInfo() domidx=1
DBG: ldomsDomainGetInfo() ldomName=ldom1
DBG: ldomsDomainGetInfo() ldomState=1
--> 2nd time: DBG: ldomsDomainSuspend(ENTER) name=ldom1
**send_ldom_lifecycle_action..(ENTER) ldom_name=ldom1, action=2
****create_xml_file_4_ldom_action(ENTER), ldom=ldom1, action=stop-domain
**send_xml_file_to_ldm(ENTER)..
**open_ldm_connection(ENTER)
**open_ldm_connection..LDM_INIT_ACK from zeus, Minor sent=0, Minor rcvd=0
**create_pkt_buf(ENTER)
**get_response(ENTER)
**get_response..received 391 bytes for rsp body
**handle_resp(ENTER)
**close_ldm_connection..trying to close LDM socket=18
****parse_xml_get_response_status(ENTER)
****parse_xml_get_response_status.. <response><status>=failure
****parse_xml_get_response_status.. No <resp_msg> tag
**send_ldom_active_mgmt.. failure response from received xml
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/console.py", line 390, in
control_vm_pause
self.vm.suspend()
File "/usr/share/virt-manager/virtManager/domain.py", line 365, in
suspend
self.vm.suspend()
File "/usr/lib/python2.4/vendor-packages/libvirt.py", line 350, in
suspend
if ret == -1: raise libvirtError ('virDomainSuspend() failed',
dom=self)
libvirt.libvirtError: virDomainSuspend() failed
17 years, 3 months
[Libvir] Re: Virtualization things.
by Richard W.M. Jones
[Moved to libvir-list. The original thread was on fedora-devel-list,
starting here:
https://www.redhat.com/archives/fedora-devel-list/2007-July/thread.html#0...]
Till Maas wrote:
> On Di Juli 10 2007, Richard W.M. Jones wrote:
>> Till Maas wrote:
>>> The idea is imho great, but for me with qemu it does not work properly.
>> I'd really like to help out here. Did you get any error messages?
>
> The first problem is, that it seems to be a tool to create persisten virtual
> machines, e.g. virtual servers, but most of the time I only want to boot a
> live cd, e.g. a Fedora one. But virt-manager seems to demand an virtual HD
> drive. I only tested it twice or so, but it looked not promising.
The next version of virt-install will support this explicitly. I am
reliably assured that it should work in qemu & Xen.
Support is not there yet in virt-manager.
> What I did so far was creating a new machine with a Fedora Live CD Image and
> booted it. When I hit the Pause button, it appeared to be pressed, but
> nothing happened. The machine still responded and the following error
> appeared on the commandline, where I started virt-manager:
>
> -------------
> libvir: QEMU error : operation failed: suspend operation failed
> Traceback (most recent call last):
> File "/usr/share/virt-manager/virtManager/console.py", line 389, in
> control_vm_pause
> self.vm.suspend()
> File "/usr/share/virt-manager/virtManager/domain.py", line 365, in suspend
> self.vm.suspend()
> File "/usr/lib/python2.5/site-packages/libvirt.py", line 350, in suspend
> if ret == -1: raise libvirtError ('virDomainSuspend() failed', dom=self)
> libvirt.libvirtError: virDomainSuspend() failed operation failed: suspend
> operation failed
> --------------
This is a bug. Do you know what version of libvirt & virt-manager this
happens with? Suspend _ought_ to work with QEMU with libvirt >= 0.2.0.
> Then when I shut down the machine and clicked on "run", it did not boot the
> ISO Image I selected while creating the machine, but only complained that it
> could not boot from HD (which is true, because I did not install anything to
> the HD)
>
> Then I wanted to delete the machine, but the "Delete" button was still greyed
> out, even when I shut it down (Imho it should be available all the time and
> provide a warning that the machine needs to be shut down before it can be
> deleted). When I closed virt-manager and opened it again, then I was able to
> delete the machine.
>
> But I cannot find a way to add an iso image to the machine or make it boot the
> iso image I selected at creation time.
I haven't played with live CDs & virt-manager at all, but I'll have a
go. What live CD were you trying?
> Also the network selection seems not to work, when I want to add a network
> interface, I can choose between virtual and shared device, but both only have
> an empty list, where I have to select something to be able to click
> on "Forward".
This is another bug. If you get me the version of virt-manager, I'll
look into it.
> I guess you cannot help here very much, because it seems to me that
> virt-manager just needs a lot of coding, to become as userfriendly as
> VirtualBox is.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
17 years, 4 months
[Libvir] [PATCH] Fix memory leak on virDomainParseXMLDiskDesc()
by Masayuki Sunou
Hi
I found some memory leaks in xml.c
--> Missing release of drvType and drvName in virDomainParseXMLDiskDesc().
This patch fixes it.
Signed-off-by: Masayuki Sunou <fj1826dm(a)aa.jp.fujitsu.com>
Thanks,
Masayuki Sunou.
--------------------------------------------------------------------------------
Index: src/xml.c
===================================================================
RCS file: /data/cvs/libvirt/src/xml.c,v
retrieving revision 1.80
diff -u -p -r1.80 xml.c
--- src/xml.c 4 Jul 2007 09:16:23 -0000 1.80
+++ src/xml.c 11 Jul 2007 07:51:17 -0000
@@ -719,6 +719,7 @@ virDomainParseXMLDiskDesc(virConnectPtr
int typ = 0;
int cdrom = 0;
int isNoSrcCdrom = 0;
+ int ret = 0;
type = xmlGetProp(node, BAD_CAST "type");
if (type != NULL) {
@@ -768,21 +769,14 @@ virDomainParseXMLDiskDesc(virConnectPtr
}
if (!isNoSrcCdrom) {
virXMLError(conn, VIR_ERR_NO_SOURCE, (const char *) target, 0);
-
- if (target != NULL)
- xmlFree(target);
- if (device != NULL)
- xmlFree(device);
- return (-1);
+ ret = -1;
+ goto cleanup;
}
}
if (target == NULL) {
virXMLError(conn, VIR_ERR_NO_TARGET, (const char *) source, 0);
- if (source != NULL)
- xmlFree(source);
- if (device != NULL)
- xmlFree(device);
- return (-1);
+ ret = -1;
+ goto cleanup;
}
/* Xend (all versions) put the floppy device config
@@ -861,12 +855,17 @@ virDomainParseXMLDiskDesc(virConnectPtr
virBufferAdd(buf, ")", 1);
cleanup:
- xmlFree(drvType);
- xmlFree(drvName);
- xmlFree(device);
- xmlFree(target);
- xmlFree(source);
- return (0);
+ if(drvType)
+ xmlFree(drvType);
+ if(drvName)
+ xmlFree(drvName);
+ if(device)
+ xmlFree(device);
+ if(target)
+ xmlFree(target);
+ if(source)
+ xmlFree(source);
+ return (ret);
}
/**
17 years, 4 months
[Libvir] Howto: install libvirt on Debian Etch (the ugly way)
by Roman Ammann
Hello list
I read on the list that other people tried to install libvirt on Debian
Etch. I finally succeeded so I'll post a little Howto. Maybe someone
with a better understanding of automake and C stuff knows a nicer way
but the ugly folder with the links to the different header files.
The start point is a Debian Etch with a running Xen (in my case it's the
xen-hypervisor-3.0.3-1-i386-pae package). If you're not using the PAE
version of the xen-hypervisor change the "apt-get source" line
accordingly.
First you will need to install a bunch of development packages
apt-get install build-essential libxml2-dev libncurses5-dev
apt-get isntall libreadline5-dev python-dev
Go to your home directory and install the Xen hypervisor sources
cd
apt-get source xen-hypervisor-3.0.3-1-i386-pae
Create a folder with a bunch of symbolic links. We will use this folder
libvirt to find the header files.
mkdir libvirt-include
cd libvirt-include/
ln -s /root/xen-3.0-3.0.3-0/xen/include/public/xen.h
ln -s /root/xen-3.0-3.0.3-0/tools/xenstore/xs.h
ln -s /root/xen-3.0-3.0.3-0/tools/xenstore/xs_lib.h
ln -s /root/xen-3.0-3.0.3-0/xen/include/public xen
ln -s /root/xen-3.0-3.0.3-0/linux-2.6-xen-sparse/include/xen/public/ xen/linux
Configure the dynamic linker that it will be able to find the libxenstore library
echo '/usr/lib/xen-3.0.3-1/lib' > /etc/ld.so.conf.d/i486-linux-gnu.conf
ldconfig
Go to your home directory, download an extract the libvirt source package
cd
wget http://libvirt.org/sources/libvirt-0.2.3.tar.gz
tar xvfz libvirt-0.2.3.tar.gz
cd libvirt-0.2.3
Configure, build and install the libvirt
CFLAGS="-fno-stack-protector -I/root/libvirt-include -L/usr/lib/xen-3.0.3-1/lib" ./configure --with-xen --without-qemu
make
make install
Enable the Unix socket server for xend. Edit /etc/xen/xend-config.sxp and change the line
#(xend-unix-server no)
to
(xend-unix-server yes)
Restart your Xen-Daemon
/etc/init.d/xend restart
If everything work you should see your running virtual machines when you enter
virsh list
Regards Roman
17 years, 4 months
[Libvir] Updating an existing libvirt installation
by Omer Khalid
Hi,
I am wondering if its possible to upgrade an existing libvirt installation
to a newer version. Actually one of my clients is still have
libvirt-0.1.8while my software works ver
0.1.9 upwards.
Many thanks for your help,
Cheers
Omer
--
----------------------------------------------------------
CERN – European Organization for Nuclear
Research, IT Department, CH-1211
Geneva 23, Switzerland
Phone: +41 (0) 22 767 2224
Fax: +41 (0) 22 766 8683
E-mail : Omer.Khalid(a)cern.ch
Homepage: http://cern.ch/Omer.Khalid
17 years, 4 months
[Libvir] Release of libvirt-0.3.0
by Daniel Veillard
Considering the amount of changes available in CVS, a release was in
order plus increasing the minor release number was also making sense.
The package is available at
ftp://libvirt.org/libvirt/
The main change is the secure remote support at the API level thanks to
Richard Jones, look at the specific page to get informations on what
is available and how to set up the certificates needed for authentication:
http://libvirt.org/remote.html
it's worth also looking at the URI documentation to see how to build the
connection URI strings
http://libvirt.org/uri.html
Last thing, the background daemon has been renamed between versions 0.2.3
and the current version from libvirt_qemud to libvirtd since it now also serve
for the remote support, so when upgrading the package it's a good idea
to stop first the libvirt service, do the upgrade and then restart the service
otherwise you may end up with a old version of the daemon running.
This release includes a lot of changes:
+ Secure Remote support (Richard Jones).
See the remote page of the documentation
+ Documentation:
- remote support (Richard Jones)
- description of the URI connection strings (Richard Jones)
- update of virsh man page
- matrix of libvirt API/hypervisor support with version
informations (Richard Jones)
+ Bug fixes:
- examples Makefile.am generation (Richard Jones)
- SetMem fix (Mark Johnson)
- URI handling and ordering of drivers (Daniel Berrange)
- fix virsh help without hypervisor (Richard Jones)
- id marshalling fix (Daniel Berrange)
- fix virConnectGetMaxVcpus on remote (Richard Jones)
- avoid a realloc leak (Jim Meyering)
- scheduler parameters handling for Xen (Richard Jones)
- various early remote bug fixes (Richard Jones)
- remove virsh leaks of domains references (Masayuki Sunou)
- configCache refill bug (Richard Jones)
- fix XML serialization bugs
+ Improvements:
- QEmu switch to XDR-based protocol (Dan Berrange)
- device attach/detach commands (Masayuki Sunou)
- OCaml bindings (Richard Jones)
- new entry points virDomainGetConnect and virNetworkGetConnect
useful for bindings (Richard Jones)
- reunitifaction of remote and qemu daemon under a single libvirtd with
a config file (Daniel Berrange)
+ Cleanups:
- parsing of connection URIs (Richard Jones)
- messages from virsh (Saori Fukuta)
- Coverage files (Daniel Berrange)
- Solaris fixes (Mark Johnson)
- avoid [r]index calls (Richard Jones)
- release information in Xen backend
- virsh cpupin command cleanups (Masayuki Sunou)
- xen:/// suppport as standard Xen URI (Richard Jones and Daniel Berrange)
- improve driver selection/decline mechanism (Richard Jones)
- error reporting on XML dump (Richard Jones)
- Remove unused virDomainKernel structure (Richard Jones)
- daemon event loop event handling (Daniel Berrange)
- various unifications cleanup in the daemon merging (Daniel Berrange)
- internal file and timer monitoring API (Daniel Berrange)
- remove libsysfs dependancy
- call brctl program directly (Daniel Berrange)
- virBuffer functions cleanups (Richard Jones)
- make init script LSB compliant
- error handling on lookup functions (Richard Jones)
- remove internal virGetDomainByID (Richard Jones)
- revamp of xen subdrivers interfaces (Richard Jones)
+ Localization updates
Thanks to everybody who helped for this release, with code, bug reports
or suggestions !
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
17 years, 4 months