Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
e39438e8
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看板
提交
e39438e8
编写于
2月 20, 2008
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added directory/filesystem/netfs based storage pool backend
上级
4a4e272f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
123 addition
and
0 deletion
+123
-0
ChangeLog
ChangeLog
+11
-0
configure.in
configure.in
+52
-0
libvirt.spec.in
libvirt.spec.in
+24
-0
po/POTFILES.in
po/POTFILES.in
+1
-0
src/Makefile.am
src/Makefile.am
+1
-0
src/storage_backend.c
src/storage_backend.c
+34
-0
未找到文件。
ChangeLog
浏览文件 @
e39438e8
Wed Feb 20 10:32:27 EST 2008 Daniel P. Berrange <berrange@redhat.com>
* configure.in: Add checks for mount/unmount/qemu-img/qcow-create
* docs/storage/*.xml: Add some example XML configs for storage
* libvirt.spec.in: Added deps on qemu-img and/or qcow-create,
and util-linux
* src/Makefile.am, src/storage_backend.c, src/storage_backend_fs.c,
src/storage_backend_fs.h: Add impl of directory, filesystem &
network filesystem pools.
* po/POTFILES.in: Added storage_backend_fs.c
Wed Feb 20 10:32:27 EST 2008 Daniel P. Berrange <berrange@redhat.com>
* configure.in: Add check for selinux library
...
...
configure.in
浏览文件 @
e39438e8
...
...
@@ -552,6 +552,52 @@ AC_SUBST(VIRSH_LIBS)
AC_SUBST(WITH_XEN)
AC_SUBST(LIBVIRT_FEATURES)
dnl
dnl Storage driver checks
dnl
AC_ARG_WITH(storage-fs,
[ --with-storage-fs with FileSystem backend for the storage driver (on)],[],[with_storage_fs=check])
if test "$with_storage_fs" = "yes" -o "$with_storage_fs" = "check"; then
AC_PATH_PROG(MOUNT, [mount], [], [$PATH:/sbin:/usr/sbin])
AC_PATH_PROG(UMOUNT, [umount], [], [$PATH:/sbin:/usr/sbin])
if test "$with_storage_fs" = "yes" ; then
if test -z "$MOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi
if test -z "$UMOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi
else
if test -z "$MOUNT" ; then with_storage_fs=no ; fi
if test -z "$UMOUNT" ; then with_storage_fs=no ; fi
if test "$with_storage_fs" = "check" ; then with_storage_fs=yes ; fi
fi
if test "$with_storage_fs" = "yes" ; then
AC_DEFINE_UNQUOTED(WITH_STORAGE_FS, 1, [whether FS backend for storage driver is enabled])
AC_DEFINE_UNQUOTED([MOUNT],["$MOUNT"],
[Location or name of the mount program])
AC_DEFINE_UNQUOTED([UMOUNT],["$UMOUNT"],
[Location or name of the mount program])
fi
fi
AM_CONDITIONAL(WITH_STORAGE_FS, [test "$with_storage_fs" = "yes"])
AC_PATH_PROG(QEMU_IMG, [qemu-img], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
if test -n "$QEMU_IMG" ; then
AC_DEFINE_UNQUOTED(HAVE_QEMU_IMG, 1, [whether qemu-img is available for non-raw files])
AC_DEFINE_UNQUOTED([QEMU_IMG],["$QEMU_IMG"],
[Location or name of the qemu-img program])
fi
AC_PATH_PROG(QCOW_CREATE, [qcow-create], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
if test -n "$QCOW_CREATE" ; then
AC_DEFINE_UNQUOTED(HAVE_QCOW_CREATE, 1, [whether qcow-create is available for non-raw files])
AC_DEFINE_UNQUOTED([QCOW_CREATE],["$QCOW_CREATE"],
[Location or name of the qcow-create program])
fi
dnl
dnl check for python
dnl
...
...
@@ -760,6 +806,12 @@ AC_MSG_NOTICE([ Test: $with_test])
AC_MSG_NOTICE([ Remote: $with_remote])
AC_MSG_NOTICE([Libvirtd: $with_libvirtd])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Storage Drivers])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([ Dir: yes])
AC_MSG_NOTICE([ FS: $with_storage_fs])
AC_MSG_NOTICE([ NetFS: $with_storage_fs])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Libraries])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS])
...
...
libvirt.spec.in
浏览文件 @
e39438e8
...
...
@@ -8,6 +8,12 @@
%define with_proxy yes
%endif
%if "%{fedora}"
%define with_qemu 1
%else
%define with_qemu 0
%endif
Summary: Library providing a simple API virtualization
Name: libvirt
Version: @VERSION@
...
...
@@ -34,6 +40,15 @@ Requires: cyrus-sasl-md5
%if %{with_polkit}
Requires: PolicyKit >= 0.6
%endif
# For mount/umount in FS driver
BuildRequires: util-linux
%if %{with_qemu}
# From QEMU RPMs
Requires: /usr/bin/qemu-img
%else
# From Xen RPMs
Requires: /usr/sbin/qcow-create
%endif
BuildRequires: xen-devel
BuildRequires: libxml2-devel
BuildRequires: readline-devel
...
...
@@ -49,6 +64,15 @@ BuildRequires: cyrus-sasl-devel
%if %{with_polkit}
BuildRequires: PolicyKit-devel >= 0.6
%endif
# For mount/umount in FS driver
BuildRequires: util-linux
%if %{with_qemu}
# From QEMU RPMs
BuildRequires: /usr/bin/qemu-img
%else
# From Xen RPMs
BuildRequires: /usr/sbin/qcow-create
%endif
Obsoletes: libvir
ExclusiveArch: i386 x86_64 ia64
...
...
po/POTFILES.in
浏览文件 @
e39438e8
...
...
@@ -11,6 +11,7 @@ src/qemu_conf.c
src/qemu_driver.c
src/remote_internal.c
src/storage_backend.c
src/storage_backend_fs.c
src/storage_conf.c
src/storage_driver.c
src/sexpr.c
...
...
src/Makefile.am
浏览文件 @
e39438e8
...
...
@@ -62,6 +62,7 @@ CLIENT_SOURCES = \
storage_conf.h storage_conf.c
\
storage_driver.h storage_driver.c
\
storage_backend.h storage_backend.c
\
storage_backend_fs.h storage_backend_fs.c
\
util.c util.h
SERVER_SOURCES
=
\
...
...
src/storage_backend.c
浏览文件 @
e39438e8
...
...
@@ -40,10 +40,24 @@
#include "util.h"
#include "storage_backend.h"
#include "storage_backend_fs.h"
static
virStorageBackendPtr
backends
[]
=
{
&
virStorageBackendDirectory
,
#if WITH_STORAGE_FS
&
virStorageBackendFileSystem
,
&
virStorageBackendNetFileSystem
,
#endif
};
virStorageBackendPtr
virStorageBackendForType
(
int
type
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
(
sizeof
(
backends
)
/
sizeof
(
backends
[
0
]))
;
i
++
)
if
(
backends
[
i
]
->
type
==
type
)
return
backends
[
i
];
virStorageReportError
(
NULL
,
VIR_ERR_INTERNAL_ERROR
,
_
(
"missing backend for pool type %d"
),
type
);
return
NULL
;
...
...
@@ -68,6 +82,15 @@ virStorageBackendVolOptionsForType(int type) {
int
virStorageBackendFromString
(
const
char
*
type
)
{
if
(
STREQ
(
type
,
"dir"
))
return
VIR_STORAGE_POOL_DIR
;
#if WITH_STORAGE_FS
if
(
STREQ
(
type
,
"fs"
))
return
VIR_STORAGE_POOL_FS
;
if
(
STREQ
(
type
,
"netfs"
))
return
VIR_STORAGE_POOL_NETFS
;
#endif
virStorageReportError
(
NULL
,
VIR_ERR_INTERNAL_ERROR
,
_
(
"unknown storage backend type %s"
),
type
);
return
-
1
;
...
...
@@ -75,6 +98,17 @@ virStorageBackendFromString(const char *type) {
const
char
*
virStorageBackendToString
(
int
type
)
{
switch
(
type
)
{
case
VIR_STORAGE_POOL_DIR
:
return
"dir"
;
#if WITH_STORAGE_FS
case
VIR_STORAGE_POOL_FS
:
return
"fs"
;
case
VIR_STORAGE_POOL_NETFS
:
return
"netfs"
;
#endif
}
virStorageReportError
(
NULL
,
VIR_ERR_INTERNAL_ERROR
,
_
(
"unknown storage backend type %d"
),
type
);
return
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录