Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
62aff792
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,发现更多精彩内容 >>
提交
62aff792
编写于
6月 07, 2016
作者:
J
Jovanka Gulicoska
提交者:
Cole Robinson
6月 07, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Replace VIR_ERROR with standard vir*Error in state driver init
上级
9c9afba4
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
33 addition
and
21 deletion
+33
-21
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+33
-21
未找到文件。
src/qemu/qemu_driver.c
浏览文件 @
62aff792
...
@@ -290,14 +290,16 @@ qemuAutostartDomain(virDomainObjPtr vm,
...
@@ -290,14 +290,16 @@ qemuAutostartDomain(virDomainObjPtr vm,
if (vm->autostart &&
if (vm->autostart &&
!virDomainObjIsActive(vm)) {
!virDomainObjIsActive(vm)) {
if (qemuProcessBeginJob(data->driver, vm) < 0) {
if (qemuProcessBeginJob(data->driver, vm) < 0) {
VIR_ERROR(_("Failed to start job on VM '%s': %s"),
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to start job on VM '%s': %s"),
vm->def->name, virGetLastErrorMessage());
vm->def->name, virGetLastErrorMessage());
goto cleanup;
goto cleanup;
}
}
if (qemuDomainObjStart(data->conn, data->driver, vm, flags,
if (qemuDomainObjStart(data->conn, data->driver, vm, flags,
QEMU_ASYNC_JOB_START) < 0) {
QEMU_ASYNC_JOB_START) < 0) {
VIR_ERROR(_("Failed to autostart VM '%s': %s"),
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to autostart VM '%s': %s"),
vm->def->name, virGetLastErrorMessage());
vm->def->name, virGetLastErrorMessage());
}
}
...
@@ -450,7 +452,8 @@ qemuSecurityInit(virQEMUDriverPtr driver)
...
@@ -450,7 +452,8 @@ qemuSecurityInit(virQEMUDriverPtr driver)
return 0;
return 0;
error:
error:
VIR_ERROR(_("Failed to initialize security drivers"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to initialize security drivers"));
virObjectUnref(stack);
virObjectUnref(stack);
virObjectUnref(mgr);
virObjectUnref(mgr);
virObjectUnref(cfg);
virObjectUnref(cfg);
...
@@ -471,7 +474,6 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
...
@@ -471,7 +474,6 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
virDomainSnapshotDefPtr def = NULL;
virDomainSnapshotDefPtr def = NULL;
virDomainSnapshotObjPtr snap = NULL;
virDomainSnapshotObjPtr snap = NULL;
virDomainSnapshotObjPtr current = NULL;
virDomainSnapshotObjPtr current = NULL;
char ebuf[1024];
unsigned int flags = (VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE |
unsigned int flags = (VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE |
VIR_DOMAIN_SNAPSHOT_PARSE_DISKS |
VIR_DOMAIN_SNAPSHOT_PARSE_DISKS |
VIR_DOMAIN_SNAPSHOT_PARSE_INTERNAL);
VIR_DOMAIN_SNAPSHOT_PARSE_INTERNAL);
...
@@ -481,7 +483,9 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
...
@@ -481,7 +483,9 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
virObjectLock(vm);
virObjectLock(vm);
if (virAsprintf(&snapDir, "%s/%s", baseDir, vm->def->name) < 0) {
if (virAsprintf(&snapDir, "%s/%s", baseDir, vm->def->name) < 0) {
VIR_ERROR(_("Failed to allocate memory for snapshot directory for domain %s"),
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to allocate memory for "
"snapshot directory for domain %s"),
vm->def->name);
vm->def->name);
goto cleanup;
goto cleanup;
}
}
...
@@ -494,9 +498,10 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
...
@@ -494,9 +498,10 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
if (!(dir = opendir(snapDir))) {
if (!(dir = opendir(snapDir))) {
if (errno != ENOENT)
if (errno != ENOENT)
VIR_ERROR(_("Failed to open snapshot directory %s for domain %s: %s"),
virReportSystemError(errno,
snapDir, vm->def->name,
_("Failed to open snapshot directory %s "
virStrerror(errno, ebuf, sizeof(ebuf)));
"for domain %s"),
snapDir, vm->def->name);
goto cleanup;
goto cleanup;
}
}
...
@@ -509,14 +514,16 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
...
@@ -509,14 +514,16 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
VIR_INFO("Loading snapshot file '%s'", entry->d_name);
VIR_INFO("Loading snapshot file '%s'", entry->d_name);
if (virAsprintf(&fullpath, "%s/%s", snapDir, entry->d_name) < 0) {
if (virAsprintf(&fullpath, "%s/%s", snapDir, entry->d_name) < 0) {
VIR_ERROR(_("Failed to allocate memory for path"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to allocate memory for path"));
continue;
continue;
}
}
if (virFileReadAll(fullpath, 1024*1024*1, &xmlStr) < 0) {
if (virFileReadAll(fullpath, 1024*1024*1, &xmlStr) < 0) {
/* Nothing we can do here, skip this one */
/* Nothing we can do here, skip this one */
VIR_ERROR(_("Failed to read snapshot file %s: %s"), fullpath,
virReportSystemError(errno,
virStrerror(errno, ebuf, sizeof(ebuf)));
_("Failed to read snapshot file %s"),
fullpath);
VIR_FREE(fullpath);
VIR_FREE(fullpath);
continue;
continue;
}
}
...
@@ -526,7 +533,8 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
...
@@ -526,7 +533,8 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
flags);
flags);
if (def == NULL) {
if (def == NULL) {
/* Nothing we can do here, skip this one */
/* Nothing we can do here, skip this one */
VIR_ERROR(_("Failed to parse snapshot XML from file '%s'"),
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse snapshot XML from file '%s'"),
fullpath);
fullpath);
VIR_FREE(fullpath);
VIR_FREE(fullpath);
VIR_FREE(xmlStr);
VIR_FREE(xmlStr);
...
@@ -546,16 +554,20 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
...
@@ -546,16 +554,20 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
VIR_FREE(xmlStr);
VIR_FREE(xmlStr);
}
}
if (direrr < 0)
if (direrr < 0)
VIR_ERROR(_("Failed to fully read directory %s"), snapDir);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to fully read directory %s"),
snapDir);
if (vm->current_snapshot != current) {
if (vm->current_snapshot != current) {
VIR_ERROR(_("Too many snapshots claiming to be current for domain %s"),
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Too many snapshots claiming to be current for domain %s"),
vm->def->name);
vm->def->name);
vm->current_snapshot = NULL;
vm->current_snapshot = NULL;
}
}
if (virDomainSnapshotUpdateRelations(vm->snapshots) < 0)
if (virDomainSnapshotUpdateRelations(vm->snapshots) < 0)
VIR_ERROR(_("Snapshots have inconsistent relations for domain %s"),
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Snapshots have inconsistent relations for domain %s"),
vm->def->name);
vm->def->name);
/* FIXME: qemu keeps internal track of snapshots. We can get access
/* FIXME: qemu keeps internal track of snapshots. We can get access
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录