Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
46a11681
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看板
提交
46a11681
编写于
10月 18, 2011
作者:
G
Guido Günther
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: replace qemuMonitorEscapeShell by virBufferEscapeShell
上级
04323fbc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
45 deletion
+5
-45
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.c
+5
-44
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor.h
+0
-1
未找到文件。
src/qemu/qemu_monitor.c
浏览文件 @
46a11681
...
...
@@ -139,48 +139,6 @@ char *qemuMonitorEscapeArg(const char *in)
return
out
;
}
char
*
qemuMonitorEscapeShell
(
const
char
*
in
)
{
int
len
=
2
;
/* leading and trailing single quote */
int
i
,
j
;
char
*
out
;
for
(
i
=
0
;
in
[
i
]
!=
'\0'
;
i
++
)
{
switch
(
in
[
i
])
{
case
'\''
:
len
+=
4
;
/* '\'' */
break
;
default:
len
+=
1
;
break
;
}
}
if
(
VIR_ALLOC_N
(
out
,
len
+
1
)
<
0
)
return
NULL
;
j
=
0
;
out
[
j
++
]
=
'\''
;
for
(
i
=
0
;
in
[
i
]
!=
'\0'
;
i
++
)
{
switch
(
in
[
i
])
{
case
'\''
:
out
[
j
++
]
=
'\''
;
out
[
j
++
]
=
'\\'
;
out
[
j
++
]
=
'\''
;
out
[
j
++
]
=
'\''
;
break
;
default:
out
[
j
++
]
=
in
[
i
];
break
;
}
}
out
[
j
++
]
=
'\''
;
out
[
j
]
=
'\0'
;
return
out
;
}
#if DEBUG_RAW_IO
# include <c-ctype.h>
static
char
*
qemuMonitorEscapeNonPrintable
(
const
char
*
text
)
...
...
@@ -1734,6 +1692,7 @@ int qemuMonitorMigrateToFile(qemuMonitorPtr mon,
char
*
dest
=
NULL
;
int
ret
=
-
1
;
char
*
safe_target
=
NULL
;
virBuffer
buf
=
VIR_BUFFER_INITIALIZER
;
VIR_DEBUG
(
"mon=%p argv=%p target=%s offset=%llu flags=%x"
,
mon
,
argv
,
target
,
offset
,
flags
);
...
...
@@ -1757,11 +1716,13 @@ int qemuMonitorMigrateToFile(qemuMonitorPtr mon,
}
/* Migrate to file */
safe_target
=
qemuMonitorEscapeShell
(
target
);
if
(
!
safe_target
)
{
virBufferEscapeShell
(
&
buf
,
target
);
if
(
virBufferError
(
&
buf
)
)
{
virReportOOMError
();
virBufferFreeAndReset
(
&
buf
);
goto
cleanup
;
}
safe_target
=
virBufferContentAndReset
(
&
buf
);
/* Two dd processes, sharing the same stdout, are necessary to
* allow starting at an alignment of 512, but without wasting
...
...
src/qemu/qemu_monitor.h
浏览文件 @
46a11681
...
...
@@ -127,7 +127,6 @@ struct _qemuMonitorCallbacks {
char
*
qemuMonitorEscapeArg
(
const
char
*
in
);
char
*
qemuMonitorEscapeShell
(
const
char
*
in
);
qemuMonitorPtr
qemuMonitorOpen
(
virDomainObjPtr
vm
,
virDomainChrSourceDefPtr
config
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录