提交 08193fdb 编写于 作者: M Michal Privoznik

src: Check for virDomainDiskInsert() retval properly

Our coding style specifies that only negative values are considered as
error. Check for return value of virDomainDiskInsert() properly,
following the style. Not that the function can now return anything other
than 0 or -1, but it just triggers my OCD.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 dc2d82a2
......@@ -3517,7 +3517,7 @@ libxlDomainAttachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
_("target %s already exists."), disk->dst);
return -1;
}
if (virDomainDiskInsert(vmdef, disk))
if (virDomainDiskInsert(vmdef, disk) < 0)
return -1;
/* vmdef has the pointer. Generic codes for vmdef will do all jobs */
dev->data.disk = NULL;
......
......@@ -3417,7 +3417,7 @@ lxcDomainAttachDeviceConfig(virDomainDefPtr vmdef,
_("target %s already exists."), disk->dst);
return -1;
}
if (virDomainDiskInsert(vmdef, disk))
if (virDomainDiskInsert(vmdef, disk) < 0)
return -1;
/* vmdef has the pointer. Generic codes for vmdef will do all jobs */
dev->data.disk = NULL;
......
......@@ -8144,7 +8144,7 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
return -1;
if (qemuCheckDiskConfig(disk, NULL) < 0)
return -1;
if (virDomainDiskInsert(vmdef, disk))
if (virDomainDiskInsert(vmdef, disk) < 0)
return -1;
/* vmdef has the pointer. Generic codes for vmdef will do all jobs */
dev->data.disk = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册