Skip to content

Commit

Permalink
ch: Verify a disk's storage type is supported
Browse files Browse the repository at this point in the history
Currently only file types of disk are supported so check if the
configuration we are given matches.
  • Loading branch information
bryteise committed Mar 19, 2021
1 parent 6322021 commit 158fd61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ch/ch_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ virCHMonitorBuildDiskJson(virJSONValuePtr disks, virDomainDiskDefPtr diskdef)
{
virJSONValuePtr disk;

if (diskdef->src != NULL && diskdef->src->path != NULL) {
if (diskdef->src != NULL &&
diskdef->src->path != NULL &&
diskdef->src->type == VIR_STORAGE_TYPE_FILE) {
disk = virJSONValueNewObject();
if (!virFileExists(diskdef->src->path)) {
virReportError(VIR_ERR_INVALID_ARG,
Expand Down

0 comments on commit 158fd61

Please sign in to comment.