[libvirt] [PATCH 1/6] domMemoryStats: Add domainMemoryStats method to struct _virDriver
by Adam Litke
Set up the types for the domainMemoryStats function and insert it into the
virDriver structure definition. Because of static initializers, update every
driver and set the new field to NULL.
Note: The changes in python/* are to fix compiler errors. The actual python
binding is implemented in a later patch.
Signed-off-by: Adam Litke <agl(a)us.ibm.com>
To: Daniel Veillard <veillard(a)redhat.com>
Cc: Daniel P. Berrange <berrange(a)redhat.com>
Cc: libvirt list <libvir-list(a)redhat.com>
---
include/libvirt/libvirt.h.in | 53 ++++++++++++++++++++++++++++++++++++++++++
python/generator.py | 4 ++-
src/driver.h | 7 +++++
src/esx/esx_driver.c | 1 +
src/lxc/lxc_driver.c | 1 +
src/opennebula/one_driver.c | 1 +
src/openvz/openvz_driver.c | 1 +
src/phyp/phyp_driver.c | 1 +
src/qemu/qemu_driver.c | 1 +
src/remote/remote_driver.c | 1 +
src/test/test_driver.c | 1 +
src/uml/uml_driver.c | 1 +
src/vbox/vbox_tmpl.c | 1 +
src/xen/xen_driver.c | 1 +
14 files changed, 74 insertions(+), 1 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 6c3aded..820bf98 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -333,6 +333,55 @@ struct _virDomainInterfaceStats {
*/
typedef virDomainInterfaceStatsStruct *virDomainInterfaceStatsPtr;
+/**
+ * Memory Statistics Tags:
+ */
+typedef enum {
+ /* The total amount of data read from swap space (in kB). */
+ VIR_DOMAIN_MEMORY_STAT_SWAP_IN = 0,
+ /* The total amount of memory written out to swap space (in kB). */
+ VIR_DOMAIN_MEMORY_STAT_SWAP_OUT = 1,
+
+ /*
+ * Page faults occur when a process makes a valid access to virtual memory
+ * that is not available. When servicing the page fault, if disk IO is
+ * required, it is considered a major fault. If not, it is a minor fault.
+ * These are expressed as the number of faults that have occurred.
+ */
+ VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT = 2,
+ VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT = 3,
+
+ /*
+ * The amount of memory left completely unused by the system. Memory that
+ * is available but used for reclaimable caches should NOT be reported as
+ * free. This value is expressed in kB.
+ */
+ VIR_DOMAIN_MEMORY_STAT_UNUSED = 4,
+
+ /*
+ * The total amount of usable memory as seen by the domain. This value
+ * may be less than the amount of memory assigned to the domain if a
+ * balloon driver is in use or if the guest OS does not initialize all
+ * assigned pages. This value is expressed in kB.
+ */
+ VIR_DOMAIN_MEMORY_STAT_AVAILABLE = 5,
+
+ /*
+ * The number of statistics supported by this version of the interface.
+ * To add new statistics, add them to the enum and increase this value.
+ */
+ VIR_DOMAIN_MEMORY_STAT_NR = 6,
+} virDomainMemoryStatTags;
+
+typedef struct _virDomainMemoryStat virDomainMemoryStatStruct;
+
+struct _virDomainMemoryStat {
+ int tag;
+ unsigned long long val;
+};
+
+typedef virDomainMemoryStatStruct *virDomainMemoryStatPtr;
+
/* Domain core dump flags. */
typedef enum {
@@ -644,6 +693,10 @@ int virDomainInterfaceStats (virDomainPtr dom,
const char *path,
virDomainInterfaceStatsPtr stats,
size_t size);
+int virDomainMemoryStats (virDomainPtr dom,
+ virDomainMemoryStatPtr stats,
+ unsigned int nr_stats,
+ unsigned int flags);
int virDomainBlockPeek (virDomainPtr dom,
const char *path,
unsigned long long offset,
diff --git a/python/generator.py b/python/generator.py
index 3fd7f90..06f1ff4 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -160,7 +160,8 @@ def enum(type, name, value):
functions_failed = []
functions_skipped = [
- "virConnectListDomains"
+ "virConnectListDomains",
+ "virDomainMemoryStats"
]
skipped_modules = {
@@ -170,6 +171,7 @@ skipped_types = {
# 'int *': "usually a return type",
'virConnectDomainEventCallback': "No function types in python",
'virEventAddHandleFunc': "No function types in python",
+ 'virDomainMemoryStatPtr': "Not implemented yet",
}
#######################################################################
diff --git a/src/driver.h b/src/driver.h
index 09ce8e2..6193e47 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -229,6 +229,12 @@ typedef int
struct _virDomainInterfaceStats *stats);
typedef int
+ (*virDrvDomainMemoryStats)
+ (virDomainPtr domain,
+ struct _virDomainMemoryStat *stats,
+ unsigned int nr_stats);
+
+typedef int
(*virDrvDomainBlockPeek)
(virDomainPtr domain,
const char *path,
@@ -419,6 +425,7 @@ struct _virDriver {
virDrvDomainMigrateFinish domainMigrateFinish;
virDrvDomainBlockStats domainBlockStats;
virDrvDomainInterfaceStats domainInterfaceStats;
+ virDrvDomainMemoryStats domainMemoryStats;
virDrvDomainBlockPeek domainBlockPeek;
virDrvDomainMemoryPeek domainMemoryPeek;
virDrvNodeGetCellsFreeMemory nodeGetCellsFreeMemory;
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index ea464a3..2626162 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -3412,6 +3412,7 @@ static virDriver esxDriver = {
esxDomainMigrateFinish, /* domainMigrateFinish */
NULL, /* domainBlockStats */
NULL, /* domainInterfaceStats */
+ NULL, /* domainMemoryStats */
NULL, /* domainBlockPeek */
NULL, /* domainMemoryPeek */
NULL, /* nodeGetCellsFreeMemory */
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index c8e2dca..ff998c7 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -2438,6 +2438,7 @@ static virDriver lxcDriver = {
NULL, /* domainMigrateFinish */
NULL, /* domainBlockStats */
lxcDomainInterfaceStats, /* domainInterfaceStats */
+ NULL, /* domainMemoryStats */
NULL, /* domainBlockPeek */
NULL, /* domainMemoryPeek */
nodeGetCellsFreeMemory, /* nodeGetCellsFreeMemory */
diff --git a/src/opennebula/one_driver.c b/src/opennebula/one_driver.c
index a30c110..a4ad31e 100644
--- a/src/opennebula/one_driver.c
+++ b/src/opennebula/one_driver.c
@@ -765,6 +765,7 @@ static virDriver oneDriver = {
NULL, /* domainMigrateFinish */
NULL, /* domainBlockStats */
NULL, /* domainInterfaceStats */
+ NULL, /* domainMemoryStats */
NULL, /* domainBlockPeek */
NULL, /* domainMemoryPeek */
NULL, /* nodeGetCellsFreeMemory */
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 1c0fccc..7acce5b 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -1517,6 +1517,7 @@ static virDriver openvzDriver = {
NULL, /* domainMigrateFinish */
NULL, /* domainBlockStats */
NULL, /* domainInterfaceStats */
+ NULL, /* domainMemoryStats */
NULL, /* domainBlockPeek */
NULL, /* domainMemoryPeek */
NULL, /* nodeGetCellsFreeMemory */
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index c4fcfed..07adccb 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -1633,6 +1633,7 @@ virDriver phypDriver = {
NULL, /* domainMigrateFinish */
NULL, /* domainBlockStats */
NULL, /* domainInterfaceStats */
+ NULL, /* domainMemoryStats */
NULL, /* domainBlockPeek */
NULL, /* domainMemoryPeek */
NULL, /* nodeGetCellsFreeMemory */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9ef6c35..1ddc23e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7907,6 +7907,7 @@ static virDriver qemuDriver = {
NULL, /* domainMigrateFinish */
qemudDomainBlockStats, /* domainBlockStats */
qemudDomainInterfaceStats, /* domainInterfaceStats */
+ NULL, /* domainMemoryStats */
qemudDomainBlockPeek, /* domainBlockPeek */
qemudDomainMemoryPeek, /* domainMemoryPeek */
nodeGetCellsFreeMemory, /* nodeGetCellsFreeMemory */
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 77962fe..5d32d3b 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -8814,6 +8814,7 @@ static virDriver remote_driver = {
remoteDomainMigrateFinish, /* domainMigrateFinish */
remoteDomainBlockStats, /* domainBlockStats */
remoteDomainInterfaceStats, /* domainInterfaceStats */
+ NULL, /* domainMemoryStats */
remoteDomainBlockPeek, /* domainBlockPeek */
remoteDomainMemoryPeek, /* domainMemoryPeek */
remoteNodeGetCellsFreeMemory, /* nodeGetCellsFreeMemory */
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 7db9a4c..21ea491 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -5220,6 +5220,7 @@ static virDriver testDriver = {
NULL, /* domainMigrateFinish */
testDomainBlockStats, /* domainBlockStats */
testDomainInterfaceStats, /* domainInterfaceStats */
+ NULL, /* domainMemoryStats */
NULL, /* domainBlockPeek */
NULL, /* domainMemoryPeek */
testNodeGetCellsFreeMemory, /* nodeGetCellsFreeMemory */
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 48ef103..035ed0c 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -1906,6 +1906,7 @@ static virDriver umlDriver = {
NULL, /* domainMigrateFinish */
NULL, /* domainBlockStats */
NULL, /* domainInterfaceStats */
+ NULL, /* domainMemoryStats */
umlDomainBlockPeek, /* domainBlockPeek */
NULL, /* domainMemoryPeek */
nodeGetCellsFreeMemory, /* nodeGetCellsFreeMemory */
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index d6b681c..e2e1ce6 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -7028,6 +7028,7 @@ virDriver NAME(Driver) = {
NULL, /* domainMigrateFinish */
NULL, /* domainBlockStats */
NULL, /* domainInterfaceStats */
+ NULL, /* domainMemoryStats */
NULL, /* domainBlockPeek */
NULL, /* domainMemoryPeek */
nodeGetCellsFreeMemory, /* nodeGetCellsFreeMemory */
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index ed94bed..e952610 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -1844,6 +1844,7 @@ static virDriver xenUnifiedDriver = {
xenUnifiedDomainMigrateFinish, /* domainMigrateFinish */
xenUnifiedDomainBlockStats, /* domainBlockStats */
xenUnifiedDomainInterfaceStats, /* domainInterfaceStats */
+ NULL, /* domainMemoryStats */
xenUnifiedDomainBlockPeek, /* domainBlockPeek */
NULL, /* domainMemoryPeek */
xenUnifiedNodeGetCellsFreeMemory, /* nodeGetCellsFreeMemory */
--
1.6.5
14 years, 11 months
[libvirt] [PATCH] Fix typo in qemudDomainAttachHostPciDevice()
by Jiri Denemark
The 'if' statement is supposed to check return value of
pci = pciGetDevice(conn, ...);
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 890aa84..60dea9c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5290,7 +5290,7 @@ static int qemudDomainAttachHostPciDevice(virConnectPtr conn,
hostdev->source.subsys.u.pci.bus,
hostdev->source.subsys.u.pci.slot,
hostdev->source.subsys.u.pci.function);
- if (!dev)
+ if (!pci)
return -1;
if ((hostdev->managed && pciDettachDevice(conn, pci) < 0) ||
--
1.6.6.rc4
14 years, 11 months
[libvirt] Executing scripts when bridge interface becomes available
by Felix Schwarz
Hi,
I'm using libvirt on a CentOS 5.4 host (so my libvirt is quite old) with a
routed setup. My configuration is easy and works reliable as far as I can tell
now.
As far as I know, I have to add routes manually (so that the host knows which
IPs need to be routed to the virbr1). My ip command looks like this:
/sbin/ip route add <guest ip> dev virbr1 scope link
Currently I have really problems finding the right spot where I should
configure the routes and it looks like libvirt does not offer any support for
that.
1. I can add the route when my network comes up because virbr1 is not
available at that time.
2. If I switch my vm to the 'ethernet' interface, I can use a custom script
but then I have to do all the network setup myself which looks like
overkill and time-consuming (as I have to rebuild things that libvirt
already does perfectly). I just want to add some routes...
To me the perfect solution would be either:
a) have start/stop scripts defined in the network configuration
b) have start/stop scripts defined in the vm configuration
- Does libvirt 0.7 offer things like that? (I could not find something in the
documentation)
- Is there an obvious way that I missed when it comes to route configuration?
fs
14 years, 11 months
Re: [libvirt] New libvirt API for domain memory statistics reporting (V4)
by Daniel Veillard
On Fri, Dec 18, 2009 at 01:17:03PM -0500, Adam Litke wrote:
> Daniel, this should be ready for you to merge...
Okidoc, done !
There was a bit of tweaking since this conflicted with another new API,
but this was eay to solve. I double checked the new
src/remote/remote_protocol.x description and that looks fine,
I think the only thing missing is a description of the new virsh command
in tools/virsh.pod and I think this will be complete. Ah and other
bindings need to be updated to export the new function, but that's
seaparate.
thanks !
Daniel
> Changes since V3:
> * Fixed remote_protocol.x so rpcgen generates the right code
> * Updated stat constants and names in python api
> * Incorporate flags into the rpc wire format
>
> Changes since V2:
> * Ported to GIT HEAD for easier merging :)
> * Amounts of memory are now reported in kilobytes
> * Added flags parameter to API (currently unused)
> * Moved to less awkward xdr wire format for remote driver
> * Stats 'Free' and 'Total' renamed to 'Unused' and 'Available'
> * Various small fixups: constant names, data types, etc
>
> Changes since V1:
> * New system for maintaining ABI compatibility and API extensibility:
> Rather than passing around a fixed-size stats structure, work with arrays
> of stats. An enum of known statistic tags (SWAP_IN, SWAP_OUT, TOTAL_MEM,
> etc) is defined. A stat is defined as a tag/value pair. When making a
> call to the API, the caller provides an array of stats and the size of the
> array. That array is filled with up to the requested number of stats
> (depending on hypervisor and guest support). The number of stats provided
> is returned.
>
> * Miscellaneous changes:
> Changed the API function from virDomainMemStats to virDomainMemoryStats
> Added documentation for each memory stat
>
> --
>
> When using ballooning to manage overcommitted memory on a host, a system for
> guests to communicate their memory usage to the host can provide information
> that will minimize the impact of ballooning on the guests while maximizing
> efficient use of host memory.
>
> The design of such a communication channel was recently added to version 0.8.2
> of the VirtIO Spec (See Appendix G):
> - http://ozlabs.org/~rusty/virtio-spec/virtio-spec-0.8.2.pdf
>
> Host-side and guest-side implementations have been accepted for inclusion in
> their respective projects:
> - Guest: http://lkml.org/lkml/2009/11/30/274
> - Host: http://lists.gnu.org/archive/html/qemu-devel/2009-12/msg00380.html
>
> The following patch series implements a new libvirt interface to expose these
> memory statistics. Thank you for your review and comments.
>
>
> [PATCH 1/6] domMemoryStats: Add domainMemoryStats method to struct _virDriver
> [PATCH 2/6] domMemoryStats: Add public symbol to libvirt API
> [PATCH 3/6] qemu-driver: Enable domainMemStats in the qemu driver
> [PATCH 4/6] remote-driver: Add domainMemoryStats support
> [PATCH 5/6] virsh: Enable virDomainMemoryStats as a new command
> [PATCH 6/6] python: Add python bindings for virDomainMemoryStats
--
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/
14 years, 11 months
[libvirt] [PATCH 00/13] esx: Automatic question handling and other improvements
by Matthias Bolte
Automatic question handling is the most important part of this series,
see src/esx/README for more details.
Matthias Bolte (13):
esx: Add automatic question handling
esx: Improve domain lookup by UUID
esx: Use more suitable error code in esxVI_LookupVirtualMachineByUuid()
esx: Replace libxml1 'xmlChildrenNode' with libxml2 'children'
esx: Removed unused inttypes.h include
esx: Extend vCenter query parameter
esx: Extend documentation about 'vcenter' and add some about 'auto_answer'
esx: Fix occurence typo
esx: Use occurrence enum to specify expected result of a SOAP call
esx: Don't warn about '/' paths
esx: Undefine virtual machine on a vCenter if available
esx: Destroy virtual machine on a vCenter if available
esx: Add more links to external documentation
docs/drvesx.html.in | 52 ++++-
src/esx/README | 77 +++++++
src/esx/esx_driver.c | 533 +++++++++++++++++++++++---------------------
src/esx/esx_util.c | 22 ++-
src/esx/esx_util.h | 2 +-
src/esx/esx_vi.c | 546 ++++++++++++++++++++++++++++++++++++++++------
src/esx/esx_vi.h | 53 ++++-
src/esx/esx_vi_methods.c | 185 ++++++++++++----
src/esx/esx_vi_methods.h | 7 +
src/esx/esx_vi_types.c | 231 +++++++++++++++++++-
src/esx/esx_vi_types.h | 106 +++++++++
src/esx/esx_vmx.c | 2 +-
12 files changed, 1420 insertions(+), 396 deletions(-)
create mode 100644 src/esx/README
14 years, 11 months
[libvirt] [PATCH] Fix compilation with gcrypt < 1.4.2
by Matthias Bolte
Commit 33a198c1f6a4a1bc7f34d50a31032e03bec10fee increased the gcrypt
version requirement to 1.4.2 because the GCRY_THREAD_OPTION_VERSION
define was added in this version.
The configure script doesn't check for the gcrypt version. To support
gcrypt versions < 1.4.2 change the virTLSThreadImpl initialization
to use GCRY_THREAD_OPTION_VERSION only if it's defined.
---
src/libvirt.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index cad33c2..937cdb4 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -291,7 +291,12 @@ static int virTLSMutexUnlock(void **priv)
}
static struct gcry_thread_cbs virTLSThreadImpl = {
+ /* GCRY_THREAD_OPTION_VERSION was added in gcrypt 1.4.2 */
+#ifdef GCRY_THREAD_OPTION_VERSION
(GCRY_THREAD_OPTION_PTHREAD | (GCRY_THREAD_OPTION_VERSION << 8)),
+#else
+ GCRY_THREAD_OPTION_PTHREAD,
+#endif
NULL,
virTLSMutexInit,
virTLSMutexDestroy,
--
1.6.0.4
14 years, 11 months
[libvirt] [PATCH 1/2] Don't make it possible to define HAVE_HAL but not enable it in automake.
by Diego Elio 'Flameeyes' Pettenò
With the previous logic, if libhal_get_all_devices function was not found,
HAVE_HAL would be defined for the preprocessor but it wouldn't be enabled
in automake conditionals, causing the final link to fail with missing
references to HAL entries.
---
configure.in | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/configure.in b/configure.in
index c86ee97..e2a0b00 100644
--- a/configure.in
+++ b/configure.in
@@ -1703,9 +1703,6 @@ if test "x$with_hal" = "xyes" -o "x$with_hal" = "xcheck"; then
fi
])
if test "x$with_hal" = "xyes" ; then
- AC_DEFINE_UNQUOTED([HAVE_HAL], 1,
- [use HAL for host device enumeration])
-
old_CFLAGS=$CFLAGS
old_LDFLAGS=$LDFLAGS
CFLAGS="$CFLAGS $HAL_CFLAGS"
@@ -1715,6 +1712,10 @@ if test "x$with_hal" = "xyes" -o "x$with_hal" = "xcheck"; then
CFLAGS="$old_CFLAGS"
LDFLAGS="$old_LDFLAGS"
fi
+ if test "x$with_hal" = "xyes" ; then
+ AC_DEFINE_UNQUOTED([HAVE_HAL], 1,
+ [use HAL for host device enumeration])
+ fi
fi
AM_CONDITIONAL([HAVE_HAL], [test "x$with_hal" = "xyes"])
AC_SUBST([HAL_CFLAGS])
--
1.6.6.rc3
14 years, 11 months
[libvirt] RE: [virt-tools-list] Questions about virt-manager running on Arch of Itanium 64
by Dustin Xiong
> Date: Mon, 30 Nov 2009 09:43:27 +0000
> From: rjones(a)redhat.com
> To: x_k_123(a)hotmail.com
> CC: berrange(a)redhat.com; virt-tools-list(a)redhat.com
> Subject: Re: [virt-tools-list] Questions about virt-manager running on Arch of Itanium 64
>
> On Mon, Nov 30, 2009 at 05:07:00PM +0800, Dustin Xiong wrote:
> > But when I run virsh ,it failed as below:
> > [root@kvm bin]# ./virsh
> > error: unable to connect to '/usr/local/dlibvirt/var/run/libvirt/libvirt-sock': No such file or directory
> ^^
> Is there really a 'd' in the path there?
>
> Anyway you can either change the default path that libvirt uses,
> by configuring it with:
>
> ./configure --prefix=/usr
>
> or you can change the socket path virsh uses at runtime with:
>
> ./virsh -c qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock
Thank you for your advice.
And I compiled the libvirt-0.7.4 again
./configure
make
make install
After reboot the machine, I run the binary virsh, the result is as below:
[root@kvm bin]#virsh
error: unable to connect to '/usr/local/var/run/libvirt/libvirt-sock': No such file or directory
error: failed to connect to the hypervisor
Then I run the virsh -c ,the result is as below:
[root@kvm bin]#virsh -c qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock
error: unable to connect to '/var/run/libvirt/libvirt-sock': No such file or directory
error: failed to connect to the hypervisor
At the same time, I found the libvird didn't running, I don't know whether this caused the error or not.
I don't know why this error occurs.
Maybe the reason is the libvirt didn't support the use kvm virtualization on ia64 as berrange said before.
But I modify the qemu_conf.c and add ia64 information into the struct arch_info_hvm.
Then compiled again. The errors remain.
Please forgive my poor program skills, I can't add the ia64 into the libvirt kvm supports.
Will you want to do some works on this?
Thanks a lot.
_________________________________________________________________
Windows Live Hotmail: Your friends can get your Facebook updates, right from Hotmail®.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/...
14 years, 11 months
[libvirt] [PATCH] Fix reporting of TLS connection errors
by Daniel P. Berrange
The code for connecting to a server tries each socket in turn
until it finds one that connects. Unfortunately for TLS sockets
if it connected, but failed TLS handshake it would treat that
as a failure to connect, and try the next socket. This is bad,
it should have reported the TLS failure immediately.
$ virsh -c qemu://somehost.com/system
error: unable to connect to libvirtd at 'somehost.com': Invalid argument
error: failed to connect to the hypervisor
$ ./tools/virsh -c qemu://somehost.com/system
error: server certificate failed validation: The certificate hasn't got a known issuer.
error: failed to connect to the hypervisor
* src/remote/remote_driver.c: Stop trying to connect if the
TLS handshake fails
---
src/remote/remote_driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 77962fe..584de36 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -632,7 +632,7 @@ doRemoteOpen (virConnectPtr conn,
if (!priv->session) {
close (priv->sock);
priv->sock = -1;
- continue;
+ goto failed;
}
}
goto tcp_connected;
--
1.6.5.2
14 years, 11 months
Re: [libvirt] getSchedulerParameters() always returning nullpointerexception in JAVA
by Frederic Dang Tran
Hi,
I came across the same problem: Domain.getSchedulerParameters() throws a NullPointerException systematically.
getSchedulerParameters
The culprit is the org.libvirt.jna.virSchedParameterValue class which should inherit from jna.Union instead of Structure:
public class virSchedParameterValue extends Union {
...
}
Regards,
Frederic
On 12/14/2009 04:22 AM, Marc Gonzalez Mateo wrote:
OK, let's see if Bryan has an idea/solution about this.
Thanks guys!
MARC
El 11/12/2009, a las 14:29, Daniel Veillard escribió:
On Fri, Dec 11, 2009 at 02:01:36PM +0100, Marc Gonzalez Mateo wrote:
Hi everyvody,
I'm developing a new API based on libvirt.
I'm currently stucked using getSchedulerParameters, always is returning a
nullpointerexception, no matter which Xen Domain I'm passing to the
function.
Enclosing both the code and the error console:
public int getCPUPriority(String name) {
int res=-1;
try {
Domain d = getDomain(name);
SchedParameter[] pars = d.getSchedulerParameters();
Hum, it seems
Domain.getSchedulerParameters()
does
SchedParameter[] returnValue = new SchedParameter[0];
and
public static SchedParameter create(virSchedParameter vParam) {
SchedParameter returnValue = null;
switch (vParam.type) {
case (1):
and the create method getting there gets a null pointer as the
initialization argument, which it first dereference ...
so not surprizing looking at the code, maybe Bryan has an idea of what
is going on there, I'm a bit lost in this initialization process ...
Daniel
for (SchedParameter pri : pars) {
if (pri.field=="weight")
res=Integer.parseInt(pri.getValueAsString());
}
} catch (LibvirtException e) {
log.error(" Error: getting CPU priority of \""+name+"\"." +
e.getClass());
e.printStackTrace();
}
return res;
}
Dec 11, 2009 1:04:18 PM net.emotivecloud.virtmonitor.VirtMonitor
getCPUCapacity
SEVERE: Error: getting CPU capacity of "XenTest".
java.lang.NullPointerException
at org.libvirt.SchedParameter.create(Unknown Source)
at org.libvirt.Domain.getSchedulerParameters(Unknown Source)
at
net.emotivecloud.virtmonitor.VirtMonitor.getCPUCapacity(VirtMonitor.java:462)
at net.emotivecloud.virtmonitor.VirtMonitor.main(VirtMonitor.java:763)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:283)
at java.lang.Thread.run(Thread.java:636)
Any ideas?
Thanks in advance,
Marc Gonzalez Mateo
--
Libvir-list mailing list
Libvir-list redhat com
https://www.redhat.com/mailman/listinfo/libvir-list
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
Frederic Dang Tran
14 years, 11 months