ia64/xen-unstable

annotate 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
rev   line source
ewan@14045 1 /*
ewan@14045 2 * Copyright (c) 2006-2007, XenSource Inc.
ewan@14045 3 *
ewan@14045 4 * This library is free software; you can redistribute it and/or
ewan@14045 5 * modify it under the terms of the GNU Lesser General Public
ewan@14045 6 * License as published by the Free Software Foundation; either
ewan@14045 7 * version 2.1 of the License, or (at your option) any later version.
ewan@14045 8 *
ewan@14045 9 * This library is distributed in the hope that it will be useful,
ewan@14045 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ewan@14045 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ewan@14045 12 * Lesser General Public License for more details.
ewan@14045 13 *
ewan@14045 14 * You should have received a copy of the GNU Lesser General Public
ewan@14045 15 * License along with this library; if not, write to the Free Software
ewan@14045 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
ewan@14045 17 */
ewan@14045 18
ewan@14045 19 #ifndef XEN_VBD_TYPE_H
ewan@14045 20 #define XEN_VBD_TYPE_H
ewan@14045 21
ewan@14045 22
ewan@14045 23 #include "xen_common.h"
ewan@14045 24
ewan@14045 25
ewan@14045 26 enum xen_vbd_type
ewan@14045 27 {
ewan@14045 28 /**
ewan@14045 29 * VBD will appear to guest as CD
ewan@14045 30 */
ewan@14045 31 XEN_VBD_TYPE_CD,
ewan@14045 32
ewan@14045 33 /**
ewan@14045 34 * VBD will appear to guest as disk
ewan@14045 35 */
ewan@14045 36 XEN_VBD_TYPE_DISK
ewan@14045 37 };
ewan@14045 38
ewan@14045 39
ewan@14045 40 typedef struct xen_vbd_type_set
ewan@14045 41 {
ewan@14045 42 size_t size;
ewan@14045 43 enum xen_vbd_type contents[];
ewan@14045 44 } xen_vbd_type_set;
ewan@14045 45
ewan@14045 46 /**
ewan@14045 47 * Allocate a xen_vbd_type_set of the given size.
ewan@14045 48 */
ewan@14045 49 extern xen_vbd_type_set *
ewan@14045 50 xen_vbd_type_set_alloc(size_t size);
ewan@14045 51
ewan@14045 52 /**
ewan@14045 53 * Free the given xen_vbd_type_set. The given set must have been
ewan@14045 54 * allocated by this library.
ewan@14045 55 */
ewan@14045 56 extern void
ewan@14045 57 xen_vbd_type_set_free(xen_vbd_type_set *set);
ewan@14045 58
ewan@14045 59
ewan@14045 60 /**
ewan@14045 61 * Return the name corresponding to the given code. This string must
ewan@14045 62 * not be modified or freed.
ewan@14045 63 */
ewan@14045 64 extern const char *
ewan@14045 65 xen_vbd_type_to_string(enum xen_vbd_type val);
ewan@14045 66
ewan@14045 67
ewan@14045 68 /**
ewan@14045 69 * Return the correct code for the given string, or set the session
ewan@14045 70 * object to failure and return an undefined value if the given string does
ewan@14045 71 * not match a known code.
ewan@14045 72 */
ewan@14045 73 extern enum xen_vbd_type
ewan@14045 74 xen_vbd_type_from_string(xen_session *session, const char *str);
ewan@14045 75
ewan@14045 76
ewan@14045 77 #endif