[PATCH 6/7] qemu: Support add bootindex = -1 to boothash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Support add bootindex = -1 to boothash and return 0 if duplicated bootindex = -1 is set.
It is nessary to add bootindex = -1 into boothash, otherwise libvirt will auto set boot dev,
which will cause bootindex unchangable. Meanwhile, bootindex = -1 means disable bootindex,
so it should be allowed to set duplicated bootindex = -1.

Signed-off-by: Jiang Jiacheng <jiangjiacheng@xxxxxxxxxx>
---
 src/conf/domain_postparse.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/conf/domain_postparse.c b/src/conf/domain_postparse.c
index 9810de7437..d264a2ffee 100644
--- a/src/conf/domain_postparse.c
+++ b/src/conf/domain_postparse.c
@@ -1044,6 +1044,12 @@ virDomainDefCollectBootOrder(virDomainDef *def G_GNUC_UNUSED,
     order = g_strdup_printf("%d", info->bootIndex);
 
     if (virHashLookup(bootHash, order)) {
+        /* -1 means disable bootorder so it allowed to
+         * make more than one device use -1
+         */
+        if (info->bootIndex == -1) {
+            return 0;
+        }
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("boot order '%s' used for more than one device"),
                        order);
-- 
2.33.0





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux