ia64/xen-unstable

view xen/acm/acm_null_hooks.c @ 10718:3cdb93867f81

Domain ID/index mapping in xenmon.

This patch addresses the problem of xenbaked/xenmon not dealing with
large domain ID's. Xen Domain ID's increase monotonically as domains
are created; The ID's are not (often) recycled. Xenbaked was using the
domain
ID's as indices to arrays of data, and this scheme blows up as soon as
a domain ID exceeds the array size. Code has been changed in xenbaked
and xenmon to isolate domain id's from array indices, so everything is
indirect. Users should not notice any difference in behavior.

From: Rob Gardner <rob.gardner@hp.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Jul 10 16:09:20 2006 +0100 (2006-07-10)
parents 1e40bed176d4
children 4434d1039a65
line source
1 /****************************************************************
2 * acm_null_hooks.c
3 *
4 * Copyright (C) 2005 IBM Corporation
5 *
6 * Author:
7 * Reiner Sailer <sailer@watson.ibm.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation, version 2 of the
12 * License.
13 */
15 #include <acm/acm_hooks.h>
17 static int
18 null_init_domain_ssid(void **ssid, ssidref_t ssidref)
19 {
20 return ACM_OK;
21 }
23 static void
24 null_free_domain_ssid(void *ssid)
25 {
26 return;
27 }
29 static int
30 null_dump_binary_policy(u8 *buf, u32 buf_size)
31 {
32 return 0;
33 }
35 static int
36 null_set_binary_policy(u8 *buf, u32 buf_size)
37 {
38 return ACM_OK;
39 }
41 static int
42 null_dump_stats(u8 *buf, u16 buf_size)
43 {
44 /* no stats for NULL policy */
45 return 0;
46 }
48 static int
49 null_dump_ssid_types(ssidref_t ssidref, u8 *buffer, u16 buf_size)
50 {
51 /* no types */
52 return 0;
53 }
56 /* now define the hook structure similarly to LSM */
57 struct acm_operations acm_null_ops = {
58 .init_domain_ssid = null_init_domain_ssid,
59 .free_domain_ssid = null_free_domain_ssid,
60 .dump_binary_policy = null_dump_binary_policy,
61 .set_binary_policy = null_set_binary_policy,
62 .dump_statistics = null_dump_stats,
63 .dump_ssid_types = null_dump_ssid_types,
64 /* domain management control hooks */
65 .pre_domain_create = NULL,
66 .post_domain_create = NULL,
67 .fail_domain_create = NULL,
68 .post_domain_destroy = NULL,
69 /* event channel control hooks */
70 .pre_eventchannel_unbound = NULL,
71 .fail_eventchannel_unbound = NULL,
72 .pre_eventchannel_interdomain = NULL,
73 .fail_eventchannel_interdomain = NULL,
74 /* grant table control hooks */
75 .pre_grant_map_ref = NULL,
76 .fail_grant_map_ref = NULL,
77 .pre_grant_setup = NULL,
78 .fail_grant_setup = NULL
79 };
81 /*
82 * Local variables:
83 * mode: C
84 * c-set-style: "BSD"
85 * c-basic-offset: 4
86 * tab-width: 4
87 * indent-tabs-mode: nil
88 * End:
89 */