Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
f7fe78dc
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,发现更多精彩内容 >>
提交
f7fe78dc
编写于
5月 14, 2008
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added listen_addr config param for daemon (Stefan de Konink)
上级
1d73398e
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
27 addition
and
10 deletion
+27
-10
AUTHORS
AUTHORS
+1
-0
ChangeLog
ChangeLog
+7
-0
qemud/libvirtd.conf
qemud/libvirtd.conf
+5
-0
qemud/qemud.c
qemud/qemud.c
+13
-10
src/remote_internal.h
src/remote_internal.h
+1
-0
未找到文件。
AUTHORS
浏览文件 @
f7fe78dc
...
@@ -43,6 +43,7 @@ Patches have also been contributed by:
...
@@ -43,6 +43,7 @@ Patches have also been contributed by:
Mads Chr. Olesen <shiyee@shiyee.dk>
Mads Chr. Olesen <shiyee@shiyee.dk>
Cole Robinson <crobinso@redhat.com>
Cole Robinson <crobinso@redhat.com>
Anton Protopopov <aspsk2@gmail.com>
Anton Protopopov <aspsk2@gmail.com>
Stefan de Konink <skinkie@xs4all.nl>
[....send patches to get your name here....]
[....send patches to get your name here....]
...
...
ChangeLog
浏览文件 @
f7fe78dc
Wed May 14 15:34:43 EST 2008 Daniel P. Berrange <berrange@redhat.com>
* qemud/qemud.c: Add 'listen_addr' config param to control
the IP address the daemon listens on (Stefan de Konink)
* qemud/libvirtd.conf: Added example listen_addr config param
* src/remote_internal.h: #define constant for default IP addr
Wed May 14 15:34:43 EST 2008 Daniel P. Berrange <berrange@redhat.com>
Wed May 14 15:34:43 EST 2008 Daniel P. Berrange <berrange@redhat.com>
* proxy/libvirt_proxy.c, src/conf.c, src/hash.c,
* proxy/libvirt_proxy.c, src/conf.c, src/hash.c,
...
...
qemud/libvirtd.conf
浏览文件 @
f7fe78dc
...
@@ -42,6 +42,11 @@
...
@@ -42,6 +42,11 @@
#tcp_port = "16509"
#tcp_port = "16509"
# Override the default configuration which binds to all network
# interfaces. This can be a numeric IPv4/6 address, or hostname
#
# ip_addr = "192.168.0.1"
# Flag toggling mDNS advertizement of the libvirt service.
# Flag toggling mDNS advertizement of the libvirt service.
#
#
...
...
qemud/qemud.c
浏览文件 @
f7fe78dc
...
@@ -69,6 +69,7 @@ static int ipsock = 0; /* -l Listen for TCP/IP */
...
@@ -69,6 +69,7 @@ static int ipsock = 0; /* -l Listen for TCP/IP */
/* Defaults for configuration file elements */
/* Defaults for configuration file elements */
static
int
listen_tls
=
1
;
static
int
listen_tls
=
1
;
static
int
listen_tcp
=
0
;
static
int
listen_tcp
=
0
;
static
char
*
listen_addr
=
(
char
*
)
LIBVIRTD_LISTEN_ADDR
;
static
char
*
tls_port
=
(
char
*
)
LIBVIRTD_TLS_PORT
;
static
char
*
tls_port
=
(
char
*
)
LIBVIRTD_TLS_PORT
;
static
char
*
tcp_port
=
(
char
*
)
LIBVIRTD_TCP_PORT
;
static
char
*
tcp_port
=
(
char
*
)
LIBVIRTD_TCP_PORT
;
...
@@ -541,7 +542,7 @@ static int qemudListenUnix(struct qemud_server *server,
...
@@ -541,7 +542,7 @@ static int qemudListenUnix(struct qemud_server *server,
// See: http://people.redhat.com/drepper/userapi-ipv6.html
// See: http://people.redhat.com/drepper/userapi-ipv6.html
static
int
static
int
remoteMakeSockets
(
int
*
fds
,
int
max_fds
,
int
*
nfds_r
,
const
char
*
service
)
remoteMakeSockets
(
int
*
fds
,
int
max_fds
,
int
*
nfds_r
,
const
char
*
node
,
const
char
*
service
)
{
{
struct
addrinfo
*
ai
;
struct
addrinfo
*
ai
;
struct
addrinfo
hints
;
struct
addrinfo
hints
;
...
@@ -549,7 +550,7 @@ remoteMakeSockets (int *fds, int max_fds, int *nfds_r, const char *service)
...
@@ -549,7 +550,7 @@ remoteMakeSockets (int *fds, int max_fds, int *nfds_r, const char *service)
hints
.
ai_flags
=
AI_PASSIVE
|
AI_ADDRCONFIG
;
hints
.
ai_flags
=
AI_PASSIVE
|
AI_ADDRCONFIG
;
hints
.
ai_socktype
=
SOCK_STREAM
;
hints
.
ai_socktype
=
SOCK_STREAM
;
int
e
=
getaddrinfo
(
NULL
,
service
,
&
hints
,
&
ai
);
int
e
=
getaddrinfo
(
node
,
service
,
&
hints
,
&
ai
);
if
(
e
!=
0
)
{
if
(
e
!=
0
)
{
qemudLog
(
QEMUD_ERR
,
_
(
"getaddrinfo: %s
\n
"
),
gai_strerror
(
e
));
qemudLog
(
QEMUD_ERR
,
_
(
"getaddrinfo: %s
\n
"
),
gai_strerror
(
e
));
return
-
1
;
return
-
1
;
...
@@ -593,6 +594,7 @@ remoteMakeSockets (int *fds, int max_fds, int *nfds_r, const char *service)
...
@@ -593,6 +594,7 @@ remoteMakeSockets (int *fds, int max_fds, int *nfds_r, const char *service)
*/
*/
static
int
static
int
remoteListenTCP
(
struct
qemud_server
*
server
,
remoteListenTCP
(
struct
qemud_server
*
server
,
const
char
*
addr
,
const
char
*
port
,
const
char
*
port
,
int
type
,
int
type
,
int
auth
)
int
auth
)
...
@@ -602,7 +604,7 @@ remoteListenTCP (struct qemud_server *server,
...
@@ -602,7 +604,7 @@ remoteListenTCP (struct qemud_server *server,
int
i
;
int
i
;
struct
qemud_socket
*
sock
;
struct
qemud_socket
*
sock
;
if
(
remoteMakeSockets
(
fds
,
2
,
&
nfds
,
port
)
==
-
1
)
if
(
remoteMakeSockets
(
fds
,
2
,
&
nfds
,
addr
,
port
)
==
-
1
)
return
-
1
;
return
-
1
;
for
(
i
=
0
;
i
<
nfds
;
++
i
)
{
for
(
i
=
0
;
i
<
nfds
;
++
i
)
{
...
@@ -779,14 +781,14 @@ static struct qemud_server *qemudNetworkInit(struct qemud_server *server) {
...
@@ -779,14 +781,14 @@ static struct qemud_server *qemudNetworkInit(struct qemud_server *server) {
#endif
#endif
if
(
ipsock
)
{
if
(
ipsock
)
{
if
(
listen_tcp
&&
remoteListenTCP
(
server
,
tcp_port
,
QEMUD_SOCK_TYPE_TCP
,
auth_tcp
)
<
0
)
if
(
listen_tcp
&&
remoteListenTCP
(
server
,
listen_addr
,
tcp_port
,
QEMUD_SOCK_TYPE_TCP
,
auth_tcp
)
<
0
)
goto
cleanup
;
goto
cleanup
;
if
(
listen_tls
)
{
if
(
listen_tls
)
{
if
(
remoteInitializeGnuTLS
()
<
0
)
if
(
remoteInitializeGnuTLS
()
<
0
)
goto
cleanup
;
goto
cleanup
;
if
(
remoteListenTCP
(
server
,
tls_port
,
QEMUD_SOCK_TYPE_TLS
,
auth_tls
)
<
0
)
if
(
remoteListenTCP
(
server
,
listen_addr
,
tls_port
,
QEMUD_SOCK_TYPE_TLS
,
auth_tls
)
<
0
)
goto
cleanup
;
goto
cleanup
;
}
}
}
}
...
@@ -1921,6 +1923,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
...
@@ -1921,6 +1923,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
GET_CONF_INT
(
conf
,
filename
,
listen_tls
);
GET_CONF_INT
(
conf
,
filename
,
listen_tls
);
GET_CONF_STR
(
conf
,
filename
,
tls_port
);
GET_CONF_STR
(
conf
,
filename
,
tls_port
);
GET_CONF_STR
(
conf
,
filename
,
tcp_port
);
GET_CONF_STR
(
conf
,
filename
,
tcp_port
);
GET_CONF_STR
(
conf
,
filename
,
listen_addr
);
if
(
remoteConfigGetAuth
(
conf
,
"auth_unix_rw"
,
&
auth_unix_rw
,
filename
)
<
0
)
if
(
remoteConfigGetAuth
(
conf
,
"auth_unix_rw"
,
&
auth_unix_rw
,
filename
)
<
0
)
goto
free_and_fail
;
goto
free_and_fail
;
...
@@ -2006,10 +2009,10 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
...
@@ -2006,10 +2009,10 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
free
(
unix_sock_rw_perms
);
free
(
unix_sock_rw_perms
);
free
(
unix_sock_group
);
free
(
unix_sock_group
);
/* Don't bother trying to free
tcp_port, tls_port, key_file, cert
_file,
/* Don't bother trying to free
listen_addr, tcp_port, tls_port, key
_file,
c
a_file, or crl_file, since they are initialized to non-malloc'd
c
ert_file, ca_file, or crl_file, since they are initialized to
strings. Besides, these are static variables, and callers are
non-malloc'd strings. Besides, these are static variables, and callers
unlikely to call this function more than once, so there wouldn't
are
unlikely to call this function more than once, so there wouldn't
even be a real leak. */
even be a real leak. */
if
(
tls_allowed_dn_list
)
{
if
(
tls_allowed_dn_list
)
{
...
...
src/remote_internal.h
浏览文件 @
f7fe78dc
...
@@ -32,6 +32,7 @@ extern "C" {
...
@@ -32,6 +32,7 @@ extern "C" {
int
remoteRegister
(
void
);
int
remoteRegister
(
void
);
#define LIBVIRTD_LISTEN_ADDR NULL
#define LIBVIRTD_TLS_PORT "16514"
#define LIBVIRTD_TLS_PORT "16514"
#define LIBVIRTD_TCP_PORT "16509"
#define LIBVIRTD_TCP_PORT "16509"
#define LIBVIRTD_PRIV_UNIX_SOCKET LOCAL_STATE_DIR "/run/libvirt/libvirt-sock"
#define LIBVIRTD_PRIV_UNIX_SOCKET LOCAL_STATE_DIR "/run/libvirt/libvirt-sock"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录