Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
c33ac2e3
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c33ac2e3
编写于
3月 17, 2011
作者:
H
Hu Tao
提交者:
Jiri Denemark
3月 22, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: fallback to HMP drive_add/drive_del
fallback to HMP drive_add/drive_del commands if not found in QMP
上级
24c56ceb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
14 deletion
+24
-14
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.c
+24
-14
未找到文件。
src/qemu/qemu_monitor_json.c
浏览文件 @
c33ac2e3
...
...
@@ -2289,11 +2289,19 @@ int qemuMonitorJSONAddDrive(qemuMonitorPtr mon,
if
(
!
cmd
)
return
-
1
;
ret
=
qemuMonitorJSONCommand
(
mon
,
cmd
,
&
reply
);
if
((
ret
=
qemuMonitorJSONCommand
(
mon
,
cmd
,
&
reply
)
<
0
))
goto
cleanup
;
if
(
ret
==
0
)
ret
=
qemuMonitorJSONCheckError
(
cmd
,
reply
);
if
(
qemuMonitorJSONHasError
(
reply
,
"CommandNotFound"
)
&&
qemuMonitorCheckHMP
(
mon
,
"drive_add"
))
{
VIR_DEBUG0
(
"drive_add command not found, trying HMP"
);
ret
=
qemuMonitorTextAddDrive
(
mon
,
drivestr
);
goto
cleanup
;
}
ret
=
qemuMonitorJSONCheckError
(
cmd
,
reply
);
cleanup:
virJSONValueFree
(
cmd
);
virJSONValueFree
(
reply
);
return
ret
;
...
...
@@ -2314,22 +2322,24 @@ int qemuMonitorJSONDriveDel(qemuMonitorPtr mon,
if
(
!
cmd
)
return
-
1
;
ret
=
qemuMonitorJSONCommand
(
mon
,
cmd
,
&
reply
);
if
((
ret
=
qemuMonitorJSONCommand
(
mon
,
cmd
,
&
reply
))
<
0
)
goto
cleanup
;
if
(
ret
==
0
)
{
/* See if drive_del isn't supported */
if
(
qemuMonitorJSONHasError
(
reply
,
"CommandNotFound"
))
{
if
(
qemuMonitorJSONHasError
(
reply
,
"CommandNotFound"
))
{
if
(
qemuMonitorCheckHMP
(
mon
,
"drive_del"
))
{
VIR_DEBUG0
(
"drive_del command not found, trying HMP"
);
ret
=
qemuMonitorTextDriveDel
(
mon
,
drivestr
);
}
else
{
VIR_ERROR0
(
_
(
"deleting disk is not supported. "
"This may leak data if disk is reassigned"
));
ret
=
1
;
goto
cleanup
;
}
else
if
(
qemuMonitorJSONHasError
(
reply
,
"DeviceNotFound"
))
{
/* NB: device not found errors mean the drive was
* auto-deleted and we ignore the error */
ret
=
0
;
}
else
{
ret
=
qemuMonitorJSONCheckError
(
cmd
,
reply
);
}
}
else
if
(
qemuMonitorJSONHasError
(
reply
,
"DeviceNotFound"
))
{
/* NB: device not found errors mean the drive was
* auto-deleted and we ignore the error */
ret
=
0
;
}
else
{
ret
=
qemuMonitorJSONCheckError
(
cmd
,
reply
);
}
cleanup:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录