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.
26 #include <sys/fm/ldom.h>
28 #include <fm/fmd_api.h>
29 #include <fm/fmd_agent.h>
30 #include <fm/fmd_fmri.h>
32 extern ldom_hdl_t
*cma_lhp
;
36 cma_fmri_page_service_state(fmd_hdl_t
*hdl
, nvlist_t
*nvl
)
38 errno
= ldom_fmri_status(cma_lhp
, nvl
);
40 if (errno
== 0 || errno
== EINVAL
)
41 return (FMD_SERVICE_STATE_UNUSABLE
);
43 return (FMD_SERVICE_STATE_ISOLATE_PENDING
);
45 return (FMD_SERVICE_STATE_OK
);
50 cma_fmri_page_retire(fmd_hdl_t
*hdl
, nvlist_t
*nvl
)
52 errno
= ldom_fmri_retire(cma_lhp
, nvl
);
54 if (errno
== 0 || errno
== EIO
|| errno
== EINVAL
)
55 return (FMD_AGENT_RETIRE_DONE
);
57 return (FMD_AGENT_RETIRE_ASYNC
);
59 return (FMD_AGENT_RETIRE_FAIL
);
64 cma_fmri_page_unretire(fmd_hdl_t
*hdl
, nvlist_t
*nvl
)
66 errno
= ldom_fmri_unretire(cma_lhp
, nvl
);
68 if (errno
== 0 || errno
== EIO
)
69 return (FMD_AGENT_RETIRE_DONE
);
71 return (FMD_AGENT_RETIRE_FAIL
);