availdevs.c (c8e9ed14) availdevs.c (088e9d47)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 49 unchanged lines hidden (view full) ---

58 int i;
59 char tmp[64];
60 xmlNodePtr available = *((xmlNodePtr *)data);
61
62 xmlNodePtr disk = xmlNewChild(
63 available, NULL, (xmlChar *)ELEMENT_DISK, NULL);
64 xmlSetProp(disk,
65 (xmlChar *)ATTR_DISK_NAME, (xmlChar *)dp->name);
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 49 unchanged lines hidden (view full) ---

58 int i;
59 char tmp[64];
60 xmlNodePtr available = *((xmlNodePtr *)data);
61
62 xmlNodePtr disk = xmlNewChild(
63 available, NULL, (xmlChar *)ELEMENT_DISK, NULL);
64 xmlSetProp(disk,
65 (xmlChar *)ATTR_DISK_NAME, (xmlChar *)dp->name);
66 snprintf(tmp, sizeof (tmp), "%llu", dp->size);
66 (void) snprintf(tmp, sizeof (tmp), "%llu", dp->size);
67 xmlSetProp(disk, (xmlChar *)ATTR_DISK_SIZE, (xmlChar *)tmp);
68
69 if (dp->aliases != NULL) {
70 for (i = 0; dp->aliases[i] != NULL; i++) {
71 xmlNodePtr alias = xmlNewChild(
72 disk, NULL, (xmlChar *)ELEMENT_ALIAS, NULL);
73 xmlSetProp(alias,
74 (xmlChar *)ATTR_ALIAS_NAME,

--- 4 unchanged lines hidden (view full) ---

79 if (dp->slices != NULL) {
80 for (i = 0; dp->slices[i] != NULL; i++) {
81 dmgt_slice_t *sp = dp->slices[i];
82 xmlNodePtr slice = xmlNewChild(
83 disk, NULL, (xmlChar *)ELEMENT_SLICE, NULL);
84 xmlSetProp(slice,
85 (xmlChar *)ATTR_SLICE_NAME, (xmlChar *)sp->name);
86
67 xmlSetProp(disk, (xmlChar *)ATTR_DISK_SIZE, (xmlChar *)tmp);
68
69 if (dp->aliases != NULL) {
70 for (i = 0; dp->aliases[i] != NULL; i++) {
71 xmlNodePtr alias = xmlNewChild(
72 disk, NULL, (xmlChar *)ELEMENT_ALIAS, NULL);
73 xmlSetProp(alias,
74 (xmlChar *)ATTR_ALIAS_NAME,

--- 4 unchanged lines hidden (view full) ---

79 if (dp->slices != NULL) {
80 for (i = 0; dp->slices[i] != NULL; i++) {
81 dmgt_slice_t *sp = dp->slices[i];
82 xmlNodePtr slice = xmlNewChild(
83 disk, NULL, (xmlChar *)ELEMENT_SLICE, NULL);
84 xmlSetProp(slice,
85 (xmlChar *)ATTR_SLICE_NAME, (xmlChar *)sp->name);
86
87 snprintf(tmp, sizeof (tmp), "%llu", sp->size);
87 (void) snprintf(tmp, sizeof (tmp), "%llu", sp->size);
88 xmlSetProp(slice, (xmlChar *)ATTR_SLICE_SIZE,
89 (xmlChar *)tmp);
90
88 xmlSetProp(slice, (xmlChar *)ATTR_SLICE_SIZE,
89 (xmlChar *)tmp);
90
91 snprintf(tmp, sizeof (tmp), "%llu", sp->start);
91 (void) snprintf(tmp, sizeof (tmp), "%llu", sp->start);
92 xmlSetProp(slice, (xmlChar *)ATTR_SLICE_START,
93 (xmlChar *)tmp);
94
95 if (sp->used_name != NULL) {
96 xmlSetProp(slice,
97 (xmlChar *)ATTR_SLICE_USED_NAME,
98 (xmlChar *)sp->used_name);
99 }

--- 22 unchanged lines hidden (view full) ---

122
123 state = zjni_get_state_str(pool_state);
124 if (state == NULL) {
125 state = "";
126 }
127 xmlSetProp(pool, (xmlChar *)ATTR_POOL_STATE, (xmlChar *)state);
128 xmlSetProp(pool, (xmlChar *)ATTR_POOL_HEALTH, (xmlChar *)health);
129
92 xmlSetProp(slice, (xmlChar *)ATTR_SLICE_START,
93 (xmlChar *)tmp);
94
95 if (sp->used_name != NULL) {
96 xmlSetProp(slice,
97 (xmlChar *)ATTR_SLICE_USED_NAME,
98 (xmlChar *)sp->used_name);
99 }

--- 22 unchanged lines hidden (view full) ---

122
123 state = zjni_get_state_str(pool_state);
124 if (state == NULL) {
125 state = "";
126 }
127 xmlSetProp(pool, (xmlChar *)ATTR_POOL_STATE, (xmlChar *)state);
128 xmlSetProp(pool, (xmlChar *)ATTR_POOL_HEALTH, (xmlChar *)health);
129
130 snprintf(tmp, sizeof (tmp), "%llu", guid);
130 (void) snprintf(tmp, sizeof (tmp), "%llu", guid);
131 xmlSetProp(pool, (xmlChar *)ATTR_POOL_ID, (xmlChar *)tmp);
132
133 return (0);
134}
135
136static xmlDocPtr
137create_doc(void)
138{

--- 82 unchanged lines hidden ---
131 xmlSetProp(pool, (xmlChar *)ATTR_POOL_ID, (xmlChar *)tmp);
132
133 return (0);
134}
135
136static xmlDocPtr
137create_doc(void)
138{

--- 82 unchanged lines hidden ---