Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
04e9e1b2
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看板
提交
04e9e1b2
编写于
9月 17, 2008
作者:
R
Richard W.M. Jones
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
configure.in, src/qemu_driver.h, src/qemu_driver.c: KVM
can determine max VCPUs at runtime (Guido Günther).
上级
bf26cd8e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
1 deletion
+51
-1
ChangeLog
ChangeLog
+5
-0
configure.in
configure.in
+5
-0
src/qemu_driver.c
src/qemu_driver.c
+23
-1
src/qemu_driver.h
src/qemu_driver.h
+18
-0
未找到文件。
ChangeLog
浏览文件 @
04e9e1b2
Wed Sep 17 15:03:00 BST 2008 Richard W.M. Jones <rjones@redhat.com>
* configure.in, src/qemu_driver.h, src/qemu_driver.c: KVM
can determine max VCPUs at runtime (Guido Günther).
Tue Sep 16 12:43:00 EST 2008 Cole Robinson <crobinso@redhat.com>
Tue Sep 16 12:43:00 EST 2008 Cole Robinson <crobinso@redhat.com>
* src/storack_backend_disk.c: Implement disk volume delete
* src/storack_backend_disk.c: Implement disk volume delete
...
...
configure.in
浏览文件 @
04e9e1b2
...
@@ -316,6 +316,11 @@ if test "$with_qemu" = "yes" -o "$with_lxc" = "yes" ; then
...
@@ -316,6 +316,11 @@ if test "$with_qemu" = "yes" -o "$with_lxc" = "yes" ; then
AC_MSG_ERROR([You must install kernel-headers in order to compile libvirt]))
AC_MSG_ERROR([You must install kernel-headers in order to compile libvirt]))
fi
fi
dnl
dnl check for kvm headers
dnl
AC_CHECK_HEADERS([linux/kvm.h])
dnl Need to test if pkg-config exists
dnl Need to test if pkg-config exists
PKG_PROG_PKG_CONFIG
PKG_PROG_PKG_CONFIG
...
...
src/qemu_driver.c
浏览文件 @
04e9e1b2
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include <pwd.h>
#include <pwd.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/wait.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#if HAVE_NUMACTL
#if HAVE_NUMACTL
#include <numa.h>
#include <numa.h>
...
@@ -1804,6 +1805,27 @@ static const char *qemudGetType(virConnectPtr conn ATTRIBUTE_UNUSED) {
...
@@ -1804,6 +1805,27 @@ static const char *qemudGetType(virConnectPtr conn ATTRIBUTE_UNUSED) {
return
"QEMU"
;
return
"QEMU"
;
}
}
static
int
kvmGetMaxVCPUs
(
void
)
{
int
maxvcpus
=
1
;
int
r
,
fd
;
fd
=
open
(
KVM_DEVICE
,
O_RDONLY
);
if
(
fd
<
0
)
{
qemudLog
(
QEMUD_WARN
,
_
(
"Unable to open "
KVM_DEVICE
": %s
\n
"
),
strerror
(
errno
));
return
maxvcpus
;
}
r
=
ioctl
(
fd
,
KVM_CHECK_EXTENSION
,
KVM_CAP_NR_VCPUS
);
if
(
r
>
0
)
maxvcpus
=
r
;
close
(
fd
);
return
maxvcpus
;
}
static
int
qemudGetMaxVCPUs
(
virConnectPtr
conn
,
const
char
*
type
)
{
static
int
qemudGetMaxVCPUs
(
virConnectPtr
conn
,
const
char
*
type
)
{
if
(
!
type
)
if
(
!
type
)
return
16
;
return
16
;
...
@@ -1814,7 +1836,7 @@ static int qemudGetMaxVCPUs(virConnectPtr conn, const char *type) {
...
@@ -1814,7 +1836,7 @@ static int qemudGetMaxVCPUs(virConnectPtr conn, const char *type) {
/* XXX future KVM will support SMP. Need to probe
/* XXX future KVM will support SMP. Need to probe
kernel to figure out KVM module version i guess */
kernel to figure out KVM module version i guess */
if
(
STRCASEEQ
(
type
,
"kvm"
))
if
(
STRCASEEQ
(
type
,
"kvm"
))
return
1
;
return
kvmGetMaxVCPUs
()
;
if
(
STRCASEEQ
(
type
,
"kqemu"
))
if
(
STRCASEEQ
(
type
,
"kqemu"
))
return
1
;
return
1
;
...
...
src/qemu_driver.h
浏览文件 @
04e9e1b2
...
@@ -29,6 +29,24 @@
...
@@ -29,6 +29,24 @@
#include "internal.h"
#include "internal.h"
#if HAVE_LINUX_KVM_H
#include <linux/kvm.h>
#endif
/* device for kvm ioctls */
#define KVM_DEVICE "/dev/kvm"
/* add definitions missing in older linux/kvm.h */
#ifndef KVMIO
# define KVMIO 0xAE
#endif
#ifndef KVM_CHECK_EXTENSION
# define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03)
#endif
#ifndef KVM_CAP_NR_VCPUS
# define KVM_CAP_NR_VCPUS 9
/* returns max vcpus per vm */
#endif
int
qemudRegister
(
void
);
int
qemudRegister
(
void
);
#endif
/* QEMUD_DRIVER_H */
#endif
/* QEMUD_DRIVER_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录