* ``disk.<num>.partition`` - whether this is a partition or disk
* ``disk.<num>.dependency.count`` - the number of device dependencies
* ``disk.<num>.dependency.<num>.name`` - a dependency name
+* ``disk.<num>.serial`` - optional disk serial number
* ``disk.<num>.alias`` - the device alias of the disk (e.g. sda)
* ``disk.<num>.guest_alias`` - optional alias assigned to the disk
* hold the list of PVs, for LUKS encrypted volume this will
* contain the disk where the volume is placed. (Linux)
* "disk.<num>.dependency.<num>.name" - a dependency
+ * "disk.<num>.serial" - optional disk serial number (as string)
* "disk.<num>.alias" - the device alias of the disk (e.g. sda)
* "disk.<num>.guest_alias" - optional alias assigned to the disk, on Linux
* this is a name assigned by device mapper
}
if (info[i]->address) {
+ qemuAgentDiskAddress *address = info[i]->address;
virDomainDiskDef *diskdef = NULL;
+ if (address->serial) {
+ g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
+ "disk.%zu.serial", i);
+ if (virTypedParamsAddString(params, nparams, maxparams,
+ param_name, address->serial) < 0)
+ return;
+ }
+
/* match the disk to the target in the vm definition */
diskdef = virDomainDiskByAddress(vmdef,
- &info[i]->address->pci_controller,
- info[i]->address->ccw_addr,
- info[i]->address->bus,
- info[i]->address->target,
- info[i]->address->unit);
+ &address->pci_controller,
+ address->ccw_addr,
+ address->bus,
+ address->target,
+ address->unit);
if (diskdef) {
g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
"disk.%zu.alias", i);