1 Star 0 Fork 71

twwang/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
storageBackendProbeTarget-Don-t-fail-if-backing-stor.patch 1.91 KB
一键复制 编辑 原始数据 按行查看 历史
From bd45da8b308c16f30766ad756fe3c2f54e4f3e9f Mon Sep 17 00:00:00 2001
From: Peter Krempa <pkrempa@redhat.com>
Date: Thu, 25 Feb 2021 13:51:51 +0100
Subject: [PATCH 016/108] storageBackendProbeTarget: Don't fail if backing
store can't be parsed
When the backing store of the image can't be parsed
virStorageSourceNewFromBacking returns -1. storageBackendProbeTarget
then also fails which makes the pool refresh fail or even the storage
pool becomes inactive after (re)start of libvirtd.
In situations when we can't access the backing store via network we
just report the backing store string, thus we can do the same thing for
unparsable backing store to prevent the pool from going offline.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 104db1951d3abfd8cb363b8e8070f712044bc645)
---
src/storage/storage_util.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 4c67d3a4b1..2e4c7b29b3 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -3363,13 +3363,11 @@ storageBackendProbeTarget(virStorageSourcePtr target,
return -1;
if (meta->backingStoreRaw) {
- if (virStorageSourceNewFromBacking(meta, &target->backingStore) < 0)
- return -1;
-
/* XXX: Remote storage doesn't play nicely with volumes backed by
* remote storage. To avoid trouble, just fake the backing store is RAW
* and put the string from the metadata as the path of the target. */
- if (!virStorageSourceIsLocalStorage(target->backingStore)) {
+ if (virStorageSourceNewFromBacking(meta, &target->backingStore) < 0 ||
+ !virStorageSourceIsLocalStorage(target->backingStore)) {
virObjectUnref(target->backingStore);
if (!(target->backingStore = virStorageSourceNew()))
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/twwang/libvirt.git
git@gitee.com:twwang/libvirt.git
twwang
libvirt
libvirt
master

搜索帮助