xref: /titanic_41/usr/src/cmd/lvm/metassist/layout/layout_messages.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
28*7c478bd9Sstevel@tonic-gate 
29*7c478bd9Sstevel@tonic-gate #include <libintl.h>
30*7c478bd9Sstevel@tonic-gate #include <stdlib.h>
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #include "volume_error.h"
33*7c478bd9Sstevel@tonic-gate #include "volume_output.h"
34*7c478bd9Sstevel@tonic-gate #include "volume_string.h"
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #include "layout_messages.h"
37*7c478bd9Sstevel@tonic-gate 
38*7c478bd9Sstevel@tonic-gate /*
39*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_layout_volume_msg(char *type, uint64_t nbytes)
40*7c478bd9Sstevel@tonic-gate  *
41*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a generic message indicating the start of the
42*7c478bd9Sstevel@tonic-gate  *		layout process for a volume of the indicated type and
43*7c478bd9Sstevel@tonic-gate  *		capacity.
44*7c478bd9Sstevel@tonic-gate  */
45*7c478bd9Sstevel@tonic-gate void
print_layout_volume_msg(char * type,uint64_t nbytes)46*7c478bd9Sstevel@tonic-gate print_layout_volume_msg(
47*7c478bd9Sstevel@tonic-gate 	char *type,
48*7c478bd9Sstevel@tonic-gate 	uint64_t nbytes)
49*7c478bd9Sstevel@tonic-gate {
50*7c478bd9Sstevel@tonic-gate 	char *spstr = NULL;
51*7c478bd9Sstevel@tonic-gate 
52*7c478bd9Sstevel@tonic-gate 	(void) bytes_to_sizestr(nbytes, &spstr, universal_units, B_FALSE);
53*7c478bd9Sstevel@tonic-gate 
54*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_VERBOSE,
55*7c478bd9Sstevel@tonic-gate 		gettext("  ->Layout a %s with capacity %s\n"),
56*7c478bd9Sstevel@tonic-gate 		type, spstr);
57*7c478bd9Sstevel@tonic-gate 
58*7c478bd9Sstevel@tonic-gate 	free(spstr);
59*7c478bd9Sstevel@tonic-gate }
60*7c478bd9Sstevel@tonic-gate 
61*7c478bd9Sstevel@tonic-gate /*
62*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_layout_explicit_msg(char *type)
63*7c478bd9Sstevel@tonic-gate  *
64*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a generic message indicating the start of the
65*7c478bd9Sstevel@tonic-gate  *		layout population process using explicit components
66*7c478bd9Sstevel@tonic-gate  *		for a volume of the indicated type.
67*7c478bd9Sstevel@tonic-gate  */
68*7c478bd9Sstevel@tonic-gate void
print_layout_explicit_msg(char * type)69*7c478bd9Sstevel@tonic-gate print_layout_explicit_msg(
70*7c478bd9Sstevel@tonic-gate 	char *type)
71*7c478bd9Sstevel@tonic-gate {
72*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_TERSE,
73*7c478bd9Sstevel@tonic-gate 		gettext("  ->Layout a %s with explicitly specified "
74*7c478bd9Sstevel@tonic-gate 			"components\n"),
75*7c478bd9Sstevel@tonic-gate 		type);
76*7c478bd9Sstevel@tonic-gate }
77*7c478bd9Sstevel@tonic-gate 
78*7c478bd9Sstevel@tonic-gate /*
79*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_layout_explicit_added_msg(char *comp)
80*7c478bd9Sstevel@tonic-gate  *
81*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a generic message indicating the named component
82*7c478bd9Sstevel@tonic-gate  *		was added to a volume.
83*7c478bd9Sstevel@tonic-gate  */
84*7c478bd9Sstevel@tonic-gate void
print_layout_explicit_added_msg(char * comp)85*7c478bd9Sstevel@tonic-gate print_layout_explicit_added_msg(
86*7c478bd9Sstevel@tonic-gate 	char *comp)
87*7c478bd9Sstevel@tonic-gate {
88*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_TERSE, gettext("  ---->added '%s'\n"), comp);
89*7c478bd9Sstevel@tonic-gate }
90*7c478bd9Sstevel@tonic-gate 
91*7c478bd9Sstevel@tonic-gate /*
92*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_success_msg()
93*7c478bd9Sstevel@tonic-gate  *
94*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a generic layout success message.
95*7c478bd9Sstevel@tonic-gate  */
96*7c478bd9Sstevel@tonic-gate void
print_layout_success_msg()97*7c478bd9Sstevel@tonic-gate print_layout_success_msg()
98*7c478bd9Sstevel@tonic-gate {
99*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_TERSE, gettext("  <-Success!\n"));
100*7c478bd9Sstevel@tonic-gate }
101*7c478bd9Sstevel@tonic-gate 
102*7c478bd9Sstevel@tonic-gate /*
103*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_insufficient_resources_msg(char *type)
104*7c478bd9Sstevel@tonic-gate  *
105*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a message indicating that there are insufficient
106*7c478bd9Sstevel@tonic-gate  *		resources.
107*7c478bd9Sstevel@tonic-gate  *
108*7c478bd9Sstevel@tonic-gate  *		Also sets the metassist error string indicating why
109*7c478bd9Sstevel@tonic-gate  *		the metassist command failed.  The volume type is included
110*7c478bd9Sstevel@tonic-gate  *		for context in this message.
111*7c478bd9Sstevel@tonic-gate  */
112*7c478bd9Sstevel@tonic-gate void
print_insufficient_resources_msg(char * type)113*7c478bd9Sstevel@tonic-gate print_insufficient_resources_msg(
114*7c478bd9Sstevel@tonic-gate 	char *type)
115*7c478bd9Sstevel@tonic-gate {
116*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_TERSE,
117*7c478bd9Sstevel@tonic-gate 		gettext("  <-Failed: insufficient resources available\n"));
118*7c478bd9Sstevel@tonic-gate 
119*7c478bd9Sstevel@tonic-gate 	volume_set_error(
120*7c478bd9Sstevel@tonic-gate 		gettext("insufficient resources available to complete "
121*7c478bd9Sstevel@tonic-gate 			"requested %s\n"),
122*7c478bd9Sstevel@tonic-gate 		type);
123*7c478bd9Sstevel@tonic-gate }
124*7c478bd9Sstevel@tonic-gate 
125*7c478bd9Sstevel@tonic-gate /*
126*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_insufficient_hbas_msg(int n)
127*7c478bd9Sstevel@tonic-gate  *
128*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a status message indicating that there are insufficient
129*7c478bd9Sstevel@tonic-gate  *		HBAs and that only 'n' are available.
130*7c478bd9Sstevel@tonic-gate  *
131*7c478bd9Sstevel@tonic-gate  *		Used to indicate strategy selection during layouts.
132*7c478bd9Sstevel@tonic-gate  */
133*7c478bd9Sstevel@tonic-gate void
print_insufficient_hbas_msg(int n)134*7c478bd9Sstevel@tonic-gate print_insufficient_hbas_msg(
135*7c478bd9Sstevel@tonic-gate 	int n)
136*7c478bd9Sstevel@tonic-gate {
137*7c478bd9Sstevel@tonic-gate 	if (n == 0) {
138*7c478bd9Sstevel@tonic-gate 	    oprintf(OUTPUT_VERBOSE,
139*7c478bd9Sstevel@tonic-gate 		gettext("  <--Failed: no HBA has sufficient disks\n"));
140*7c478bd9Sstevel@tonic-gate 	} else if (n == 1) {
141*7c478bd9Sstevel@tonic-gate 	    oprintf(OUTPUT_VERBOSE,
142*7c478bd9Sstevel@tonic-gate 		gettext("  <--Failed: only 1 HBA has sufficient disks\n"));
143*7c478bd9Sstevel@tonic-gate 	} else {
144*7c478bd9Sstevel@tonic-gate 	    oprintf(OUTPUT_VERBOSE,
145*7c478bd9Sstevel@tonic-gate 		gettext("  <--Failed: only %d HBAs have sufficient disks\n"),
146*7c478bd9Sstevel@tonic-gate 		n);
147*7c478bd9Sstevel@tonic-gate 	}
148*7c478bd9Sstevel@tonic-gate }
149*7c478bd9Sstevel@tonic-gate 
150*7c478bd9Sstevel@tonic-gate /*
151*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_insufficient_disks_msg(int n)
152*7c478bd9Sstevel@tonic-gate  *
153*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a status message indicating that there are insufficient
154*7c478bd9Sstevel@tonic-gate  *		disks and that only 'n' are available.
155*7c478bd9Sstevel@tonic-gate  *
156*7c478bd9Sstevel@tonic-gate  *		Used to indicate strategy selection during layouts.
157*7c478bd9Sstevel@tonic-gate  */
158*7c478bd9Sstevel@tonic-gate void
print_insufficient_disks_msg(int n)159*7c478bd9Sstevel@tonic-gate print_insufficient_disks_msg(
160*7c478bd9Sstevel@tonic-gate 	int n)
161*7c478bd9Sstevel@tonic-gate {
162*7c478bd9Sstevel@tonic-gate 	if (n == 0) {
163*7c478bd9Sstevel@tonic-gate 	    oprintf(OUTPUT_VERBOSE,
164*7c478bd9Sstevel@tonic-gate 		    gettext("  <--Failed: no disks available\n"),
165*7c478bd9Sstevel@tonic-gate 		    n);
166*7c478bd9Sstevel@tonic-gate 	} else if (n == 1) {
167*7c478bd9Sstevel@tonic-gate 	    oprintf(OUTPUT_VERBOSE,
168*7c478bd9Sstevel@tonic-gate 		gettext("  <--Failed: only 1 disk available\n"),
169*7c478bd9Sstevel@tonic-gate 		    n);
170*7c478bd9Sstevel@tonic-gate 	} else {
171*7c478bd9Sstevel@tonic-gate 	    oprintf(OUTPUT_VERBOSE,
172*7c478bd9Sstevel@tonic-gate 		    gettext("  <--Failed: only %d disks available\n"),
173*7c478bd9Sstevel@tonic-gate 		    n);
174*7c478bd9Sstevel@tonic-gate 	}
175*7c478bd9Sstevel@tonic-gate }
176*7c478bd9Sstevel@tonic-gate 
177*7c478bd9Sstevel@tonic-gate /*
178*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_no_hbas_msg()
179*7c478bd9Sstevel@tonic-gate  *
180*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a layout failure due to no usable HBAs message.
181*7c478bd9Sstevel@tonic-gate  */
182*7c478bd9Sstevel@tonic-gate void
print_no_hbas_msg()183*7c478bd9Sstevel@tonic-gate print_no_hbas_msg()
184*7c478bd9Sstevel@tonic-gate {
185*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_TERSE,
186*7c478bd9Sstevel@tonic-gate 		gettext("  There are no usable HBAs.\n"));
187*7c478bd9Sstevel@tonic-gate }
188*7c478bd9Sstevel@tonic-gate 
189*7c478bd9Sstevel@tonic-gate /*
190*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_debug_failure_msg(char *type, char *err)
191*7c478bd9Sstevel@tonic-gate  *
192*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a generic message for unexpected failures
193*7c478bd9Sstevel@tonic-gate  *		during layout.
194*7c478bd9Sstevel@tonic-gate  */
195*7c478bd9Sstevel@tonic-gate void
print_debug_failure_msg(char * type,char * err)196*7c478bd9Sstevel@tonic-gate print_debug_failure_msg(
197*7c478bd9Sstevel@tonic-gate 	char *type,
198*7c478bd9Sstevel@tonic-gate 	char *err)
199*7c478bd9Sstevel@tonic-gate {
200*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_DEBUG,
201*7c478bd9Sstevel@tonic-gate 		gettext("    layout of %s failed: %s\n"),
202*7c478bd9Sstevel@tonic-gate 		type, err);
203*7c478bd9Sstevel@tonic-gate }
204*7c478bd9Sstevel@tonic-gate 
205*7c478bd9Sstevel@tonic-gate /*
206*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_insufficient_components_msg(int ncomp)
207*7c478bd9Sstevel@tonic-gate  *
208*7c478bd9Sstevel@tonic-gate  * INPUT:	ncomp	- number of available components
209*7c478bd9Sstevel@tonic-gate  *
210*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Helper to print out a message indicating that there
211*7c478bd9Sstevel@tonic-gate  *		are insufficient components for a volume, only ncomps
212*7c478bd9Sstevel@tonic-gate  *		are actually available.
213*7c478bd9Sstevel@tonic-gate  */
214*7c478bd9Sstevel@tonic-gate void
print_insufficient_components_msg(int ncomp)215*7c478bd9Sstevel@tonic-gate print_insufficient_components_msg(
216*7c478bd9Sstevel@tonic-gate 	int	ncomp)
217*7c478bd9Sstevel@tonic-gate {
218*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_VERBOSE,
219*7c478bd9Sstevel@tonic-gate 		gettext("  <---Failed: only found %d components\n"), ncomp);
220*7c478bd9Sstevel@tonic-gate }
221*7c478bd9Sstevel@tonic-gate 
222*7c478bd9Sstevel@tonic-gate /*
223*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_hba_insufficient_space_msg(char *name, uint64_t nbytes)
224*7c478bd9Sstevel@tonic-gate  *
225*7c478bd9Sstevel@tonic-gate  * INPUT:	name	- a char * HBA name
226*7c478bd9Sstevel@tonic-gate  *
227*7c478bd9Sstevel@tonic-gate  * RETURNS:	int	- 0 on success
228*7c478bd9Sstevel@tonic-gate  *			 !0 otherwise.
229*7c478bd9Sstevel@tonic-gate  *
230*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Helper to print out a message indicating the the HBA has
231*7c478bd9Sstevel@tonic-gate  *		insufficient space for use by the mirror layout strategy.
232*7c478bd9Sstevel@tonic-gate  */
233*7c478bd9Sstevel@tonic-gate void
print_hba_insufficient_space_msg(char * name,uint64_t nbytes)234*7c478bd9Sstevel@tonic-gate print_hba_insufficient_space_msg(
235*7c478bd9Sstevel@tonic-gate 	char		*name,
236*7c478bd9Sstevel@tonic-gate 	uint64_t	nbytes)
237*7c478bd9Sstevel@tonic-gate {
238*7c478bd9Sstevel@tonic-gate 	char *spstr = NULL;
239*7c478bd9Sstevel@tonic-gate 
240*7c478bd9Sstevel@tonic-gate 	(void) bytes_to_sizestr(nbytes, &spstr, universal_units, B_FALSE);
241*7c478bd9Sstevel@tonic-gate 
242*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_VERBOSE,
243*7c478bd9Sstevel@tonic-gate 		gettext("  <--Failed: '%s' only has %s available\n"),
244*7c478bd9Sstevel@tonic-gate 		name, spstr);
245*7c478bd9Sstevel@tonic-gate 
246*7c478bd9Sstevel@tonic-gate 	free(spstr);
247*7c478bd9Sstevel@tonic-gate }
248*7c478bd9Sstevel@tonic-gate 
249*7c478bd9Sstevel@tonic-gate /*
250*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_insufficient_capacity_msg(uint64_t nbytes)
251*7c478bd9Sstevel@tonic-gate  *
252*7c478bd9Sstevel@tonic-gate  * INPUT:	nbytes	- available capacity in bytes
253*7c478bd9Sstevel@tonic-gate  *
254*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Helper to print out a message indicating that there
255*7c478bd9Sstevel@tonic-gate  *		is insufficient space for a volume, only nbytes are
256*7c478bd9Sstevel@tonic-gate  *		actually available.
257*7c478bd9Sstevel@tonic-gate  */
258*7c478bd9Sstevel@tonic-gate void
print_insufficient_capacity_msg(uint64_t nbytes)259*7c478bd9Sstevel@tonic-gate print_insufficient_capacity_msg(
260*7c478bd9Sstevel@tonic-gate 	uint64_t nbytes)
261*7c478bd9Sstevel@tonic-gate {
262*7c478bd9Sstevel@tonic-gate 	char *spstr = NULL;
263*7c478bd9Sstevel@tonic-gate 
264*7c478bd9Sstevel@tonic-gate 	(void) bytes_to_sizestr(nbytes, &spstr, universal_units, B_FALSE);
265*7c478bd9Sstevel@tonic-gate 
266*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_VERBOSE,
267*7c478bd9Sstevel@tonic-gate 		gettext("  <---Failed: only found %s capacity\n"), spstr);
268*7c478bd9Sstevel@tonic-gate 
269*7c478bd9Sstevel@tonic-gate 	free(spstr);
270*7c478bd9Sstevel@tonic-gate }
271*7c478bd9Sstevel@tonic-gate 
272*7c478bd9Sstevel@tonic-gate /*
273*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_layout_submirrors_msg(char *type, uint64_t nbytes,
274*7c478bd9Sstevel@tonic-gate  *		int nsubs)
275*7c478bd9Sstevel@tonic-gate  *
276*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a generic status message indicating that layout of
277*7c478bd9Sstevel@tonic-gate  *		nsub submirrors of the indicated type and size has begun.
278*7c478bd9Sstevel@tonic-gate  */
279*7c478bd9Sstevel@tonic-gate void
print_layout_submirrors_msg(char * type,uint64_t nbytes,int nsubs)280*7c478bd9Sstevel@tonic-gate print_layout_submirrors_msg(
281*7c478bd9Sstevel@tonic-gate 	char	*type,
282*7c478bd9Sstevel@tonic-gate 	uint64_t nbytes,
283*7c478bd9Sstevel@tonic-gate 	int	nsubs)
284*7c478bd9Sstevel@tonic-gate {
285*7c478bd9Sstevel@tonic-gate 	char *spstr = NULL;
286*7c478bd9Sstevel@tonic-gate 
287*7c478bd9Sstevel@tonic-gate 	(void) bytes_to_sizestr(nbytes, &spstr, universal_units, B_FALSE);
288*7c478bd9Sstevel@tonic-gate 
289*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_TERSE,
290*7c478bd9Sstevel@tonic-gate 		gettext("  -->Layout %d %s submirrors with capacity %s\n"),
291*7c478bd9Sstevel@tonic-gate 		nsubs, type, spstr);
292*7c478bd9Sstevel@tonic-gate 
293*7c478bd9Sstevel@tonic-gate 	free(spstr);
294*7c478bd9Sstevel@tonic-gate }
295*7c478bd9Sstevel@tonic-gate 
296*7c478bd9Sstevel@tonic-gate /*
297*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_layout_submirrors_failed_msg(char *type, int count,
298*7c478bd9Sstevel@tonic-gate  *			int nsubs)
299*7c478bd9Sstevel@tonic-gate  *
300*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a generic status message indicating that only count
301*7c478bd9Sstevel@tonic-gate  *		submirrors (out of nsubs) of the indicated type could be
302*7c478bd9Sstevel@tonic-gate  *		composed.
303*7c478bd9Sstevel@tonic-gate  */
304*7c478bd9Sstevel@tonic-gate void
print_layout_submirrors_failed_msg(char * type,int count,int nsubs)305*7c478bd9Sstevel@tonic-gate print_layout_submirrors_failed_msg(
306*7c478bd9Sstevel@tonic-gate 	char	*type,
307*7c478bd9Sstevel@tonic-gate 	int	count,
308*7c478bd9Sstevel@tonic-gate 	int	nsubs)
309*7c478bd9Sstevel@tonic-gate {
310*7c478bd9Sstevel@tonic-gate 	if (count == 0) {
311*7c478bd9Sstevel@tonic-gate 	    oprintf(OUTPUT_VERBOSE,
312*7c478bd9Sstevel@tonic-gate 		    gettext("  <---Failed, no %s submirrors could "
313*7c478bd9Sstevel@tonic-gate 			    "be composed.\n"),
314*7c478bd9Sstevel@tonic-gate 		    type);
315*7c478bd9Sstevel@tonic-gate 	} else {
316*7c478bd9Sstevel@tonic-gate 	    oprintf(OUTPUT_VERBOSE,
317*7c478bd9Sstevel@tonic-gate 		    gettext("  <---Failed, only %d of %d %s submirror(s) "
318*7c478bd9Sstevel@tonic-gate 			    "could be composed.\n"),
319*7c478bd9Sstevel@tonic-gate 		    count, nsubs, type);
320*7c478bd9Sstevel@tonic-gate 	}
321*7c478bd9Sstevel@tonic-gate }
322*7c478bd9Sstevel@tonic-gate 
323*7c478bd9Sstevel@tonic-gate /*
324*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_populate_volume_msg(char *type, uint64_t nbytes)
325*7c478bd9Sstevel@tonic-gate  *
326*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a generic message indicating a population process
327*7c478bd9Sstevel@tonic-gate  *		for a volume of the indicated type and size is beginning.
328*7c478bd9Sstevel@tonic-gate  */
329*7c478bd9Sstevel@tonic-gate void
print_populate_volume_msg(char * type,uint64_t nbytes)330*7c478bd9Sstevel@tonic-gate print_populate_volume_msg(
331*7c478bd9Sstevel@tonic-gate 	char *type,
332*7c478bd9Sstevel@tonic-gate 	uint64_t nbytes)
333*7c478bd9Sstevel@tonic-gate {
334*7c478bd9Sstevel@tonic-gate 	char *spstr = NULL;
335*7c478bd9Sstevel@tonic-gate 
336*7c478bd9Sstevel@tonic-gate 	(void) bytes_to_sizestr(nbytes, &spstr, universal_units, B_FALSE);
337*7c478bd9Sstevel@tonic-gate 
338*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_TERSE,
339*7c478bd9Sstevel@tonic-gate 		gettext("  --->Populate a %s of capacity %s\n"),
340*7c478bd9Sstevel@tonic-gate 		type, spstr);
341*7c478bd9Sstevel@tonic-gate 
342*7c478bd9Sstevel@tonic-gate 	free(spstr);
343*7c478bd9Sstevel@tonic-gate }
344*7c478bd9Sstevel@tonic-gate 
345*7c478bd9Sstevel@tonic-gate /*
346*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_populate_volume_ncomps_msg(char *type, uint64_t nbytes,
347*7c478bd9Sstevel@tonic-gate  *			int ncomps)
348*7c478bd9Sstevel@tonic-gate  *
349*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a generic message indicating a population process
350*7c478bd9Sstevel@tonic-gate  *		for a volume of the indicated type, size and number of
351*7c478bd9Sstevel@tonic-gate  *		components is beginning.
352*7c478bd9Sstevel@tonic-gate  */
353*7c478bd9Sstevel@tonic-gate void
print_populate_volume_ncomps_msg(char * type,uint64_t nbytes,int ncomps)354*7c478bd9Sstevel@tonic-gate print_populate_volume_ncomps_msg(
355*7c478bd9Sstevel@tonic-gate 	char *type,
356*7c478bd9Sstevel@tonic-gate 	uint64_t nbytes,
357*7c478bd9Sstevel@tonic-gate 	int ncomps)
358*7c478bd9Sstevel@tonic-gate {
359*7c478bd9Sstevel@tonic-gate 	char *spstr = NULL;
360*7c478bd9Sstevel@tonic-gate 
361*7c478bd9Sstevel@tonic-gate 	(void) bytes_to_sizestr(nbytes, &spstr, universal_units, B_FALSE);
362*7c478bd9Sstevel@tonic-gate 
363*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_TERSE,
364*7c478bd9Sstevel@tonic-gate 		gettext("  --->Populate a %s of capacity %s (%d components)\n"),
365*7c478bd9Sstevel@tonic-gate 		type, spstr, ncomps);
366*7c478bd9Sstevel@tonic-gate 
367*7c478bd9Sstevel@tonic-gate 	free(spstr);
368*7c478bd9Sstevel@tonic-gate }
369*7c478bd9Sstevel@tonic-gate 
370*7c478bd9Sstevel@tonic-gate /*
371*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_populate_success_msg()
372*7c478bd9Sstevel@tonic-gate  *
373*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a generic message indicating a population process
374*7c478bd9Sstevel@tonic-gate  *		completed successfully.
375*7c478bd9Sstevel@tonic-gate  */
376*7c478bd9Sstevel@tonic-gate void
print_populate_success_msg()377*7c478bd9Sstevel@tonic-gate print_populate_success_msg()
378*7c478bd9Sstevel@tonic-gate {
379*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_TERSE,
380*7c478bd9Sstevel@tonic-gate 		gettext("  <---Success!\n"));
381*7c478bd9Sstevel@tonic-gate }
382*7c478bd9Sstevel@tonic-gate 
383*7c478bd9Sstevel@tonic-gate /*
384*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_populate_choose_slices_msg()
385*7c478bd9Sstevel@tonic-gate  *
386*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a generic message indicating a population process
387*7c478bd9Sstevel@tonic-gate  *		is beginning to choose slices.
388*7c478bd9Sstevel@tonic-gate  */
389*7c478bd9Sstevel@tonic-gate void
print_populate_choose_slices_msg()390*7c478bd9Sstevel@tonic-gate print_populate_choose_slices_msg()
391*7c478bd9Sstevel@tonic-gate {
392*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_VERBOSE,
393*7c478bd9Sstevel@tonic-gate 		gettext("      choosing \"best\" slices from "
394*7c478bd9Sstevel@tonic-gate 			"those available...\n"));
395*7c478bd9Sstevel@tonic-gate }
396*7c478bd9Sstevel@tonic-gate 
397*7c478bd9Sstevel@tonic-gate /*
398*7c478bd9Sstevel@tonic-gate  * FUNCTION:	print_populate_no_slices_msg()
399*7c478bd9Sstevel@tonic-gate  *
400*7c478bd9Sstevel@tonic-gate  * PURPOSE:	Prints a layout failure due to no available slices message.
401*7c478bd9Sstevel@tonic-gate  */
402*7c478bd9Sstevel@tonic-gate void
print_populate_no_slices_msg()403*7c478bd9Sstevel@tonic-gate print_populate_no_slices_msg()
404*7c478bd9Sstevel@tonic-gate {
405*7c478bd9Sstevel@tonic-gate 	oprintf(OUTPUT_VERBOSE,
406*7c478bd9Sstevel@tonic-gate 		gettext("  <---Failed: there are no slices available.\n"));
407*7c478bd9Sstevel@tonic-gate }
408