On-behalf-of: SAP stefan.kober@sap.com
Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de>
---
src/ch/ch_monitor.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c
index 6bf877fef3..d369236183 100644
--- a/src/ch/ch_monitor.c
+++ b/src/ch/ch_monitor.c
@@ -249,6 +249,11 @@ virCHMonitorBuildDiskJson(virJSONValue *disks, virDomainDiskDef *diskdef)
_("Missing disk file path in domain"));
return -1;
}
+ if (!diskdef->info.alias) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Missing disk alias"));
+ return -1;
+ }
if (diskdef->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
virReportError(VIR_ERR_INVALID_ARG,
_("Only virtio bus types are supported for '%1$s'"),
@@ -261,6 +266,9 @@ virCHMonitorBuildDiskJson(virJSONValue *disks, virDomainDiskDef *diskdef)
if (virJSONValueObjectAppendBoolean(disk, "readonly", true) < 0)
return -1;
}
+ if (virJSONValueObjectAppendString(disk, "id", diskdef->info.alias) < 0) {
+ return -1;
+ }
if (virJSONValueArrayAppend(disks, &disk) < 0)
return -1;
--
2.50.1