rpms/libvirt/FC-5 libvirt_0.1.7_mlock.patch, NONE, 1.1 libvirt.spec, 1.15, 1.16

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Oct 31 15:58:56 UTC 2006


Author: veillard

Update of /cvs/dist/rpms/libvirt/FC-5
In directory cvs.devel.redhat.com:/tmp/cvs-serv29180

Modified Files:
	libvirt.spec 
Added Files:
	libvirt_0.1.7_mlock.patch 
Log Message:
Adding mlock fixup from FC6, 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);


Index: libvirt.spec
===================================================================
RCS file: /cvs/dist/rpms/libvirt/FC-5/libvirt.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- libvirt.spec	2 Oct 2006 14:32:47 -0000	1.15
+++ libvirt.spec	31 Oct 2006 15:58:54 -0000	1.16
@@ -1,7 +1,7 @@
 Summary: Library providing an API to use the Xen virtualization
 Name: libvirt
 Version: 0.1.7
-Release: 2.FC5
+Release: 3.FC5
 License: LGPL
 Group: Development/Libraries
 Source: libvirt-%{version}.tar.gz
@@ -19,6 +19,7 @@
 BuildRequires: xen >= 3.0.2-4.FC5
 Obsoletes: libvir
 ExclusiveArch: i386 x86_64
+Patch0: libvirt_0.1.7_mlock.patch
 
 %description
 This C library provides an API to use the Xen virtualization framework,
@@ -48,6 +49,7 @@
 
 %prep
 %setup -q
+%patch0 -p0
 
 %build
 %configure
@@ -109,6 +111,9 @@
 %doc docs/examples/python
 
 %changelog
+* Tue Oct 31 2006 Daniel Veillard <veillard at redhat.com> 0.1.7-3.FC5
+- fix mlock size when getting domain info list from hypervisor
+
 * Mon Oct  2 2006 Daniel Veillard <veillard at redhat.com> 0.1.7-2.FC5
 - rebuilt against xen-3.0.2-4.FC5
 




More information about the fedora-cvs-commits mailing list