mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 18:45:16 +00:00
util: storage: Fix check for empty storage device
If the storage device type is parsed as network our parser still allows it to omit the <source> element. The empty drive check would not trigger on such device as it expects that every network storage source is valid. Use VIR_STORAGE_NET_PROTOCOL_NONE as a marker that the storage source is empty.
This commit is contained in:
parent
d0dc6c0369
commit
158340e2fb
@ -1989,6 +1989,10 @@ virStorageSourceIsEmpty(virStorageSourcePtr src)
|
|||||||
if (src->type == VIR_STORAGE_TYPE_NONE)
|
if (src->type == VIR_STORAGE_TYPE_NONE)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (src->type == VIR_STORAGE_TYPE_NETWORK &&
|
||||||
|
src->protocol == VIR_STORAGE_NET_PROTOCOL_NONE)
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user