Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
ee8553e1
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,发现更多精彩内容 >>
提交
ee8553e1
编写于
5月 28, 2009
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix misc syntax problems with open nebula driver
上级
dcd98653
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
215 addition
and
201 deletion
+215
-201
ChangeLog
ChangeLog
+11
-0
Makefile.maint
Makefile.maint
+1
-0
po/POTFILES.in
po/POTFILES.in
+2
-0
src/opennebula/one_conf.c
src/opennebula/one_conf.c
+101
-101
src/opennebula/one_conf.h
src/opennebula/one_conf.h
+8
-8
src/opennebula/one_driver.c
src/opennebula/one_driver.c
+92
-92
未找到文件。
ChangeLog
浏览文件 @
ee8553e1
Thu May 28 14:11:30 BST 2009 Daniel P. Berrange <berrange@redhat.com>
Fix misc syntax check failures with OpenNebula driver
* src/opennebula/one_conf.c, src/opennebula/one_conf.h,
src/opennebula/one_driver.c, src/opennebula/one_driver.h: Kill
trailing whitespace, automatic re-indent of all code, added
missing translation marking
* Makefile.maint: Add oneError() as a function with translatable
strings.
* po/POTFILES.in: Add one_conf.c, one_driver.c
Thu May 28 13:27:30 BST 2009 Daniel P. Berrange <berrange@redhat.com>
* src/logging.c: Include function name & line number in all
...
...
Makefile.maint
浏览文件 @
ee8553e1
...
...
@@ -332,6 +332,7 @@ msg_gen_function += errorf
msg_gen_function
+=
lxcError
msg_gen_function
+=
networkLog
msg_gen_function
+=
networkReportError
msg_gen_function
+=
oneError
msg_gen_function
+=
openvzError
msg_gen_function
+=
openvzLog
msg_gen_function
+=
qemudDispatchClientFailure
...
...
po/POTFILES.in
浏览文件 @
ee8553e1
...
...
@@ -16,6 +16,8 @@ src/network_driver.c
src/node_device.c
src/node_device_conf.c
src/nodeinfo.c
src/opennebula/one_conf.c
src/opennebula/one_driver.c
src/openvz_conf.c
src/openvz_driver.c
src/pci.c
...
...
src/opennebula/one_conf.c
浏览文件 @
ee8553e1
...
...
@@ -122,12 +122,12 @@ int oneSubmitVM(virConnectPtr conn,
char
*
templ
;
int
oneid
;
if
((
templ
=
xmlOneTemplate
(
conn
,
vm
->
def
))
==
NULL
)
if
((
templ
=
xmlOneTemplate
(
conn
,
vm
->
def
))
==
NULL
)
return
-
1
;
if
(
(
oneid
=
c_oneAllocateTemplate
(
templ
))
<
0
)
{
if
((
oneid
=
c_oneAllocateTemplate
(
templ
))
<
0
)
{
oneError
(
conn
,
NULL
,
VIR_ERR_OPERATION_FAILED
,
"Error submitting virtual machine to OpenNebula"
);
_
(
"Error submitting virtual machine to OpenNebula"
)
);
VIR_FREE
(
templ
);
return
-
1
;
}
...
...
@@ -156,47 +156,47 @@ char* xmlOneTemplate(virConnectPtr conn,virDomainDefPtr def)
(
def
->
maxmem
)
/
1024
);
/*Optional Booting OpenNebula Information:*/
if
(
def
->
os
.
kernel
)
{
if
(
def
->
os
.
kernel
)
{
virBufferVSprintf
(
&
buf
,
"OS=[ kernel =
\"
%s
\"
"
,
def
->
os
.
kernel
);
if
(
def
->
os
.
initrd
)
if
(
def
->
os
.
initrd
)
virBufferVSprintf
(
&
buf
,
",
\n
initrd =
\"
%s
\"
"
,
def
->
os
.
initrd
);
if
(
def
->
os
.
cmdline
)
if
(
def
->
os
.
cmdline
)
virBufferVSprintf
(
&
buf
,
",
\n
kernel_cmd =
\"
%s
\"
"
,
def
->
os
.
cmdline
);
if
(
def
->
os
.
root
)
if
(
def
->
os
.
root
)
virBufferVSprintf
(
&
buf
,
",
\n
root =
\"
%s
\"
"
,
def
->
os
.
root
);
virBufferAddLit
(
&
buf
,
" ]
\n
"
);
}
/* set Disks & NICS */
for
(
i
=
0
;
i
<
def
->
ndisks
;
i
++
){
for
(
i
=
0
;
i
<
def
->
ndisks
;
i
++
)
{
// missing source is only allowed at cdrom and floppy
if
(
def
->
disks
[
i
]
->
device
==
VIR_DOMAIN_DISK_DEVICE_DISK
)
{
if
(
def
->
disks
[
i
]
->
device
==
VIR_DOMAIN_DISK_DEVICE_DISK
)
{
virBufferVSprintf
(
&
buf
,
"DISK=[ type = disk,
\n
"
" source =
\"
%s
\"
,
\n
"
,
def
->
disks
[
i
]
->
src
);
}
else
if
(
def
->
disks
[
i
]
->
device
==
VIR_DOMAIN_DISK_DEVICE_CDROM
)
{
else
if
(
def
->
disks
[
i
]
->
device
==
VIR_DOMAIN_DISK_DEVICE_CDROM
)
{
virBufferAddLit
(
&
buf
,
"DISK=[ type = cdrom,
\n
"
);
if
(
def
->
disks
[
i
]
->
src
)
virBufferVSprintf
(
&
buf
,
" source =
\"
%s
\"
,
\n
"
,
def
->
disks
[
i
]
->
src
);
if
(
def
->
disks
[
i
]
->
src
)
virBufferVSprintf
(
&
buf
,
" source =
\"
%s
\"
,
\n
"
,
def
->
disks
[
i
]
->
src
);
}
else
if
(
def
->
disks
[
i
]
->
device
==
VIR_DOMAIN_DISK_DEVICE_FLOPPY
)
{
else
if
(
def
->
disks
[
i
]
->
device
==
VIR_DOMAIN_DISK_DEVICE_FLOPPY
)
{
virBufferAddLit
(
&
buf
,
"DISK=[ type = floppy,
\n
"
);
if
(
def
->
disks
[
i
]
->
src
)
virBufferVSprintf
(
&
buf
,
" source =
\"
%s
\"
,
\n
"
,
def
->
disks
[
i
]
->
src
);
if
(
def
->
disks
[
i
]
->
src
)
virBufferVSprintf
(
&
buf
,
" source =
\"
%s
\"
,
\n
"
,
def
->
disks
[
i
]
->
src
);
}
virBufferVSprintf
(
&
buf
,
" target =
\"
%s
\"
,
\n
"
" readonly ="
,
def
->
disks
[
i
]
->
dst
);
if
(
def
->
disks
[
i
]
->
readonly
)
if
(
def
->
disks
[
i
]
->
readonly
)
virBufferAddLit
(
&
buf
,
"
\"
yes
\"
]
\n
"
);
else
virBufferAddLit
(
&
buf
,
"
\"
no
\"
]
\n
"
);
}
for
(
i
=
0
;
i
<
def
->
nnets
;
i
++
)
for
(
i
=
0
;
i
<
def
->
nnets
;
i
++
)
{
if
(
!
def
->
nets
[
i
]
)
{
if
(
!
def
->
nets
[
i
]
)
{
continue
;
}
...
...
@@ -205,7 +205,7 @@ char* xmlOneTemplate(virConnectPtr conn,virDomainDefPtr def)
case
VIR_DOMAIN_NET_TYPE_BRIDGE
:
virBufferVSprintf
(
&
buf
,
"NIC=[ bridge =
\"
%s
\"
,
\n
"
,
def
->
nets
[
i
]
->
data
.
bridge
.
brname
);
if
(
def
->
nets
[
i
]
->
ifname
)
if
(
def
->
nets
[
i
]
->
ifname
)
virBufferVSprintf
(
&
buf
,
" target =
\"
%s
\"
,
\n
"
,
def
->
nets
[
i
]
->
ifname
);
virBufferVSprintf
(
&
buf
,
" mac =
\"
%02x:%02x:%02x:%02x:%02x:%02x
\"
]
\n
"
,
...
...
@@ -216,7 +216,7 @@ char* xmlOneTemplate(virConnectPtr conn,virDomainDefPtr def)
case
VIR_DOMAIN_NET_TYPE_NETWORK
:
virBufferVSprintf
(
&
buf
,
"NIC=[ network=
\"
%s
\"
"
,
def
->
nets
[
i
]
->
data
.
network
.
name
);
if
(
def
->
nets
[
i
]
->
ifname
)
if
(
def
->
nets
[
i
]
->
ifname
)
virBufferVSprintf
(
&
buf
,
",
\n
target =
\"
%s
\"
"
,
def
->
nets
[
i
]
->
ifname
);
virBufferAddLit
(
&
buf
,
" ]
\n
"
);
break
;
...
...
@@ -225,17 +225,17 @@ char* xmlOneTemplate(virConnectPtr conn,virDomainDefPtr def)
}
}
if
(
def
->
graphics
!=
NULL
)
{
if
(
def
->
graphics
->
type
==
VIR_DOMAIN_GRAPHICS_TYPE_VNC
)
{
if
(
def
->
graphics
!=
NULL
)
{
if
(
def
->
graphics
->
type
==
VIR_DOMAIN_GRAPHICS_TYPE_VNC
)
{
virBufferAddLit
(
&
buf
,
"GRAPHICS = [
\n
type =
\"
vnc
\"
"
);
if
(
def
->
graphics
->
data
.
vnc
.
listenAddr
!=
NULL
)
if
(
def
->
graphics
->
data
.
vnc
.
listenAddr
!=
NULL
)
virBufferVSprintf
(
&
buf
,
",
\n
listen =
\"
%s
\"
"
,
def
->
graphics
->
data
.
vnc
.
listenAddr
);
if
(
def
->
graphics
->
data
.
vnc
.
autoport
==
0
)
if
(
def
->
graphics
->
data
.
vnc
.
autoport
==
0
)
virBufferVSprintf
(
&
buf
,
",
\n
port =
\"
%d
\"
"
,
def
->
graphics
->
data
.
vnc
.
port
);
if
(
def
->
graphics
->
data
.
vnc
.
passwd
!=
NULL
)
if
(
def
->
graphics
->
data
.
vnc
.
passwd
!=
NULL
)
virBufferVSprintf
(
&
buf
,
",
\n
passwd =
\"
%s
\"
"
,
def
->
graphics
->
data
.
vnc
.
passwd
);
virBufferAddLit
(
&
buf
,
" ]
\n
"
);
...
...
@@ -250,7 +250,7 @@ char* xmlOneTemplate(virConnectPtr conn,virDomainDefPtr def)
return
virBufferContentAndReset
(
&
buf
);
no_memory:
no_memory:
virReportOOMError
(
conn
);
char
*
tmp
=
virBufferContentAndReset
(
&
buf
);
VIR_FREE
(
tmp
);
...
...
src/opennebula/one_conf.h
浏览文件 @
ee8553e1
src/opennebula/one_driver.c
浏览文件 @
ee8553e1
...
...
@@ -231,7 +231,7 @@ static int oneListDefinedDomains(virConnectPtr conn,
return
got
;
cleanup:
cleanup:
for
(
i
=
0
;
i
<
got
;
i
++
)
VIR_FREE
(
names
[
i
]);
oneDriverUnlock
(
driver
);
...
...
@@ -297,13 +297,13 @@ static int oneDomainUndefine(virDomainPtr dom)
vm
=
virDomainFindByUUID
(
&
driver
->
domains
,
dom
->
uuid
);
if
(
!
vm
)
{
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_INVALID_DOMAIN
,
"no domain with matching uuid"
);
_
(
"no domain with matching uuid"
)
);
goto
return_point
;
}
if
(
!
vm
->
persistent
)
{
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_INTERNAL_ERROR
,
"cannot undefine transient domain"
);
_
(
"cannot undefine transient domain"
)
);
goto
return_point
;
}
virDomainRemoveInactive
(
&
driver
->
domains
,
vm
);
...
...
@@ -422,7 +422,7 @@ static int oneDomainStart(virDomainPtr dom)
if
(
!
vm
)
{
oneError
(
conn
,
dom
,
VIR_ERR_INVALID_DOMAIN
,
"no domain named %s"
,
dom
->
name
);
_
(
"no domain named %s"
)
,
dom
->
name
);
goto
return_point
;
}
if
((
oneid
=
oneSubmitVM
(
dom
->
conn
,
driver
,
vm
))
<
0
)
{
...
...
@@ -459,7 +459,7 @@ oneDomainCreateAndStart(virConnectPtr conn,
vm
=
virDomainFindByName
(
&
driver
->
domains
,
def
->
name
);
if
(
vm
)
{
oneError
(
conn
,
NULL
,
VIR_ERR_OPERATION_FAILED
,
_
(
"Already an OpenNebula VM active with the name:
\"
%s
\"
id: %d "
),
_
(
"Already an OpenNebula VM active with the name: '%s'
id: %d "
),
def
->
name
,
def
->
id
);
goto
return_point
;
}
...
...
@@ -506,7 +506,7 @@ static int oneDomainShutdown(virDomainPtr dom)
goto
return_point
;
}
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_OPERATION_FAILED
,
"Wrong state to perform action"
);
_
(
"Wrong state to perform action"
)
);
goto
return_point
;
}
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_INVALID_DOMAIN
,
...
...
@@ -535,14 +535,14 @@ static int oneDomainDestroy(virDomainPtr dom)
vm
=
virDomainFindByID
(
&
driver
->
domains
,
dom
->
id
);
if
(
!
vm
)
{
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_INVALID_DOMAIN
,
"no domain with id %d"
,
dom
->
id
);
_
(
"no domain with id %d"
)
,
dom
->
id
);
goto
return_point
;
}
if
(
c_oneCancel
(
vm
->
pid
))
{
/* VM not running, delete the instance at ONE DB */
if
(
c_oneFinalize
(
vm
->
pid
)){
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_OPERATION_FAILED
,
"Wrong state to perform action"
);
_
(
"Wrong state to perform action"
)
);
goto
return_point
;
}
}
...
...
@@ -577,14 +577,14 @@ static int oneDomainSuspend(virDomainPtr dom)
goto
return_point
;
}
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_OPERATION_FAILED
,
"Wrong state to perform action"
);
_
(
"Wrong state to perform action"
)
);
goto
return_point
;
}
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_OPERATION_FAILED
,
"domain is not running"
);
_
(
"domain is not running"
)
);
}
else
{
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_INVALID_DOMAIN
,
"no domain with matching id %d"
,
dom
->
id
);
_
(
"no domain with matching id %d"
)
,
dom
->
id
);
}
return_point:
...
...
@@ -610,15 +610,15 @@ static int oneDomainResume(virDomainPtr dom)
goto
return_point
;
}
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_OPERATION_FAILED
,
"Wrong state to perform action"
);
_
(
"Wrong state to perform action"
)
);
goto
return_point
;
}
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_OPERATION_FAILED
,
"domain is not paused "
);
_
(
"domain is not paused "
)
);
}
else
{
oneError
(
dom
->
conn
,
dom
,
VIR_ERR_INVALID_DOMAIN
,
"no domain with matching id %d"
,
dom
->
id
);
}
_
(
"no domain with matching id %d"
)
,
dom
->
id
);
}
return_point:
if
(
vm
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录