WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] compat tool problem with new tmem save/restore tmem_op struc

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: [Xen-devel] compat tool problem with new tmem save/restore tmem_op struct
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Tue, 28 Jul 2009 11:00:41 -0700 (PDT)
Cc: "Xen-Devel \(E-mail\)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 28 Jul 2009 11:01:29 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Jan --

I'm trying to implement save/restore code for tmem
and to do so I need to pass other variants of the
tmem_op struct between tools (dom0) and the hypervisor
so I made the changes below to struct tmem_op.
Unfortunately the nested union seems to break your compat
translation tool.  Is this an easy fix for your
tool?  If not, I suppose I can recode to only
use a single level of union.

Thanks,
Dan

P.S. I tried renaming the nested "u" to "u2" but
it still causes the same problem.

struct tmem_op {
    uint32_t cmd;
    int32_t pool_id; /* private > 0; shared < 0; 0 is invalid */
    union {
        struct {  /* for cmd == TMEM_NEW_POOL */
            uint64_t uuid[2];
            uint32_t flags;
        } new;
        struct {
            uint64_t object;
            uint32_t index;
            uint32_t tmem_offset;
            uint32_t pfn_offset;
            uint32_t len;
            tmem_cli_mfn_t cmfn; /* client machine page frame */
        } gen;
        struct {  /* for cmd == TMEM_CONTROL */
            uint32_t subop;
            uint32_t cli_id;
            tmem_cli_va_t buf;
            union {
                struct {
                    uint32_t arg1;
                    uint32_t arg2;
                } gen;
                struct {
                    uint32_t flags;
                    uint64_t uuid[2];
                } new; /* also used for auth */
                struct {
                    uint64_t oid;
                    uint32_t index;
                    uint32_t bufsize;
                } restore;
                struct {
                    tmem_cli_va_t p_pool_id;
                    tmem_cli_va_t p_oid;
                    tmem_cli_va_t p_index;
                    uint32_t bufsize;
                } save;
            } u;
        } ctrl;
    } u;
};

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel