4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
28 #include "Exceptions.h"
33 #include <sys/types.h>
43 * @memo Log a simple I/O error message
44 * @param message The message to log
46 IOError::IOError(string message
) : HBAException(HBA_STATUS_ERROR
) {
47 Trace
log("IOError::IOError(string)");
48 log
.genericIOError("%s (%s)", message
.c_str(), strerror(errno
));
52 * @memo Log a handle I/O error message
53 * @param handle The handle where the I/O error took place
55 IOError::IOError(Handle
*handle
) : HBAException(HBA_STATUS_ERROR
) {
56 Trace
log("IOError::IOError(Handle)");
58 "On handle %08lx (%s)", handle
->getHandle(), strerror(errno
));
62 * @memo Log an HBAPort I/O error message
63 * @param port The port where the I/O error took place
65 IOError::IOError(HBAPort
*port
) : HBAException(HBA_STATUS_ERROR
) {
66 Trace
log("IOError::IOError(HBAPort)");
68 "On HBA port %016llx (%s)", port
->getPortWWN(),
73 * @memo Log a target I/O error message
74 * @param port The port where the I/O error took place
75 * @param target The target wwn which failed
77 IOError::IOError(HBAPort
*port
, uint64_t target
) :
78 HBAException(HBA_STATUS_ERROR
) {
79 Trace
log("IOError::IOError(HBAPort, wwn)");
81 "On HBA port %016llx target %016llx (%s)", port
->getPortWWN(),
82 target
, strerror(errno
));
86 * @memo Log a LUN I/O error message
87 * @param port The port where the I/O error took place
88 * @param target The target wwn which failed
89 * @param lun The unit number which failed
91 IOError::IOError(HBAPort
*port
, uint64_t target
, uint64_t lun
) :
92 HBAException(HBA_STATUS_ERROR
) {
93 Trace
log("IOError::IOError(HBAPort, wwn, lun)");
95 "On HBA port %016llx target %016llx lun %016llx (%s)",
98 lun
, strerror(errno
));