ia64/xen-unstable

diff tools/libxen/include/xen_vbd_type.h @ 14045:7819d9332fba

Split the VBD I/O statistics out into a VBD_metrics class. Document the
VBD.type field, and add it to the C bindings (this was already in Xend).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Feb 20 21:28:19 2007 +0000 (2007-02-20)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/libxen/include/xen_vbd_type.h	Tue Feb 20 21:28:19 2007 +0000
     1.3 @@ -0,0 +1,77 @@
     1.4 +/*
     1.5 + * Copyright (c) 2006-2007, XenSource Inc.
     1.6 + *
     1.7 + * This library is free software; you can redistribute it and/or
     1.8 + * modify it under the terms of the GNU Lesser General Public
     1.9 + * License as published by the Free Software Foundation; either
    1.10 + * version 2.1 of the License, or (at your option) any later version.
    1.11 + *
    1.12 + * This library is distributed in the hope that it will be useful,
    1.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.15 + * Lesser General Public License for more details.
    1.16 + *
    1.17 + * You should have received a copy of the GNU Lesser General Public
    1.18 + * License along with this library; if not, write to the Free Software
    1.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
    1.20 + */
    1.21 +
    1.22 +#ifndef XEN_VBD_TYPE_H
    1.23 +#define XEN_VBD_TYPE_H
    1.24 +
    1.25 +
    1.26 +#include "xen_common.h"
    1.27 +
    1.28 +
    1.29 +enum xen_vbd_type
    1.30 +{
    1.31 +    /**
    1.32 +     * VBD will appear to guest as CD
    1.33 +     */
    1.34 +    XEN_VBD_TYPE_CD,
    1.35 +
    1.36 +    /**
    1.37 +     * VBD will appear to guest as disk
    1.38 +     */
    1.39 +    XEN_VBD_TYPE_DISK
    1.40 +};
    1.41 +
    1.42 +
    1.43 +typedef struct xen_vbd_type_set
    1.44 +{
    1.45 +    size_t size;
    1.46 +    enum xen_vbd_type contents[];
    1.47 +} xen_vbd_type_set;
    1.48 +
    1.49 +/**
    1.50 + * Allocate a xen_vbd_type_set of the given size.
    1.51 + */
    1.52 +extern xen_vbd_type_set *
    1.53 +xen_vbd_type_set_alloc(size_t size);
    1.54 +
    1.55 +/**
    1.56 + * Free the given xen_vbd_type_set.  The given set must have been
    1.57 + * allocated by this library.
    1.58 + */
    1.59 +extern void
    1.60 +xen_vbd_type_set_free(xen_vbd_type_set *set);
    1.61 +
    1.62 +
    1.63 +/**
    1.64 + * Return the name corresponding to the given code.  This string must
    1.65 + * not be modified or freed.
    1.66 + */
    1.67 +extern const char *
    1.68 +xen_vbd_type_to_string(enum xen_vbd_type val);
    1.69 +
    1.70 +
    1.71 +/**
    1.72 + * Return the correct code for the given string, or set the session
    1.73 + * object to failure and return an undefined value if the given string does
    1.74 + * not match a known code.
    1.75 + */
    1.76 +extern enum xen_vbd_type
    1.77 +xen_vbd_type_from_string(xen_session *session, const char *str);
    1.78 +
    1.79 +
    1.80 +#endif