[PATCH V3 0/7] qemu: support updating device's bootindex

Jiang Jiacheng jiangjiacheng at huawei.com
Sat Dec 24 14:09:17 UTC 2022


Support updating device's(support cdrom, disk and network) bootindex
online in virDomainUpdateDeviceFlags. The new bootindex will take effect
after guest rebooting. Enable bootindex can be set to 0, it means cancel
the device's bootindex.

To use this feature, we need to get the device's xml first and modify
the boot order in the xml, then use 'virsh update-device <domain> <xml>
--flag' to update the bootindex. Note that the flag should be --config
or --persistent if the vm is running.

Jiang Jiacheng (7):
  qemu: Introduce qemuDomainChangeBootIndex to update device's bootindex
  qemu: Marking a device's bootindex can be changed
  qemu: check the bootIndex could be changed or not
  qemu: Support update disk's bootindex
  qemu: Support update net's bootindex
  qemu: Support set bootindex to 0 to cancel bootindex setting
  test: add a test for bootIndex = 0 provided by the user

diff to v2:
* improve function description and commit message
* move functions in qemu_conf.c to qemu_domain.c
* add a test for bootindex = 0 provided by user
* fix a bug in logical of checking bootindex 

 src/conf/device_conf.h                        |  3 +
 src/conf/domain_conf.c                        | 10 ++-
 src/conf/domain_postparse.c                   |  8 ++-
 src/conf/schemas/domaincommon.rng             |  2 +-
 src/qemu/qemu_conf.c                          | 41 +++++++++++
 src/qemu/qemu_conf.h                          |  5 ++
 src/qemu/qemu_domain.c                        | 69 +++++++++++++++++-
 src/qemu/qemu_domain.h                        |  9 +++
 src/qemu/qemu_driver.c                        | 32 +++++++++
 src/qemu/qemu_hotplug.c                       | 17 +++--
 src/qemu/qemu_monitor.c                       | 12 ++++
 src/qemu/qemu_monitor.h                       |  6 ++
 src/qemu/qemu_monitor_json.c                  | 22 ++++++
 src/qemu/qemu_monitor_json.h                  |  6 ++
 tests/qemuxml2argvdata/boot-order-set-0.xml   | 72 +++++++++++++++++++
 tests/qemuxml2xmloutdata/boot-order-set-0.xml | 72 +++++++++++++++++++
 tests/qemuxml2xmltest.c                       |  1 +
 17 files changed, 376 insertions(+), 11 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/boot-order-set-0.xml
 create mode 100644 tests/qemuxml2xmloutdata/boot-order-set-0.xml

-- 
2.33.0



More information about the libvir-list mailing list