Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
c01f4e9e
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c01f4e9e
编写于
4月 26, 2016
作者:
P
Peter Krempa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: monitor: Kill legacy USB monitor code
Code was obsoleted by using -device.
上级
dd3e9a0a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
0 addition
and
211 deletion
+0
-211
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.c
+0
-47
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor.h
+0
-14
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.c
+0
-29
src/qemu/qemu_monitor_json.h
src/qemu/qemu_monitor_json.h
+0
-11
src/qemu/qemu_monitor_text.c
src/qemu/qemu_monitor_text.c
+0
-99
src/qemu/qemu_monitor_text.h
src/qemu/qemu_monitor_text.h
+0
-11
未找到文件。
src/qemu/qemu_monitor.c
浏览文件 @
c01f4e9e
...
...
@@ -2404,53 +2404,6 @@ qemuMonitorGraphicsRelocate(qemuMonitorPtr mon,
}
int
qemuMonitorAddUSBDisk
(
qemuMonitorPtr
mon
,
const
char
*
path
)
{
VIR_DEBUG
(
"path=%s"
,
path
);
QEMU_CHECK_MONITOR
(
mon
);
if
(
mon
->
json
)
return
qemuMonitorJSONAddUSBDisk
(
mon
,
path
);
else
return
qemuMonitorTextAddUSBDisk
(
mon
,
path
);
}
int
qemuMonitorAddUSBDeviceExact
(
qemuMonitorPtr
mon
,
int
bus
,
int
dev
)
{
VIR_DEBUG
(
"bus=%d dev=%d"
,
bus
,
dev
);
QEMU_CHECK_MONITOR
(
mon
);
if
(
mon
->
json
)
return
qemuMonitorJSONAddUSBDeviceExact
(
mon
,
bus
,
dev
);
else
return
qemuMonitorTextAddUSBDeviceExact
(
mon
,
bus
,
dev
);
}
int
qemuMonitorAddUSBDeviceMatch
(
qemuMonitorPtr
mon
,
int
vendor
,
int
product
)
{
VIR_DEBUG
(
"vendor=%d product=%d"
,
vendor
,
product
);
QEMU_CHECK_MONITOR
(
mon
);
if
(
mon
->
json
)
return
qemuMonitorJSONAddUSBDeviceMatch
(
mon
,
vendor
,
product
);
else
return
qemuMonitorTextAddUSBDeviceMatch
(
mon
,
vendor
,
product
);
}
int
qemuMonitorAddPCIHostDevice
(
qemuMonitorPtr
mon
,
virDevicePCIAddress
*
hostAddr
,
...
...
src/qemu/qemu_monitor.h
浏览文件 @
c01f4e9e
...
...
@@ -628,20 +628,6 @@ int qemuMonitorGraphicsRelocate(qemuMonitorPtr mon,
int
tlsPort
,
const
char
*
tlsSubject
);
/* XXX disk driver type eg, qcow/etc.
* XXX cache mode
*/
int
qemuMonitorAddUSBDisk
(
qemuMonitorPtr
mon
,
const
char
*
path
);
int
qemuMonitorAddUSBDeviceExact
(
qemuMonitorPtr
mon
,
int
bus
,
int
dev
);
int
qemuMonitorAddUSBDeviceMatch
(
qemuMonitorPtr
mon
,
int
vendor
,
int
product
);
int
qemuMonitorAddPCIHostDevice
(
qemuMonitorPtr
mon
,
virDevicePCIAddress
*
hostAddr
,
virDevicePCIAddress
*
guestAddr
);
...
...
src/qemu/qemu_monitor_json.c
浏览文件 @
c01f4e9e
...
...
@@ -3032,35 +3032,6 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon,
}
int
qemuMonitorJSONAddUSBDisk
(
qemuMonitorPtr
mon
ATTRIBUTE_UNUSED
,
const
char
*
path
ATTRIBUTE_UNUSED
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"usb_add not supported in JSON mode"
));
return
-
1
;
}
int
qemuMonitorJSONAddUSBDeviceExact
(
qemuMonitorPtr
mon
ATTRIBUTE_UNUSED
,
int
bus
ATTRIBUTE_UNUSED
,
int
dev
ATTRIBUTE_UNUSED
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"usb_add not supported in JSON mode"
));
return
-
1
;
}
int
qemuMonitorJSONAddUSBDeviceMatch
(
qemuMonitorPtr
mon
ATTRIBUTE_UNUSED
,
int
vendor
ATTRIBUTE_UNUSED
,
int
product
ATTRIBUTE_UNUSED
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"usb_add not supported in JSON mode"
));
return
-
1
;
}
int
qemuMonitorJSONAddPCIHostDevice
(
qemuMonitorPtr
mon
ATTRIBUTE_UNUSED
,
virDevicePCIAddress
*
hostAddr
ATTRIBUTE_UNUSED
,
virDevicePCIAddress
*
guestAddr
ATTRIBUTE_UNUSED
)
...
...
src/qemu/qemu_monitor_json.h
浏览文件 @
c01f4e9e
...
...
@@ -169,17 +169,6 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon,
int
tlsPort
,
const
char
*
tlsSubject
);
int
qemuMonitorJSONAddUSBDisk
(
qemuMonitorPtr
mon
,
const
char
*
path
);
int
qemuMonitorJSONAddUSBDeviceExact
(
qemuMonitorPtr
mon
,
int
bus
,
int
dev
);
int
qemuMonitorJSONAddUSBDeviceMatch
(
qemuMonitorPtr
mon
,
int
vendor
,
int
product
);
int
qemuMonitorJSONAddPCIHostDevice
(
qemuMonitorPtr
mon
,
virDevicePCIAddress
*
hostAddr
,
virDevicePCIAddress
*
guestAddr
);
...
...
src/qemu/qemu_monitor_text.c
浏览文件 @
c01f4e9e
...
...
@@ -1572,105 +1572,6 @@ int qemuMonitorTextGraphicsRelocate(qemuMonitorPtr mon,
}
int
qemuMonitorTextAddUSBDisk
(
qemuMonitorPtr
mon
,
const
char
*
path
)
{
char
*
cmd
=
NULL
;
char
*
safepath
;
int
ret
=
-
1
;
char
*
info
=
NULL
;
safepath
=
qemuMonitorEscapeArg
(
path
);
if
(
!
safepath
)
return
-
1
;
if
(
virAsprintf
(
&
cmd
,
"usb_add disk:%s"
,
safepath
)
<
0
)
goto
cleanup
;
if
(
qemuMonitorHMPCommand
(
mon
,
cmd
,
&
info
)
<
0
)
goto
cleanup
;
/* If the command failed qemu prints:
* Could not add ... */
if
(
strstr
(
info
,
"Could not add "
))
{
virReportError
(
VIR_ERR_OPERATION_FAILED
,
_
(
"unable to add USB disk %s: %s"
),
path
,
info
);
goto
cleanup
;
}
ret
=
0
;
cleanup:
VIR_FREE
(
cmd
);
VIR_FREE
(
safepath
);
VIR_FREE
(
info
);
return
ret
;
}
static
int
qemuMonitorTextAddUSBDevice
(
qemuMonitorPtr
mon
,
const
char
*
addr
)
{
char
*
cmd
;
char
*
reply
=
NULL
;
int
ret
=
-
1
;
if
(
virAsprintf
(
&
cmd
,
"usb_add %s"
,
addr
)
<
0
)
return
-
1
;
if
(
qemuMonitorHMPCommand
(
mon
,
cmd
,
&
reply
)
<
0
)
goto
cleanup
;
/* If the command failed qemu prints:
* Could not add ... */
if
(
strstr
(
reply
,
"Could not add "
))
{
virReportError
(
VIR_ERR_OPERATION_FAILED
,
"%s"
,
_
(
"adding usb device failed"
));
goto
cleanup
;
}
ret
=
0
;
cleanup:
VIR_FREE
(
cmd
);
VIR_FREE
(
reply
);
return
ret
;
}
int
qemuMonitorTextAddUSBDeviceExact
(
qemuMonitorPtr
mon
,
int
bus
,
int
dev
)
{
int
ret
;
char
*
addr
;
if
(
virAsprintf
(
&
addr
,
"host:%.3d.%.3d"
,
bus
,
dev
)
<
0
)
return
-
1
;
ret
=
qemuMonitorTextAddUSBDevice
(
mon
,
addr
);
VIR_FREE
(
addr
);
return
ret
;
}
int
qemuMonitorTextAddUSBDeviceMatch
(
qemuMonitorPtr
mon
,
int
vendor
,
int
product
)
{
int
ret
;
char
*
addr
;
if
(
virAsprintf
(
&
addr
,
"host:%.4x:%.4x"
,
vendor
,
product
)
<
0
)
return
-
1
;
ret
=
qemuMonitorTextAddUSBDevice
(
mon
,
addr
);
VIR_FREE
(
addr
);
return
ret
;
}
static
int
qemuMonitorTextParsePCIAddReply
(
qemuMonitorPtr
mon
ATTRIBUTE_UNUSED
,
const
char
*
reply
,
...
...
src/qemu/qemu_monitor_text.h
浏览文件 @
c01f4e9e
...
...
@@ -119,17 +119,6 @@ int qemuMonitorTextGraphicsRelocate(qemuMonitorPtr mon,
int
tlsPort
,
const
char
*
tlsSubject
);
int
qemuMonitorTextAddUSBDisk
(
qemuMonitorPtr
mon
,
const
char
*
path
);
int
qemuMonitorTextAddUSBDeviceExact
(
qemuMonitorPtr
mon
,
int
bus
,
int
dev
);
int
qemuMonitorTextAddUSBDeviceMatch
(
qemuMonitorPtr
mon
,
int
vendor
,
int
product
);
int
qemuMonitorTextAddPCIHostDevice
(
qemuMonitorPtr
mon
,
virDevicePCIAddress
*
hostAddr
,
virDevicePCIAddress
*
guestAddr
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录