]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuBuildDeviceAddressProps: Format also 'drive' addresses
authorPeter Krempa <pkrempa@redhat.com>
Mon, 4 Oct 2021 08:59:58 +0000 (10:59 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 12 Oct 2021 08:26:04 +0000 (10:26 +0200)
commit3210c8b047534f7e1d3ccde7ea3bcf11e7c92ad9
treed9cdddbad70767ede0dae88ea3402106a83ab289
parent2e4bc16370adcd20f08b58807cfd29570cf4e07a
qemuBuildDeviceAddressProps: Format also 'drive' addresses

Introduce infrastructure to format 'drive' addresses via the standard
helper rather than hand-rolled generators used inline.

The code needs to know the disk bus to format the correct address which
is passed in via an internal field in virDomainDeviceDriveAddress.

The field types according to QEMU are as following:

'ide-hd' for VIR_DOMAIN_DISK_BUS_IDE and VIR_DOMAIN_DISK_BUS_SATA
  unit=<uint32>          -  (default: 4294967295)

'floppy' for VIR_DOMAIN_DISK_BUS_FDC
  unit=<uint32>          -  (default: 4294967295)

'scsi-hd' for VIR_DOMAIN_DISK_BUS_SCSI
  channel=<uint32>       -  (default: 0)
  scsi-id=<uint32>       -  (default: 4294967295)
  lun=<uint32>           -  (default: 4294967295)

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/device_conf.h
src/conf/domain_conf.c
src/qemu/qemu_command.c