
On Thu, Sep 28, 2006 at 07:20:35PM +0100, Daniel P. Berrange wrote:
On Tue, Sep 19, 2006 at 12:12:19PM -0400, Daniel Veillard wrote:
On Wed, Sep 13, 2006 at 09:13:35PM -0400, Daniel Veillard wrote:
On Wed, Sep 13, 2006 at 12:55:01PM -0600, Jim Fehlig wrote:
I found that the buffer provided for XEN_V1_OP_GETDOMAININFOLIST hypercall differs slightly from the buffer in xen/dom0_ops.h.
ohh, that's quite possible I made a mistake in rebuilding the code, yes
Attached is a patch against current cvs that works for me, but I'm not familiar with this part of the code so not sure if this is the proper fix.
I will try to double check today or tomorrow as I'm on the road, thanks a lot for the patch.
Okay, I'm finally back, confirmed my error (sorry I should have tried a 32bit box too but had none handy with the old code). So applied and commited,
Urm, but this has now broken things on 32-bit 3.0.3 based Xen HV.
# virsh dominfo Domain-0 | grep CPU CPU(s): 115
And also
# virsh vcpuinfo Domain-0 libvir: Xen error : failed Xen syscall ioctl 3166208
Looks like we need different versions of this struct depending on which Xen we're working against.
This is really quite a nasty problem, because the struct is passed into from numerous locations in the xen_internal.h code & I didn't want to cover the entire source with conditionals. So what I've done is declared a new xen_v2_domaininfo struct which is the same as xen_v0_domaininfo, but with Jim's patch reverted again. Then provide two unions union xen_getdomaininfo { struct xen_v0_getdomaininfo v0; struct xen_v2_getdomaininfo v2; }; typedef union xen_getdomaininfo xen_getdomaininfo; union xen_getdomaininfolist { struct xen_v0_getdomaininfo *v0; struct xen_v2_getdomaininfo *v2; }; typedef union xen_getdomaininfolist xen_getdomaininfolist; The caller must populate & read either v0, or v2 as apropriate - to avoid ugly if (hypervisor_version < 2) ...v0... else ...v2... I define a bunhc of macros for accessing fields in these two unions. eg #define XEN_GETDOMAININFOLIST_DOMAIN(domlist, n) \ (hypervisor_version < 2 ? \ domlist.v0[n].domain : \ domlist.v2[n].domain) Or #define XEN_GETDOMAININFOLIST_CLEAR(domlist, size) \ (hypervisor_version < 2 ? \ memset(domlist.v0, 0, sizeof(xen_v0_getdomaininfo) * size) : \ memset(domlist.v2, 0, sizeof(xen_v2_getdomaininfo) * size)) Anyway, I'm attaching a patch which I've tested against 32-bit HV on both Xen 3.0.2 and 3.0.3, and also a 64-bit HV on 3.0.2 and 3.0.3 and all the operations now work correctly again... Regards, 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 -=|