]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuBuildDiskCommandLine: Generate via JSON
authorPeter Krempa <pkrempa@redhat.com>
Mon, 4 Oct 2021 14:54:54 +0000 (16:54 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 12 Oct 2021 08:26:04 +0000 (10:26 +0200)
commitdc481f11a61bcf8b0819b0f775c6ea949afed5d2
tree4e18845733abf1b79414a35c8fe6089e51a1440c
parentd06e3000c4115abc8b9f297eb7fcba6802defb37
qemuBuildDiskCommandLine: Generate via JSON

The types for the special fields of the 'virtio-blk-pci' according to
QEMU are:
  iothread=<link<iothread>>
  ioeventfd=<bool>       - on/off (default: true)
  event_idx=<bool>       - on/off (default: true)
  scsi=<bool>            - on/off (default: false)
  num-queues=<uint16>    -  (default: 65535)
  queue-size=<uint16>    -  (default: 256)

For all disks we also use the following properties (based on 'scsi-hd'):
  device_id=<str>
  share-rw=<bool>        -  (default: false)
  drive=<str>            - Node name or ID of a block device to use as a backend
  chardev=<str>          - ID of a chardev to use as a backend  <-  vhost-user-blk-pci
  bootindex=<int32>
  logical_block_size=<size> - A power of two between 512 B and 2 MiB (default: 0)
  physical_block_size=<size> - A power of two between 512 B and 2 MiB (default: 0)
  wwn=<uint64>           -  (default: 0)
  rotation_rate=<uint16> -  (default: 0)
  vendor=<str>
  product=<str>
  removable=<bool>       - on/off (default: false)
  write-cache=<OnOffAuto> - on/off/auto (default: "auto")
  cyls=<uint32>          -  (default: 0)
  heads=<uint32>         -  (default: 0)
  secs=<uint32>          -  (default: 0)
  bios-chs-trans=<BiosAtaTranslation> - Logical CHS translation algorithm, auto/none/lba/large/rechs (default: "auto") <- ide-hd
  serial=<str>
  werror=<BlockdevOnError> - Error handling policy, report/ignore/enospc/stop/auto (default: "auto")
  rerror=<BlockdevOnError> - Error handling policy, report/ignore/enospc/stop/auto (default: "auto")

The 'wwn' field is changed from a hex string to a number since qemu
actually treats it as a number.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c
src/qemu/qemu_command.h
src/qemu/qemu_hotplug.c
tests/qemuxml2argvdata/disk-ide-wwn.x86_64-latest.args
tests/qemuxml2argvdata/disk-scsi-disk-wwn.x86_64-latest.args
tests/qemuxml2argvdata/disk-scsi.x86_64-latest.args