rpms/libvirt/devel libvirt_0.1.7_mlock.patch, NONE, 1.1 libvirt_0.1.7_page_size.patch, NONE, 1.1 libvirt.spec, 1.34, 1.35
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Mon Oct 2 21:23:39 UTC 2006
Author: veillard
Update of /cvs/dist/rpms/libvirt/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv29035
Modified Files:
libvirt.spec
Added Files:
libvirt_0.1.7_mlock.patch libvirt_0.1.7_page_size.patch
Log Message:
Fixing 2 bugs found in 0.1.7, Daniel
libvirt_0.1.7_mlock.patch:
xen_internal.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
--- NEW FILE libvirt_0.1.7_mlock.patch ---
Index: src/xen_internal.c
===================================================================
RCS file: /data/cvs/libxen/src/xen_internal.c,v
retrieving revision 1.43
diff -u -r1.43 xen_internal.c
--- src/xen_internal.c 29 Sep 2006 16:12:08 -0000 1.43
+++ src/xen_internal.c 2 Oct 2006 22:11:46 -0000
@@ -145,7 +145,15 @@
domlist.v0[n].domain : \
domlist.v2[n].domain)
+#define XEN_GETDOMAININFOLIST_DATA(domlist) \
+ (hypervisor_version < 2 ? \
+ (void*)(domlist->v0) : \
+ (void*)(domlist->v2))
+#define XEN_GETDOMAININFO_SIZE \
+ (hypervisor_version < 2 ? \
+ sizeof(xen_v0_getdomaininfo) : \
+ sizeof(xen_v2_getdomaininfo))
#define XEN_GETDOMAININFO_CLEAR(dominfo) \
(hypervisor_version < 2 ? \
@@ -645,9 +653,10 @@
{
int ret = -1;
- if (mlock(dominfos, sizeof(xen_v0_getdomaininfo) * maxids) < 0) {
+ if (mlock(XEN_GETDOMAININFOLIST_DATA(dominfos),
+ XEN_GETDOMAININFO_SIZE * maxids) < 0) {
virXenError(VIR_ERR_XEN_CALL, " locking",
- sizeof(xen_v0_getdomaininfo) * maxids);
+ XEN_GETDOMAININFO_SIZE * maxids);
return (-1);
}
if (hypervisor_version > 1) {
@@ -687,9 +696,10 @@
if (ret == 0)
ret = op.u.getdomaininfolist.num_domains;
}
- if (munlock(dominfos, sizeof(xen_v0_getdomaininfo) * maxids) < 0) {
+ if (munlock(XEN_GETDOMAININFOLIST_DATA(dominfos),
+ XEN_GETDOMAININFO_SIZE * maxids) < 0) {
virXenError(VIR_ERR_XEN_CALL, " release",
- sizeof(xen_v0_getdomaininfo));
+ XEN_GETDOMAININFO_SIZE * maxids);
ret = -1;
}
return(ret);
libvirt_0.1.7_page_size.patch:
xen_internal.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
--- NEW FILE libvirt_0.1.7_page_size.patch ---
Index: src/xen_internal.c
===================================================================
RCS file: /data/cvs/libxen/src/xen_internal.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- src/xen_internal.c 28 Sep 2006 23:29:25 -0000 1.42
+++ src/xen_internal.c 29 Sep 2006 16:12:08 -0000 1.43
@@ -1489,6 +1489,13 @@
{
xen_getdomaininfo dominfo;
int ret;
+ static int kb_per_pages = 0;
+
+ if (kb_per_pages == 0) {
+ kb_per_pages = sysconf(_SC_PAGESIZE) / 1024;
+ if (kb_per_pages <= 0)
+ kb_per_pages = 4;
+ }
if ((conn == NULL) || (conn->handle < 0) || (info == NULL))
return (-1);
@@ -1527,8 +1534,8 @@
* kilobytes from page counts
*/
info->cpuTime = XEN_GETDOMAININFO_CPUTIME(dominfo);
- info->memory = XEN_GETDOMAININFO_TOT_PAGES(dominfo) * 4;
- info->maxMem = XEN_GETDOMAININFO_MAX_PAGES(dominfo) * 4;
+ info->memory = XEN_GETDOMAININFO_TOT_PAGES(dominfo) * kb_per_pages;
+ info->maxMem = XEN_GETDOMAININFO_MAX_PAGES(dominfo) * kb_per_pages;
info->nrVirtCpu = XEN_GETDOMAININFO_CPUCOUNT(dominfo);
return (0);
}
Index: libvirt.spec
===================================================================
RCS file: /cvs/dist/rpms/libvirt/devel/libvirt.spec,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- libvirt.spec 29 Sep 2006 09:32:55 -0000 1.34
+++ libvirt.spec 2 Oct 2006 21:23:36 -0000 1.35
@@ -3,7 +3,7 @@
Summary: Library providing an API to use the Xen virtualization
Name: libvirt
Version: 0.1.7
-Release: 1
+Release: 2
License: LGPL
Group: Development/Libraries
Source: libvirt-%{version}.tar.gz
@@ -21,6 +21,8 @@
BuildRequires: gettext
Obsoletes: libvir
ExclusiveArch: i386 x86_64 ia64
+Patch0: libvirt_0.1.7_page_size.patch
+Patch1: libvirt_0.1.7_mlock.patch
%description
This C library provides an API to use the Xen virtualization framework,
@@ -50,6 +52,8 @@
%prep
%setup -q
+%patch0 -p0
+%patch1 -p0
%build
%configure
@@ -111,7 +115,11 @@
%doc docs/examples/python
%changelog
-* Fri Sep 22 2007 Daniel Veillard <veillard at redhat.com> 0.1.7-1
+* Mon Oct 2 2006 Daniel Veillard <veillard at redhat.com> 0.1.7-2
+- fix missing page size detection code for ia64
+- fix mlock size when getting domain info list from hypervisor
+
+* Fri Sep 22 2006 Daniel Veillard <veillard at redhat.com> 0.1.7-1
- Fix bug when running against xen-3.0.3 hypercalls
- Fix memory bug when getting vcpus info from xend
More information about the fedora-cvs-commits
mailing list