Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
0e7aa573
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看板
提交
0e7aa573
编写于
9月 29, 2007
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Solaris hypercall compatability fixes (Mark Johnson)
上级
84b5415c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
65 addition
and
17 deletion
+65
-17
ChangeLog
ChangeLog
+5
-0
src/xen_internal.c
src/xen_internal.c
+54
-17
src/xs_internal.c
src/xs_internal.c
+6
-0
未找到文件。
ChangeLog
浏览文件 @
0e7aa573
Sat Sep 29 14:30:41 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/xen_internal.c, src/xs_internal.c: Solaris hypercall compat
changes. (Mark Johnson)
Sat Sep 29 14:23:41 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/sexpr.h, src/sexpr.c, src/xml.c, src/xend_internal.c: Allow
...
...
src/xen_internal.c
浏览文件 @
0e7aa573
...
...
@@ -57,9 +57,10 @@ typedef struct v0_hypercall_struct {
unsigned
long
op
;
unsigned
long
arg
[
5
];
}
v0_hypercall_t
;
#ifdef __linux__
#define XEN_V0_IOCTL_HYPERCALL_CMD \
_IOC(_IOC_NONE, 'P', 0, sizeof(v0_hypercall_t))
/* the new one */
typedef
struct
v1_hypercall_struct
{
...
...
@@ -68,8 +69,12 @@ typedef struct v1_hypercall_struct
}
v1_hypercall_t
;
#define XEN_V1_IOCTL_HYPERCALL_CMD \
_IOC(_IOC_NONE, 'P', 0, sizeof(v1_hypercall_t))
typedef
v1_hypercall_t
hypercall_t
;
#elif define(__sun__)
typedef
privcmd_hypercall_t
hypercall_t
;
#else
#error "unsupported platform"
#endif
#ifndef __HYPERVISOR_sysctl
#define __HYPERVISOR_sysctl 35
...
...
@@ -325,6 +330,26 @@ typedef struct xen_v2s4_availheap xen_v2s4_availheap;
dominfo.v2d5.handle))
static
int
lock_pages
(
void
*
addr
,
size_t
len
)
{
#ifdef __linux__
return
(
mlock
(
addr
,
len
));
#elif define(__sun)
return
(
0
);
#endif
}
static
int
unlock_pages
(
void
*
addr
,
size_t
len
)
{
#ifdef __linux__
return
(
munlock
(
addr
,
len
));
#elif define(__sun)
return
(
0
);
#endif
}
struct
xen_v0_getdomaininfolistop
{
domid_t
first_domain
;
...
...
@@ -632,7 +657,17 @@ typedef struct xen_op_v2_dom xen_op_v2_dom;
#include "xen_unified.h"
#include "xen_internal.h"
#define XEN_HYPERVISOR_SOCKET "/proc/xen/privcmd"
#ifdef __linux__
#define XEN_HYPERVISOR_SOCKET "/proc/xen/privcmd"
#define HYPERVISOR_CAPABILITIES "/sys/hypervisor/properties/capabilities"
#define CPUINFO "/proc/cpuinfo"
#elif define(__sun__)
#define XEN_HYPERVISOR_SOCKET "/dev/xen/privcmd"
#define HYPERVISOR_CAPABILITIES ""
#define CPUINFO "/dev/cpu/self/cpuid"
#else
#error "unsupported platform"
#endif
#ifndef PROXY
static
const
char
*
xenHypervisorGetType
(
virConnectPtr
conn
);
...
...
@@ -789,7 +824,7 @@ xenHypervisorDoV0Op(int handle, xen_op_v0 * op)
hc
.
op
=
__HYPERVISOR_dom0_op
;
hc
.
arg
[
0
]
=
(
unsigned
long
)
op
;
if
(
mlock
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
if
(
lock_pages
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" locking"
,
sizeof
(
*
op
));
return
(
-
1
);
}
...
...
@@ -799,7 +834,7 @@ xenHypervisorDoV0Op(int handle, xen_op_v0 * op)
virXenError
(
VIR_ERR_XEN_CALL
,
" ioctl "
,
xen_ioctl_hypercall_cmd
);
}
if
(
munlock
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
if
(
unlock_pages
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" releasing"
,
sizeof
(
*
op
));
ret
=
-
1
;
}
...
...
@@ -830,7 +865,7 @@ xenHypervisorDoV1Op(int handle, xen_op_v1* op)
hc
.
op
=
__HYPERVISOR_dom0_op
;
hc
.
arg
[
0
]
=
(
unsigned
long
)
op
;
if
(
mlock
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
if
(
lock_pages
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" locking"
,
sizeof
(
*
op
));
return
(
-
1
);
}
...
...
@@ -840,7 +875,7 @@ xenHypervisorDoV1Op(int handle, xen_op_v1* op)
virXenError
(
VIR_ERR_XEN_CALL
,
" ioctl "
,
xen_ioctl_hypercall_cmd
);
}
if
(
munlock
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
if
(
unlock_pages
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" releasing"
,
sizeof
(
*
op
));
ret
=
-
1
;
}
...
...
@@ -872,7 +907,7 @@ xenHypervisorDoV2Sys(int handle, xen_op_v2_sys* op)
hc
.
op
=
__HYPERVISOR_sysctl
;
hc
.
arg
[
0
]
=
(
unsigned
long
)
op
;
if
(
mlock
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
if
(
lock_pages
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" locking"
,
sizeof
(
*
op
));
return
(
-
1
);
}
...
...
@@ -882,7 +917,7 @@ xenHypervisorDoV2Sys(int handle, xen_op_v2_sys* op)
virXenError
(
VIR_ERR_XEN_CALL
,
" sys ioctl "
,
xen_ioctl_hypercall_cmd
);
}
if
(
munlock
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
if
(
unlock_pages
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" releasing"
,
sizeof
(
*
op
));
ret
=
-
1
;
}
...
...
@@ -914,7 +949,7 @@ xenHypervisorDoV2Dom(int handle, xen_op_v2_dom* op)
hc
.
op
=
__HYPERVISOR_domctl
;
hc
.
arg
[
0
]
=
(
unsigned
long
)
op
;
if
(
mlock
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
if
(
lock_pages
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" locking"
,
sizeof
(
*
op
));
return
(
-
1
);
}
...
...
@@ -924,7 +959,7 @@ xenHypervisorDoV2Dom(int handle, xen_op_v2_dom* op)
virXenError
(
VIR_ERR_XEN_CALL
,
" ioctl "
,
xen_ioctl_hypercall_cmd
);
}
if
(
munlock
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
if
(
unlock_pages
(
op
,
sizeof
(
dom0_op_t
))
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" releasing"
,
sizeof
(
*
op
));
ret
=
-
1
;
}
...
...
@@ -952,7 +987,7 @@ virXen_getdomaininfolist(int handle, int first_domain, int maxids,
{
int
ret
=
-
1
;
if
(
mlock
(
XEN_GETDOMAININFOLIST_DATA
(
dominfos
),
if
(
lock_pages
(
XEN_GETDOMAININFOLIST_DATA
(
dominfos
),
XEN_GETDOMAININFO_SIZE
*
maxids
)
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" locking"
,
XEN_GETDOMAININFO_SIZE
*
maxids
);
...
...
@@ -1008,7 +1043,7 @@ virXen_getdomaininfolist(int handle, int first_domain, int maxids,
if
(
ret
==
0
)
ret
=
op
.
u
.
getdomaininfolist
.
num_domains
;
}
if
(
munlock
(
XEN_GETDOMAININFOLIST_DATA
(
dominfos
),
if
(
unlock_pages
(
XEN_GETDOMAININFOLIST_DATA
(
dominfos
),
XEN_GETDOMAININFO_SIZE
*
maxids
)
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" release"
,
XEN_GETDOMAININFO_SIZE
*
maxids
);
...
...
@@ -1701,7 +1736,7 @@ virXen_setvcpumap(int handle, int id, unsigned int vcpu,
if
(
hypervisor_version
>
1
)
{
xen_op_v2_dom
op
;
if
(
mlock
(
cpumap
,
maplen
)
<
0
)
{
if
(
lock_pages
(
cpumap
,
maplen
)
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" locking"
,
maplen
);
return
(
-
1
);
}
...
...
@@ -1719,7 +1754,7 @@ virXen_setvcpumap(int handle, int id, unsigned int vcpu,
}
ret
=
xenHypervisorDoV2Dom
(
handle
,
&
op
);
if
(
munlock
(
cpumap
,
maplen
)
<
0
)
{
if
(
unlock_pages
(
cpumap
,
maplen
)
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" release"
,
maplen
);
ret
=
-
1
;
}
...
...
@@ -1816,7 +1851,7 @@ virXen_getvcpusinfo(int handle, int id, unsigned int vcpu, virVcpuInfoPtr ipt,
ipt
->
cpu
=
op
.
u
.
getvcpuinfod5
.
online
?
(
int
)
op
.
u
.
getvcpuinfod5
.
cpu
:
-
1
;
}
if
((
cpumap
!=
NULL
)
&&
(
maplen
>
0
))
{
if
(
mlock
(
cpumap
,
maplen
)
<
0
)
{
if
(
lock_pages
(
cpumap
,
maplen
)
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" locking"
,
maplen
);
return
(
-
1
);
}
...
...
@@ -1834,7 +1869,7 @@ virXen_getvcpusinfo(int handle, int id, unsigned int vcpu, virVcpuInfoPtr ipt,
op
.
u
.
getvcpumapd5
.
cpumap
.
nr_cpus
=
maplen
*
8
;
}
ret
=
xenHypervisorDoV2Dom
(
handle
,
&
op
);
if
(
munlock
(
cpumap
,
maplen
)
<
0
)
{
if
(
unlock_pages
(
cpumap
,
maplen
)
<
0
)
{
virXenError
(
VIR_ERR_XEN_CALL
,
" release"
,
maplen
);
ret
=
-
1
;
}
...
...
@@ -1985,6 +2020,7 @@ xenHypervisorInit(void)
goto
detect_v2
;
}
#ifndef __sun__
/*
* check if the old hypercall are actually working
*/
...
...
@@ -2002,6 +2038,7 @@ xenHypervisorInit(void)
hypervisor_version
=
0
;
goto
done
;
}
#endif
/*
* we faild to make any hypercall
...
...
src/xs_internal.c
浏览文件 @
0e7aa573
...
...
@@ -31,7 +31,13 @@
#include "xs_internal.h"
#include "xen_internal.h"
/* for xenHypervisorCheckID */
#ifdef __linux__
#define XEN_HYPERVISOR_SOCKET "/proc/xen/privcmd"
#elif define(__sun__)
#define XEN_HYPERVISOR_SOCKET "/dev/xen/privcmd"
#else
#error "unsupported platform"
#endif
#ifndef PROXY
static
char
*
xenStoreDomainGetOSType
(
virDomainPtr
domain
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录