Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
b8012ce9
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看板
提交
b8012ce9
编写于
5月 14, 2012
作者:
D
David Weber
提交者:
Eric Blake
5月 14, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sanlock: fix locking for readonly devices
Add ignore param for readonly and shared disk in sanlock
上级
891a7f9e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
1 deletion
+23
-1
AUTHORS
AUTHORS
+1
-0
src/locking/libvirt_sanlock.aug
src/locking/libvirt_sanlock.aug
+1
-0
src/locking/lock_driver_sanlock.c
src/locking/lock_driver_sanlock.c
+12
-1
src/locking/sanlock.conf
src/locking/sanlock.conf
+7
-0
src/locking/test_libvirt_sanlock.aug
src/locking/test_libvirt_sanlock.aug
+2
-0
未找到文件。
AUTHORS
浏览文件 @
b8012ce9
...
...
@@ -237,6 +237,7 @@ Patches have also been contributed by:
Eugen Feller <eugen.feller@inria.fr>
Dmitry Guryanov <dguryanov@parallels.com>
William Jon McCann <william.jon.mccann@gmail.com>
David Weber <wb@munzinger.de>
[....send patches to get your name here....]
...
...
src/locking/libvirt_sanlock.aug
浏览文件 @
b8012ce9
...
...
@@ -21,6 +21,7 @@ module Libvirt_sanlock =
|
bool_entry
"auto_disk_leases"
|
int_entry
"host_id"
|
bool_entry
"require_lease_for_disks"
|
bool_entry
"ignore_readonly_and_shared_disks"
let
comment
=
[
label
"#comment"
.
del
/
#[ \t]*/
"# "
.
store
/
([^ \t\n][^\n]*)?/
.
del
/
\n/
"
\n
"
]
let
empty
=
[
label
"#empty"
.
eol
]
...
...
src/locking/lock_driver_sanlock.c
浏览文件 @
b8012ce9
/*
* lock_driver_sanlock.c: A lock driver for Sanlock
*
* Copyright (C) 2010-201
1
Red Hat, Inc.
* Copyright (C) 2010-201
2
Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -65,6 +65,7 @@ struct _virLockManagerSanlockDriver {
bool
requireLeaseForDisks
;
int
hostID
;
bool
autoDiskLease
;
bool
ignoreReadonlyShared
;
char
*
autoDiskLeasePath
;
};
...
...
@@ -114,6 +115,10 @@ static int virLockManagerSanlockLoadConfig(const char *configFile)
CHECK_TYPE
(
"auto_disk_leases"
,
VIR_CONF_LONG
);
if
(
p
)
driver
->
autoDiskLease
=
p
->
l
;
p
=
virConfGetValue
(
conf
,
"ignore_readonly_and_shared_disks"
);
CHECK_TYPE
(
"ignore_readonly_and_shared_disks"
,
VIR_CONF_LONG
);
if
(
p
)
driver
->
ignoreReadonlyShared
=
p
->
l
;
p
=
virConfGetValue
(
conf
,
"disk_lease_dir"
);
CHECK_TYPE
(
"disk_lease_dir"
,
VIR_CONF_STRING
);
if
(
p
&&
p
->
str
)
{
...
...
@@ -625,6 +630,12 @@ static int virLockManagerSanlockAddResource(virLockManagerPtr lock,
return
-
1
;
}
if
((
flags
&
(
VIR_LOCK_MANAGER_RESOURCE_READONLY
|
VIR_LOCK_MANAGER_RESOURCE_SHARED
))
&&
driver
->
ignoreReadonlyShared
)
{
return
0
;
}
if
(
flags
&
VIR_LOCK_MANAGER_RESOURCE_READONLY
)
{
virLockError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"Readonly leases are not supported"
));
...
...
src/locking/sanlock.conf
浏览文件 @
b8012ce9
...
...
@@ -52,3 +52,10 @@
# to enabled, otherwise it defaults to disabled.
#
#require_lease_for_disks = 1
#
# Enable this flag to have sanlock ignore readonly and shared disks.
# If disabled, then this rejects attempts to share resources until
# sanlock gains support for shared locks.
#
#ignore_readonly_and_shared_disks = 1
src/locking/test_libvirt_sanlock.aug
浏览文件 @
b8012ce9
...
...
@@ -4,6 +4,7 @@ module Test_libvirt_sanlock =
disk_lease_dir =
\"
/var/lib/libvirt/sanlock
\"
host_id = 1
require_lease_for_disks = 1
ignore_readonly_and_shared_disks = 1
"
test
Libvirt_sanlock
.
lns
get
conf
=
...
...
@@ -11,3 +12,4 @@ require_lease_for_disks = 1
{
"disk_lease_dir"
=
"/var/lib/libvirt/sanlock"
}
{
"host_id"
=
"1"
}
{
"require_lease_for_disks"
=
"1"
}
{
"ignore_readonly_and_shared_disks"
=
"1"
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录