On Tue, Aug 22, 2017 at 09:51:04 +0200, Ján Tomko wrote:
When parsing bootable devices, we maintain a bitmap of used
<boot order=""> elements. Use it in the post-parse function
to figure out whether the user tried to mix per-device and
per-domain boot elements.
This removes the need to count them twice.
---
src/conf/domain_conf.c | 46 ++++++++++++++++++++-----------------------
src/conf/domain_conf.h | 3 ++-
src/lxc/lxc_native.c | 2 +-
src/qemu/qemu_driver.c | 6 +++---
src/qemu/qemu_parse_command.c | 2 +-
src/qemu/qemu_process.c | 2 +-
src/vmx/vmx.c | 2 +-
src/xenconfig/xen_sxpr.c | 2 +-
src/xenconfig/xen_xl.c | 2 +-
src/xenconfig/xen_xm.c | 2 +-
10 files changed, 33 insertions(+), 36 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6f0f038b7..355da1478 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
[...]
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 1f1dc1de0..2fe7e545d 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2643,7 +2643,8 @@ int virDomainDefPostParse(virDomainDefPtr def,
virCapsPtr caps,
unsigned int parseFlags,
virDomainXMLOptionPtr xmlopt,
- void *parseOpaque);
+ void *parseOpaque,
+ virHashTablePtr bootHash);
int virDomainDefValidate(virDomainDefPtr def,
virCapsPtr caps,
Hmm, I think I'd prefer that you rename the function and create a thin
wrapper with the original name that will put the NULL argument in the
correct place. The boot hash won't really be ever passed from the
drivers. If it will be necessary it can be agregated from 'def' in the
wrapper.