Xen device bus.
Definition in file xenbus.h.
| int xenbus_backend_wait |
( |
struct xen_device * | xendev, |
|
|
int | state ) |
|
extern |
Wait for backend to reach a given state.
- Parameters
-
| xendev | Xen device |
| state | Desired backend state |
- Return values
-
Definition at line 149 of file xenbus.c.
149 {
151 unsigned long elapsed;
152 unsigned int attempts = 0;
153 int current_state;
155
156
157 do {
158
159
161 if ( current_state < 0 ) {
164 }
165 if ( current_state ==
state )
166 return 0;
167
168
170
171
172
173
174
175
177 attempts++;
178
180
181
183 DBGC ( xendev,
"XENBUS %s timed out after %d attempts waiting for "
184 "%s/state=\"%d\": %s\n", xendev->
key, attempts, xendev->
backend,
186
188}
void cpu_nap(void)
Sleep with interrupts enabled until next CPU interrupt.
static int started
"startup() has been called" flag
unsigned long currticks(void)
Get current system time in ticks.
int xenbus_backend_state(struct xen_device *xendev)
Get backend state.
#define XENBUS_BACKEND_TIMEOUT
Maximum time to wait for backend to reach a given state, in ticks.
#define ETIMEDOUT_STATE(state)
References xen_device::backend, cpu_nap(), currticks(), DBGC, ETIMEDOUT_STATE, xen_device::key, rc, started, state, strerror(), xenbus_backend_state(), and XENBUS_BACKEND_TIMEOUT.
Referenced by netfront_open(), and netfront_reset().
Probe Xen bus.
- Parameters
-
| xen | Xen hypervisor |
| parent | Parent device |
- Return values
-
Definition at line 355 of file xenbus.c.
355 {
356 char *types;
360
361
364 DBGC ( xen,
"XENBUS could not list device types: %s\n",
366 goto err_directory;
367 }
368
369
373 goto err_probe_type;
374 }
375
377 return 0;
378
380 err_probe_type:
382 err_directory:
384}
uint32_t type
Operating system type.
static void(* free)(struct refcnt *refcnt))
size_t strlen(const char *src)
Get length of string.
void xenbus_remove(struct xen_hypervisor *xen __unused, struct device *parent)
Remove Xen bus.
static int xenbus_probe_type(struct xen_hypervisor *xen, struct device *parent, const char *type)
Probe Xen devices of a given type.
int xenstore_directory(struct xen_hypervisor *xen, char **children, size_t *len,...)
Read XenStore directory.
References DBGC, free, len, NULL, rc, strerror(), strlen(), type, xenbus_probe_type(), xenbus_remove(), and xenstore_directory().
Referenced by hvm_probe().