ia64/xen-unstable

view xen/acm/acm_null_hooks.c @ 15452:f152e44325a7

xenconsoled: improve robustness of logfile handling

Check the 'log_reload' on every iteration of the select() loop, not just when
select() returns EINTR. This is because the log reload signal may have
iterrupted a syscall other than select & thus without this change we
might miss the reload signal. The second change makes us process the
hypervisor logs on every iteration of the loop, not just upon timeouts.
This is because if a guest VM were consistently sending some log message
and < 1 second period, the select() would never hit the 1 second timeout
and thus never process the HV logs.

Thanks to Markus Armbruster for pointing out both these edge cases

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
author Keir Fraser <keir@xensource.com>
date Wed Jun 27 21:05:54 2007 +0100 (2007-06-27)
parents 4677ee247aa9
children
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_test_binary_policy(u8 *buf, u32 buf_size, int is_bootpolicy,
37 struct acm_sized_buffer *errors)
38 {
39 return ACM_OK;
40 }
42 static int
43 null_set_binary_policy(u8 *buf, u32 buf_size)
44 {
45 return ACM_OK;
46 }
48 static int
49 null_dump_stats(u8 *buf, u16 buf_size)
50 {
51 /* no stats for NULL policy */
52 return 0;
53 }
55 static int
56 null_dump_ssid_types(ssidref_t ssidref, u8 *buffer, u16 buf_size)
57 {
58 /* no types */
59 return 0;
60 }
63 /* now define the hook structure similarly to LSM */
64 struct acm_operations acm_null_ops = {
65 .init_domain_ssid = null_init_domain_ssid,
66 .free_domain_ssid = null_free_domain_ssid,
67 .dump_binary_policy = null_dump_binary_policy,
68 .test_binary_policy = null_test_binary_policy,
69 .set_binary_policy = null_set_binary_policy,
70 .dump_statistics = null_dump_stats,
71 .dump_ssid_types = null_dump_ssid_types,
72 /* domain management control hooks */
73 .domain_create = NULL,
74 .domain_destroy = NULL,
75 /* event channel control hooks */
76 .pre_eventchannel_unbound = NULL,
77 .fail_eventchannel_unbound = NULL,
78 .pre_eventchannel_interdomain = NULL,
79 .fail_eventchannel_interdomain = NULL,
80 /* grant table control hooks */
81 .pre_grant_map_ref = NULL,
82 .fail_grant_map_ref = NULL,
83 .pre_grant_setup = NULL,
84 .fail_grant_setup = NULL
85 };
87 /*
88 * Local variables:
89 * mode: C
90 * c-set-style: "BSD"
91 * c-basic-offset: 4
92 * tab-width: 4
93 * indent-tabs-mode: nil
94 * End:
95 */