Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
92427948
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,发现更多精彩内容 >>
提交
92427948
编写于
10月 01, 2014
作者:
P
Peter Krempa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
maint: Prohibit "devname" by a syntax check rules
and tweak the code to avoid using it.
上级
72945c06
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
29 addition
and
19 deletion
+29
-19
cfg.mk
cfg.mk
+10
-0
include/libvirt/libvirt.h.in
include/libvirt/libvirt.h.in
+1
-1
src/conf/interface_conf.c
src/conf/interface_conf.c
+5
-5
src/conf/interface_conf.h
src/conf/interface_conf.h
+1
-1
src/interface/interface_backend_udev.c
src/interface/interface_backend_udev.c
+1
-1
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.c
+2
-2
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor.h
+3
-3
src/util/virfile.c
src/util/virfile.c
+3
-3
tools/virsh-domain.c
tools/virsh-domain.c
+2
-2
tools/virt-host-validate-common.h
tools/virt-host-validate-common.h
+1
-1
未找到文件。
cfg.mk
浏览文件 @
92427948
...
...
@@ -962,6 +962,13 @@ sc_prohibit_paren_brace:
halt
=
'Put space between closing parenthesis and opening brace'
\
$(_sc_search_regexp)
# FreeBSD exports the "devname" symbol which produces a warning.
sc_prohibit_devname
:
@
prohibit
=
'\bdevname\b'
\
exclude
=
'sc_prohibit_devname'
\
halt
=
'avoid using '
devname
' as FreeBSD exports the symbol'
\
$(_sc_search_regexp)
# We don't use this feature of maint.mk.
prev_version_file
=
/dev/null
...
...
@@ -1146,3 +1153,6 @@ exclude_file_name_regexp--sc_prohibit_empty_first_line = \
exclude_file_name_regexp--sc_prohibit_useless_translation
=
\
^tests/virpolkittest.c
exclude_file_name_regexp--sc_prohibit_devname
=
\
^
(
tools/virsh.pod|cfg.mk|docs/.
*
)
$$
include/libvirt/libvirt.h.in
浏览文件 @
92427948
...
...
@@ -5601,7 +5601,7 @@ typedef enum {
}
virDomainConsoleFlags
;
int
virDomainOpenConsole
(
virDomainPtr
dom
,
const
char
*
devname
,
const
char
*
dev
_
name
,
virStreamPtr
st
,
unsigned
int
flags
);
...
...
src/conf/interface_conf.c
浏览文件 @
92427948
...
...
@@ -101,7 +101,7 @@ void virInterfaceDefFree(virInterfaceDefPtr def)
break
;
case
VIR_INTERFACE_TYPE_VLAN
:
VIR_FREE
(
def
->
data
.
vlan
.
tag
);
VIR_FREE
(
def
->
data
.
vlan
.
devname
);
VIR_FREE
(
def
->
data
.
vlan
.
dev
_
name
);
break
;
}
...
...
@@ -671,9 +671,9 @@ virInterfaceDefParseVlan(virInterfaceDefPtr def,
return
-
1
;
}
def
->
data
.
vlan
.
devname
=
def
->
data
.
vlan
.
dev
_
name
=
virXPathString
(
"string(./interface/@name)"
,
ctxt
);
if
(
def
->
data
.
vlan
.
devname
==
NULL
)
{
if
(
def
->
data
.
vlan
.
dev
_
name
==
NULL
)
{
virReportError
(
VIR_ERR_XML_ERROR
,
"%s"
,
_
(
"vlan interface misses name attribute"
));
return
-
1
;
...
...
@@ -955,11 +955,11 @@ virInterfaceVlanDefFormat(virBufferPtr buf, const virInterfaceDef *def)
}
virBufferAsprintf
(
buf
,
"<vlan tag='%s'"
,
def
->
data
.
vlan
.
tag
);
if
(
def
->
data
.
vlan
.
devname
!=
NULL
)
{
if
(
def
->
data
.
vlan
.
dev
_
name
!=
NULL
)
{
virBufferAddLit
(
buf
,
">
\n
"
);
virBufferAdjustIndent
(
buf
,
2
);
virBufferAsprintf
(
buf
,
"<interface name='%s'/>
\n
"
,
def
->
data
.
vlan
.
devname
);
def
->
data
.
vlan
.
dev
_
name
);
virBufferAdjustIndent
(
buf
,
-
2
);
virBufferAddLit
(
buf
,
"</vlan>
\n
"
);
}
else
{
...
...
src/conf/interface_conf.h
浏览文件 @
92427948
...
...
@@ -116,7 +116,7 @@ typedef struct _virInterfaceVlanDef virInterfaceVlanDef;
typedef
virInterfaceVlanDef
*
virInterfaceVlanDefPtr
;
struct
_virInterfaceVlanDef
{
char
*
tag
;
/* TAG for vlan */
char
*
devname
;
/* device name for vlan */
char
*
dev
_
name
;
/* device name for vlan */
};
typedef
struct
_virInterfaceIpDef
virInterfaceIpDef
;
...
...
src/interface/interface_backend_udev.c
浏览文件 @
92427948
...
...
@@ -1015,7 +1015,7 @@ udevGetIfaceDefVlan(struct udev *udev ATTRIBUTE_UNUSED,
if
(
VIR_STRNDUP
(
ifacedef
->
data
.
vlan
.
tag
,
vid_pos
,
vid_len
)
<
0
)
goto
cleanup
;
if
(
VIR_STRNDUP
(
ifacedef
->
data
.
vlan
.
devname
,
dev_pos
,
dev_len
)
<
0
)
{
if
(
VIR_STRNDUP
(
ifacedef
->
data
.
vlan
.
dev
_
name
,
dev_pos
,
dev_len
)
<
0
)
{
VIR_FREE
(
ifacedef
->
data
.
vlan
.
tag
);
goto
cleanup
;
}
...
...
src/qemu/qemu_monitor.c
浏览文件 @
92427948
...
...
@@ -1821,7 +1821,7 @@ int qemuMonitorGetBlockExtent(qemuMonitorPtr mon,
unsigned
long
long
*
extent
)
{
int
ret
;
VIR_DEBUG
(
"mon=%p, dev_name=%
p
"
,
mon
,
dev_name
);
VIR_DEBUG
(
"mon=%p, dev_name=%
s
"
,
mon
,
dev_name
);
if
(
mon
->
json
)
ret
=
qemuMonitorJSONGetBlockExtent
(
mon
,
dev_name
,
extent
);
...
...
@@ -1836,7 +1836,7 @@ int qemuMonitorBlockResize(qemuMonitorPtr mon,
unsigned
long
long
size
)
{
int
ret
;
VIR_DEBUG
(
"mon=%p, dev
name=%p
size=%llu"
,
mon
,
device
,
size
);
VIR_DEBUG
(
"mon=%p, dev
ice=%s
size=%llu"
,
mon
,
device
,
size
);
if
(
mon
->
json
)
ret
=
qemuMonitorJSONBlockResize
(
mon
,
device
,
size
);
...
...
src/qemu/qemu_monitor.h
浏览文件 @
92427948
...
...
@@ -333,7 +333,7 @@ int qemuMonitorBlockIOStatusToError(const char *status);
virHashTablePtr
qemuMonitorGetBlockInfo
(
qemuMonitorPtr
mon
);
struct
qemuDomainDiskInfo
*
qemuMonitorBlockInfoLookup
(
virHashTablePtr
blockInfo
,
const
char
*
devname
);
const
char
*
dev
_
name
);
int
qemuMonitorGetBlockStatsInfo
(
qemuMonitorPtr
mon
,
const
char
*
dev_name
,
...
...
@@ -378,7 +378,7 @@ int qemuMonitorGetBlockExtent(qemuMonitorPtr mon,
const
char
*
dev_name
,
unsigned
long
long
*
extent
);
int
qemuMonitorBlockResize
(
qemuMonitorPtr
mon
,
const
char
*
devname
,
const
char
*
dev
_
name
,
unsigned
long
long
size
);
int
qemuMonitorSetVNCPassword
(
qemuMonitorPtr
mon
,
const
char
*
password
);
...
...
@@ -395,7 +395,7 @@ int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, bool online);
/* XXX should we pass the virDomainDiskDefPtr instead
* and hide devname details inside monitor. Reconsider
* and hide dev
_
name details inside monitor. Reconsider
* this when doing the QMP implementation
*/
int
qemuMonitorEjectMedia
(
qemuMonitorPtr
mon
,
...
...
src/util/virfile.c
浏览文件 @
92427948
...
...
@@ -745,13 +745,13 @@ int virFileLoopDeviceAssociate(const char *file,
static
int
virFileNBDDeviceIsBusy
(
const
char
*
devname
)
virFileNBDDeviceIsBusy
(
const
char
*
dev
_
name
)
{
char
*
path
;
int
ret
=
-
1
;
if
(
virAsprintf
(
&
path
,
SYSFS_BLOCK_DIR
"/%s/pid"
,
devname
)
<
0
)
dev
_
name
)
<
0
)
return
-
1
;
if
(
!
virFileExists
(
path
))
{
...
...
@@ -760,7 +760,7 @@ virFileNBDDeviceIsBusy(const char *devname)
else
virReportSystemError
(
errno
,
_
(
"Cannot check NBD device %s pid"
),
devname
);
dev
_
name
);
goto
cleanup
;
}
ret
=
1
;
...
...
tools/virsh-domain.c
浏览文件 @
92427948
...
...
@@ -2570,7 +2570,7 @@ static const vshCmdOptDef opts_console[] = {
.
flags
=
VSH_OFLAG_REQ
,
.
help
=
N_
(
"domain name, id or uuid"
)
},
{.
name
=
"devname"
,
{.
name
=
"devname"
,
/* sc_prohibit_devname */
.
type
=
VSH_OT_STRING
,
.
help
=
N_
(
"character device name"
)
},
...
...
@@ -2632,7 +2632,7 @@ cmdConsole(vshControl *ctl, const vshCmd *cmd)
if
(
!
(
dom
=
vshCommandOptDomain
(
ctl
,
cmd
,
NULL
)))
return
false
;
if
(
vshCommandOptStringReq
(
ctl
,
cmd
,
"devname"
,
&
name
)
<
0
)
if
(
vshCommandOptStringReq
(
ctl
,
cmd
,
"devname"
,
&
name
)
<
0
)
/* sc_prohibit_devname */
goto
cleanup
;
if
(
force
)
...
...
tools/virt-host-validate-common.h
浏览文件 @
92427948
...
...
@@ -43,7 +43,7 @@ extern void virHostMsgFail(virHostValidateLevel level,
const
char
*
hint
);
extern
int
virHostValidateDevice
(
const
char
*
hvname
,
const
char
*
devname
,
const
char
*
dev
_
name
,
virHostValidateLevel
level
,
const
char
*
hint
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录