Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
ab9a1459
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,发现更多精彩内容 >>
提交
ab9a1459
编写于
9月 13, 2018
作者:
S
Shi Lei
提交者:
Michal Privoznik
9月 17, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
src: fix incorrect indentation in function body by checking first line
Signed-off-by:
N
Shi Lei
<
shi_lei@massclouds.com
>
上级
37131ada
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
148 addition
and
147 deletion
+148
-147
src/bhyve/bhyve_conf.c
src/bhyve/bhyve_conf.c
+3
-3
src/bhyve/bhyve_driver.c
src/bhyve/bhyve_driver.c
+16
-16
src/conf/domain_conf.c
src/conf/domain_conf.c
+1
-1
src/cpu/cpu_s390.c
src/cpu/cpu_s390.c
+42
-42
src/esx/esx_vi_types.c
src/esx/esx_vi_types.c
+1
-1
src/qemu/qemu_domain_address.c
src/qemu/qemu_domain_address.c
+43
-42
src/util/vircommand.c
src/util/vircommand.c
+3
-3
src/util/virnetdev.c
src/util/virnetdev.c
+23
-23
src/util/virnetdevmacvlan.c
src/util/virnetdevmacvlan.c
+5
-5
src/util/virnetdevvportprofile.c
src/util/virnetdevvportprofile.c
+1
-1
src/util/virutil.c
src/util/virutil.c
+1
-1
src/vbox/vbox_tmpl.c
src/vbox/vbox_tmpl.c
+4
-4
src/xenconfig/xen_common.c
src/xenconfig/xen_common.c
+5
-5
未找到文件。
src/bhyve/bhyve_conf.c
浏览文件 @
ab9a1459
...
...
@@ -36,10 +36,10 @@ static void virBhyveDriverConfigDispose(void *obj);
static
int
virBhyveConfigOnceInit
(
void
)
{
if
(
!
VIR_CLASS_NEW
(
virBhyveDriverConfig
,
virClassForObject
()))
return
-
1
;
if
(
!
VIR_CLASS_NEW
(
virBhyveDriverConfig
,
virClassForObject
()))
return
-
1
;
return
0
;
return
0
;
}
VIR_ONCE_GLOBAL_INIT
(
virBhyveConfig
)
...
...
src/bhyve/bhyve_driver.c
浏览文件 @
ab9a1459
...
...
@@ -197,27 +197,27 @@ bhyveConnectOpen(virConnectPtr conn,
virConfPtr
conf
ATTRIBUTE_UNUSED
,
unsigned
int
flags
)
{
virCheckFlags
(
VIR_CONNECT_RO
,
VIR_DRV_OPEN_ERROR
);
virCheckFlags
(
VIR_CONNECT_RO
,
VIR_DRV_OPEN_ERROR
);
if
(
STRNEQ
(
conn
->
uri
->
path
,
"/system"
))
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Unexpected bhyve URI path '%s', try bhyve:///system"
),
conn
->
uri
->
path
);
return
VIR_DRV_OPEN_ERROR
;
}
if
(
STRNEQ
(
conn
->
uri
->
path
,
"/system"
))
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Unexpected bhyve URI path '%s', try bhyve:///system"
),
conn
->
uri
->
path
);
return
VIR_DRV_OPEN_ERROR
;
}
if
(
bhyve_driver
==
NULL
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"bhyve state driver is not active"
));
return
VIR_DRV_OPEN_ERROR
;
}
if
(
bhyve_driver
==
NULL
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"bhyve state driver is not active"
));
return
VIR_DRV_OPEN_ERROR
;
}
if
(
virConnectOpenEnsureACL
(
conn
)
<
0
)
return
VIR_DRV_OPEN_ERROR
;
if
(
virConnectOpenEnsureACL
(
conn
)
<
0
)
return
VIR_DRV_OPEN_ERROR
;
conn
->
privateData
=
bhyve_driver
;
conn
->
privateData
=
bhyve_driver
;
return
VIR_DRV_OPEN_SUCCESS
;
return
VIR_DRV_OPEN_SUCCESS
;
}
static
int
...
...
src/conf/domain_conf.c
浏览文件 @
ab9a1459
...
...
@@ -14435,7 +14435,7 @@ virDomainNVRAMDefParseXML(virDomainXMLOptionPtr xmlopt,
xmlNodePtr node,
unsigned int flags)
{
virDomainNVRAMDefPtr def;
virDomainNVRAMDefPtr def;
if (VIR_ALLOC(def) < 0)
return NULL;
...
...
src/cpu/cpu_s390.c
浏览文件 @
ab9a1459
...
...
@@ -48,50 +48,50 @@ static int
virCPUs390Update
(
virCPUDefPtr
guest
,
const
virCPUDef
*
host
)
{
virCPUDefPtr
updated
=
NULL
;
int
ret
=
-
1
;
size_t
i
;
if
(
guest
->
match
==
VIR_CPU_MATCH_MINIMUM
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"match mode %s not supported"
),
virCPUMatchTypeToString
(
guest
->
match
));
goto
cleanup
;
}
if
(
guest
->
mode
!=
VIR_CPU_MODE_HOST_MODEL
)
{
ret
=
0
;
goto
cleanup
;
}
if
(
!
host
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"unknown host CPU model"
));
goto
cleanup
;
}
if
(
!
(
updated
=
virCPUDefCopyWithoutModel
(
guest
)))
goto
cleanup
;
updated
->
mode
=
VIR_CPU_MODE_CUSTOM
;
if
(
virCPUDefCopyModel
(
updated
,
host
,
true
)
<
0
)
goto
cleanup
;
for
(
i
=
0
;
i
<
guest
->
nfeatures
;
i
++
)
{
if
(
virCPUDefUpdateFeature
(
updated
,
guest
->
features
[
i
].
name
,
guest
->
features
[
i
].
policy
)
<
0
)
goto
cleanup
;
}
virCPUDefStealModel
(
guest
,
updated
,
false
);
guest
->
mode
=
VIR_CPU_MODE_CUSTOM
;
guest
->
match
=
VIR_CPU_MATCH_EXACT
;
ret
=
0
;
virCPUDefPtr
updated
=
NULL
;
int
ret
=
-
1
;
size_t
i
;
if
(
guest
->
match
==
VIR_CPU_MATCH_MINIMUM
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"match mode %s not supported"
),
virCPUMatchTypeToString
(
guest
->
match
));
goto
cleanup
;
}
if
(
guest
->
mode
!=
VIR_CPU_MODE_HOST_MODEL
)
{
ret
=
0
;
goto
cleanup
;
}
if
(
!
host
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"unknown host CPU model"
));
goto
cleanup
;
}
if
(
!
(
updated
=
virCPUDefCopyWithoutModel
(
guest
)))
goto
cleanup
;
updated
->
mode
=
VIR_CPU_MODE_CUSTOM
;
if
(
virCPUDefCopyModel
(
updated
,
host
,
true
)
<
0
)
goto
cleanup
;
for
(
i
=
0
;
i
<
guest
->
nfeatures
;
i
++
)
{
if
(
virCPUDefUpdateFeature
(
updated
,
guest
->
features
[
i
].
name
,
guest
->
features
[
i
].
policy
)
<
0
)
goto
cleanup
;
}
virCPUDefStealModel
(
guest
,
updated
,
false
);
guest
->
mode
=
VIR_CPU_MODE_CUSTOM
;
guest
->
match
=
VIR_CPU_MATCH_EXACT
;
ret
=
0
;
cleanup:
virCPUDefFree
(
updated
);
return
ret
;
virCPUDefFree
(
updated
);
return
ret
;
}
...
...
src/esx/esx_vi_types.c
浏览文件 @
ab9a1459
...
...
@@ -1781,7 +1781,7 @@ ESX_VI__TEMPLATE__LIST__APPEND(Event)
/* esxVI_Event_CastFromAnyType */
ESX_VI__TEMPLATE__DYNAMIC_CAST_FROM_ANY_TYPE
(
Event
,
{
case
esxVI_Type_Other
:
case
esxVI_Type_Other
:
/* Just accept everything here */
break
;
})
...
...
src/qemu/qemu_domain_address.c
浏览文件 @
ab9a1459
...
...
@@ -2301,48 +2301,49 @@ qemuDomainAddressFindNewTargetIndex(virDomainDefPtr def)
static
int
qemuDomainAddressFindNewBusNr
(
virDomainDefPtr
def
)
{
/* Try to find a nice default for busNr for a new pci-expander-bus.
* This is a bit tricky, since you need to satisfy the following:
*
* 1) There need to be enough unused bus numbers between busNr of this
* bus and busNr of the next highest bus for the guest to assign a
* unique bus number to each PCI bus that is a child of this
* bus. Each PCI controller. On top of this, the pxb device (which
* implements the pci-expander-bus) includes a pci-bridge within
* it, and that bridge also uses one bus number (so each pxb device
* requires at least 2 bus numbers).
*
* 2) There need to be enough bus numbers *below* this for all the
* child controllers of the pci-expander-bus with the next lower
* busNr (or the pci-root bus if there are no lower
* pci-expander-buses).
*
* 3) If at all possible, we want to avoid needing to change the busNr
* of a bus in the future, as that changes the guest's device ABI,
* which could potentially lead to issues with a guest OS that is
* picky about such things.
*
* Due to the impossibility of predicting what might be added to the
* config in the future, we can't make a foolproof choice, but since
* a pci-expander-bus (pxb) has slots for 32 devices, and the only
* practical use for it is to assign real devices on a particular
* NUMA node in the host, it's reasonably safe to assume it should
* never need any additional child buses (probably only a few of the
* 32 will ever be used). So for pci-expander-bus we find the lowest
* existing busNr, and set this one to the current lowest - 2 (one
* for the pxb, one for the intergrated pci-bridge), thus leaving the
* maximum possible bus numbers available for other buses plugged
* into pci-root (i.e. pci-bridges and other
* pci-expander-buses). Anyone who needs more than 32 devices
* descended from one pci-expander-bus should set the busNr manually
* in the config.
*
* There is room for more error checking here - in particular we
* can/should determine the ultimate parent (root-bus) of each PCI
* controller and determine if there is enough space for all the
* buses within the current range allotted to the bus just prior to
* this one.
*/
/* Try to find a nice default for busNr for a new pci-expander-bus.
* This is a bit tricky, since you need to satisfy the following:
*
* 1) There need to be enough unused bus numbers between busNr of this
* bus and busNr of the next highest bus for the guest to assign a
* unique bus number to each PCI bus that is a child of this
* bus. Each PCI controller. On top of this, the pxb device (which
* implements the pci-expander-bus) includes a pci-bridge within
* it, and that bridge also uses one bus number (so each pxb device
* requires at least 2 bus numbers).
*
* 2) There need to be enough bus numbers *below* this for all the
* child controllers of the pci-expander-bus with the next lower
* busNr (or the pci-root bus if there are no lower
* pci-expander-buses).
*
* 3) If at all possible, we want to avoid needing to change the busNr
* of a bus in the future, as that changes the guest's device ABI,
* which could potentially lead to issues with a guest OS that is
* picky about such things.
*
* Due to the impossibility of predicting what might be added to the
* config in the future, we can't make a foolproof choice, but since
* a pci-expander-bus (pxb) has slots for 32 devices, and the only
* practical use for it is to assign real devices on a particular
* NUMA node in the host, it's reasonably safe to assume it should
* never need any additional child buses (probably only a few of the
* 32 will ever be used). So for pci-expander-bus we find the lowest
* existing busNr, and set this one to the current lowest - 2 (one
* for the pxb, one for the intergrated pci-bridge), thus leaving the
* maximum possible bus numbers available for other buses plugged
* into pci-root (i.e. pci-bridges and other
* pci-expander-buses). Anyone who needs more than 32 devices
* descended from one pci-expander-bus should set the busNr manually
* in the config.
*
* There is room for more error checking here - in particular we
* can/should determine the ultimate parent (root-bus) of each PCI
* controller and determine if there is enough space for all the
* buses within the current range allotted to the bus just prior to
* this one.
*/
size_t
i
;
int
lowestBusNr
=
256
;
...
...
src/util/vircommand.c
浏览文件 @
ab9a1459
...
...
@@ -2872,10 +2872,10 @@ virCommandFree(virCommandPtr cmd)
void
virCommandDoAsyncIO
(
virCommandPtr
cmd
)
{
if
(
!
cmd
||
cmd
->
has_error
)
return
;
if
(
!
cmd
||
cmd
->
has_error
)
return
;
cmd
->
flags
|=
VIR_EXEC_ASYNC_IO
|
VIR_EXEC_NONBLOCK
;
cmd
->
flags
|=
VIR_EXEC_ASYNC_IO
|
VIR_EXEC_NONBLOCK
;
}
/**
...
...
src/util/virnetdev.c
浏览文件 @
ab9a1459
...
...
@@ -295,36 +295,36 @@ virNetDevSetMACInternal(const char *ifname,
const
virMacAddr
*
macaddr
,
bool
quiet
)
{
struct
ifreq
ifr
;
struct
sockaddr_dl
sdl
;
char
mac
[
VIR_MAC_STRING_BUFLEN
+
1
]
=
":"
;
VIR_AUTOCLOSE
s
=
-
1
;
if
((
s
=
virNetDevSetupControl
(
ifname
,
&
ifr
))
<
0
)
return
-
1
;
struct
ifreq
ifr
;
struct
sockaddr_dl
sdl
;
char
mac
[
VIR_MAC_STRING_BUFLEN
+
1
]
=
":"
;
VIR_AUTOCLOSE
s
=
-
1
;
virMacAddrFormat
(
macaddr
,
mac
+
1
);
sdl
.
sdl_len
=
sizeof
(
sdl
);
link_addr
(
mac
,
&
sdl
);
if
((
s
=
virNetDevSetupControl
(
ifname
,
&
ifr
))
<
0
)
return
-
1
;
memcpy
(
ifr
.
ifr_addr
.
sa_data
,
sdl
.
sdl_data
,
VIR_MAC_BUFLEN
);
ifr
.
ifr_addr
.
sa_len
=
VIR_MAC_BUFLEN
;
virMacAddrFormat
(
macaddr
,
mac
+
1
);
sdl
.
sdl_len
=
sizeof
(
sdl
);
link_addr
(
mac
,
&
sdl
);
if
(
ioctl
(
s
,
SIOCSIFLLADDR
,
&
ifr
)
<
0
)
{
if
(
quiet
&&
(
errno
==
EADDRNOTAVAIL
||
errno
==
EPERM
))
{
VIR_DEBUG
(
"SIOCSIFLLADDR %s MAC=%s - Fail"
,
ifname
,
mac
+
1
);
return
-
1
;
}
memcpy
(
ifr
.
ifr_addr
.
sa_data
,
sdl
.
sdl_data
,
VIR_MAC_BUFLEN
);
ifr
.
ifr_addr
.
sa_len
=
VIR_MAC_BUFLEN
;
virReportSystemError
(
errno
,
_
(
"Cannot set interface MAC to %s on '%s'"
),
mac
+
1
,
ifname
);
if
(
ioctl
(
s
,
SIOCSIFLLADDR
,
&
ifr
)
<
0
)
{
if
(
quiet
&&
(
errno
==
EADDRNOTAVAIL
||
errno
==
EPERM
))
{
VIR_DEBUG
(
"SIOCSIFLLADDR %s MAC=%s - Fail"
,
ifname
,
mac
+
1
);
return
-
1
;
}
VIR_DEBUG
(
"SIOCSIFLLADDR %s MAC=%s - Success"
,
ifname
,
mac
+
1
);
return
0
;
virReportSystemError
(
errno
,
_
(
"Cannot set interface MAC to %s on '%s'"
),
mac
+
1
,
ifname
);
return
-
1
;
}
VIR_DEBUG
(
"SIOCSIFLLADDR %s MAC=%s - Success"
,
ifname
,
mac
+
1
);
return
0
;
}
...
...
src/util/virnetdevmacvlan.c
浏览文件 @
ab9a1459
...
...
@@ -546,11 +546,11 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
bool
*
handled
,
void
*
opaque
)
{
struct
nla_policy
ifla_vf_policy
[
IFLA_VF_MAX
+
1
]
=
{
[
IFLA_VF_MAC
]
=
{.
minlen
=
sizeof
(
struct
ifla_vf_mac
),
.
maxlen
=
sizeof
(
struct
ifla_vf_mac
)},
[
IFLA_VF_VLAN
]
=
{.
minlen
=
sizeof
(
struct
ifla_vf_vlan
),
.
maxlen
=
sizeof
(
struct
ifla_vf_vlan
)},
struct
nla_policy
ifla_vf_policy
[
IFLA_VF_MAX
+
1
]
=
{
[
IFLA_VF_MAC
]
=
{.
minlen
=
sizeof
(
struct
ifla_vf_mac
),
.
maxlen
=
sizeof
(
struct
ifla_vf_mac
)},
[
IFLA_VF_VLAN
]
=
{.
minlen
=
sizeof
(
struct
ifla_vf_vlan
),
.
maxlen
=
sizeof
(
struct
ifla_vf_vlan
)},
};
struct
nla_policy
ifla_port_policy
[
IFLA_PORT_MAX
+
1
]
=
{
...
...
src/util/virnetdevvportprofile.c
浏览文件 @
ab9a1459
...
...
@@ -451,7 +451,7 @@ int virNetDevVPortProfileMerge3(virNetDevVPortProfilePtr *result,
static
struct
nla_policy
ifla_port_policy
[
IFLA_PORT_MAX
+
1
]
=
{
[
IFLA_PORT_RESPONSE
]
=
{
.
type
=
NLA_U16
},
[
IFLA_PORT_RESPONSE
]
=
{
.
type
=
NLA_U16
},
};
static
uint32_t
...
...
src/util/virutil.c
浏览文件 @
ab9a1459
...
...
@@ -940,7 +940,7 @@ char *virGetUserConfigDirectory(void)
char
*
virGetUserCacheDirectory
(
void
)
{
return
virGetXDGDirectory
(
"XDG_CACHE_HOME"
,
".cache"
);
return
virGetXDGDirectory
(
"XDG_CACHE_HOME"
,
".cache"
);
}
char
*
virGetUserRuntimeDirectory
(
void
)
...
...
src/vbox/vbox_tmpl.c
浏览文件 @
ab9a1459
...
...
@@ -1253,11 +1253,11 @@ _systemPropertiesGetMaxNetworkAdapters(ISystemProperties *systemProperties, PRUi
PRUint32
*
maxNetworkAdapters
)
{
#if VBOX_API_VERSION < 4001000
return
systemProperties
->
vtbl
->
GetNetworkAdapterCount
(
systemProperties
,
maxNetworkAdapters
);
return
systemProperties
->
vtbl
->
GetNetworkAdapterCount
(
systemProperties
,
maxNetworkAdapters
);
#else
/* VBOX_API_VERSION >= 4000000 */
return
systemProperties
->
vtbl
->
GetMaxNetworkAdapters
(
systemProperties
,
chipset
,
maxNetworkAdapters
);
return
systemProperties
->
vtbl
->
GetMaxNetworkAdapters
(
systemProperties
,
chipset
,
maxNetworkAdapters
);
#endif
/* VBOX_API_VERSION >= 4000000 */
}
...
...
src/xenconfig/xen_common.c
浏览文件 @
ab9a1459
...
...
@@ -1911,11 +1911,11 @@ xenFormatVif(virConfPtr conf,
virDomainDefPtr
def
,
const
char
*
vif_typename
)
{
virConfValuePtr
netVal
=
NULL
;
size_t
i
;
int
hvm
=
def
->
os
.
type
==
VIR_DOMAIN_OSTYPE_HVM
;
virConfValuePtr
netVal
=
NULL
;
size_t
i
;
int
hvm
=
def
->
os
.
type
==
VIR_DOMAIN_OSTYPE_HVM
;
if
(
VIR_ALLOC
(
netVal
)
<
0
)
if
(
VIR_ALLOC
(
netVal
)
<
0
)
goto
cleanup
;
netVal
->
type
=
VIR_CONF_LIST
;
netVal
->
list
=
NULL
;
...
...
@@ -1923,7 +1923,7 @@ xenFormatVif(virConfPtr conf,
for
(
i
=
0
;
i
<
def
->
nnets
;
i
++
)
{
if
(
xenFormatNet
(
conn
,
netVal
,
def
->
nets
[
i
],
hvm
,
vif_typename
)
<
0
)
goto
cleanup
;
goto
cleanup
;
}
if
(
netVal
->
list
!=
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录