Skip to content

Commit 158fd61

Browse files
committed
ch: Verify a disk's storage type is supported
Currently only file types of disk are supported so check if the configuration we are given matches.
1 parent 6322021 commit 158fd61

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ch/ch_monitor.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ virCHMonitorBuildDiskJson(virJSONValuePtr disks, virDomainDiskDefPtr diskdef)
252252
{
253253
virJSONValuePtr disk;
254254

255-
if (diskdef->src != NULL && diskdef->src->path != NULL) {
255+
if (diskdef->src != NULL &&
256+
diskdef->src->path != NULL &&
257+
diskdef->src->type == VIR_STORAGE_TYPE_FILE) {
256258
disk = virJSONValueNewObject();
257259
if (!virFileExists(diskdef->src->path)) {
258260
virReportError(VIR_ERR_INVALID_ARG,

0 commit comments

Comments
 (0)