---
title: dcmi_get_device_share_config_recover_mode
description: "int dcmi_get_device_share_config_recover_mode(unsigned int *enable_flag)"
url: https://www.hiascend.com/document/detail/zh/HDK/latest/A2/A2DCMI/dcmi_157.html
sourcePath: /source/zh/HDK/2610/A2/A2DCMI/dcmi_157.html
indexId: 05011c530fe7983a4121f9aa2b612fe7abc69f67db7d6569795317727e8afd7c43
---
# dcmi_get_device_share_config_recover_mode

#### 函数原型

int dcmi_get_device_share_config_recover_mode(unsigned int *enable_flag)


#### 功能说明

查询容器共享持久化的使能状态。


#### 参数说明

| 参数名称 | 输入/输出 | 类型 | 描述 |
| --- | --- | --- | --- |
| enable\_flag | 输出 | unsigned int \* | 容器共享持久化的使能状态。取值为0或1，默认是0。 1：使能 0：禁用 |


#### 返回值说明

| 类型 | 描述 |
| --- | --- |
| int | 处理结果： 成功：返回0。 失败：返回码请参见返回码。 |


#### 异常处理

无。


#### 约束说明

- 设置容器共享模式后，若持久化功能为开启状态，则重启系统后容器使能状态与重启前保持一致。
- 该接口支持在物理机+特权容器场景下使用。


**表1 不同部署场景下的支持情况**

| 产品形态 | 物理机场景（裸机）root用户 | 物理机场景（裸机）运行用户组（非root用户） | 物理机+普通容器场景root用户 | 物理机+容器AVI场景root用户 |
| --- | --- | --- | --- | --- |
| Atlas 900 A2 PoD 集群基础单元 | Y | N | N | N |
| Atlas 800T A2 训练服务器 | Y | N | N | N |
| Atlas 800I A2 推理服务器 | Y | N | N | N |
| Atlas 200T A2 Box16 异构子框 | Y | N | N | N |
| A200I A2 Box 异构组件 | Y | N | N | N |
| A300I A2 推理卡 | Y | N | N | N |
| 注：Y表示支持；N表示不支持；NA表示不涉及，当前未规划此场景。 | 注：Y表示支持；N表示不支持；NA表示不涉及，当前未规划此场景。 | 注：Y表示支持；N表示不支持；NA表示不涉及，当前未规划此场景。 | 注：Y表示支持；N表示不支持；NA表示不涉及，当前未规划此场景。 | 注：Y表示支持；N表示不支持；NA表示不涉及，当前未规划此场景。 |


#### 调用示例

```
…
int ret = 0;
unsigned int enable_flag = 2;
ret = dcmi_get_device_share_config_recover_mode(&enable_flag);
if (ret != 0) {
//todo：记录日志
return ret;
}
…
```
