Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
3d6a119d
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看板
提交
3d6a119d
编写于
6月 26, 2007
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename UUID functions
上级
b63f8cc9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
18 deletion
+25
-18
ChangeLog
ChangeLog
+5
-0
qemud/conf.c
qemud/conf.c
+4
-4
qemud/uuid.c
qemud/uuid.c
+8
-8
qemud/uuid.h
qemud/uuid.h
+8
-6
未找到文件。
ChangeLog
浏览文件 @
3d6a119d
Tue Jun 26 18:10:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* qemud/conf.c, qemud/uuid.c, qemud/uuid.h: Rename the
UUID functions to not include QEMU in name.
Tue Jun 26 18:10:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* qemud/conf.c, qemud/conf.h, qemud/dispatch.c, qemud/driver.c,
...
...
qemud/conf.c
浏览文件 @
3d6a119d
...
...
@@ -823,12 +823,12 @@ static struct qemud_vm_def *qemudParseXML(struct qemud_driver *driver,
if
((
obj
==
NULL
)
||
(
obj
->
type
!=
XPATH_STRING
)
||
(
obj
->
stringval
==
NULL
)
||
(
obj
->
stringval
[
0
]
==
0
))
{
int
err
;
if
((
err
=
qemudGenerateUUID
(
def
->
uuid
)))
{
if
((
err
=
virUUIDGenerate
(
def
->
uuid
)))
{
qemudReportError
(
NULL
,
NULL
,
NULL
,
VIR_ERR_INTERNAL_ERROR
,
"Failed to generate UUID: %s"
,
strerror
(
err
));
goto
error
;
}
}
else
if
(
qemudParseUUID
((
const
char
*
)
obj
->
stringval
,
def
->
uuid
)
<
0
)
{
}
else
if
(
virUUIDParse
((
const
char
*
)
obj
->
stringval
,
def
->
uuid
)
<
0
)
{
qemudReportError
(
NULL
,
NULL
,
NULL
,
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
"malformed uuid element"
);
goto
error
;
}
...
...
@@ -1936,12 +1936,12 @@ static struct qemud_network_def *qemudParseNetworkXML(struct qemud_driver *drive
if
((
obj
==
NULL
)
||
(
obj
->
type
!=
XPATH_STRING
)
||
(
obj
->
stringval
==
NULL
)
||
(
obj
->
stringval
[
0
]
==
0
))
{
int
err
;
if
((
err
=
qemudGenerateUUID
(
def
->
uuid
)))
{
if
((
err
=
virUUIDGenerate
(
def
->
uuid
)))
{
qemudReportError
(
NULL
,
NULL
,
NULL
,
VIR_ERR_INTERNAL_ERROR
,
"Failed to generate UUID: %s"
,
strerror
(
err
));
goto
error
;
}
}
else
if
(
qemudParseUUID
((
const
char
*
)
obj
->
stringval
,
def
->
uuid
)
<
0
)
{
}
else
if
(
virUUIDParse
((
const
char
*
)
obj
->
stringval
,
def
->
uuid
)
<
0
)
{
qemudReportError
(
NULL
,
NULL
,
NULL
,
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
"malformed uuid element"
);
goto
error
;
}
...
...
qemud/uuid.c
浏览文件 @
3d6a119d
...
...
@@ -35,8 +35,8 @@
#include "internal.h"
static
int
qemud
GenerateRandomBytes
(
unsigned
char
*
buf
,
int
buflen
)
virUUID
GenerateRandomBytes
(
unsigned
char
*
buf
,
int
buflen
)
{
int
fd
;
...
...
@@ -63,8 +63,8 @@ qemudGenerateRandomBytes(unsigned char *buf,
}
static
int
qemud
GeneratePseudoRandomBytes
(
unsigned
char
*
buf
,
int
buflen
)
virUUID
GeneratePseudoRandomBytes
(
unsigned
char
*
buf
,
int
buflen
)
{
srand
(
time
(
NULL
));
while
(
buflen
>
0
)
{
...
...
@@ -76,20 +76,20 @@ qemudGeneratePseudoRandomBytes(unsigned char *buf,
}
int
qemudGenerateUUID
(
unsigned
char
*
uuid
)
virUUIDGenerate
(
unsigned
char
*
uuid
)
{
int
err
;
if
((
err
=
qemudGenerateRandomBytes
(
uuid
,
QEMUD
_UUID_RAW_LEN
)))
if
((
err
=
virUUIDGenerateRandomBytes
(
uuid
,
VIR
_UUID_RAW_LEN
)))
qemudLog
(
QEMUD_WARN
,
"Falling back to pseudorandom UUID, "
"failed to generate random bytes: %s"
,
strerror
(
err
));
return
qemudGeneratePseudoRandomBytes
(
uuid
,
QEMUD
_UUID_RAW_LEN
);
return
virUUIDGeneratePseudoRandomBytes
(
uuid
,
VIR
_UUID_RAW_LEN
);
}
int
qemudParseUUID
(
const
char
*
uuid
,
unsigned
char
*
rawuuid
)
{
virUUIDParse
(
const
char
*
uuid
,
unsigned
char
*
rawuuid
)
{
const
char
*
cur
;
int
i
;
...
...
qemud/uuid.h
浏览文件 @
3d6a119d
...
...
@@ -19,12 +19,14 @@
* Mark McLoughlin <markmc@redhat.com>
*/
#ifndef __
QEMUD
_UUID_H__
#define __
QEMUD
_UUID_H__
#ifndef __
VIR
_UUID_H__
#define __
VIR
_UUID_H__
int
qemudGenerateUUID
(
unsigned
char
*
uuid
);
#define VIR_UUID_RAW_LEN 16
int
qemudParseUUID
(
const
char
*
uuid
,
unsigned
char
*
rawuuid
);
int
virUUIDGenerate
(
unsigned
char
*
uuid
);
#endif
/* __QEMUD_UUID_H__ */
int
virUUIDParse
(
const
char
*
uuid
,
unsigned
char
*
rawuuid
);
#endif
/* __VIR_UUID_H__ */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录