1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-12 13:17:58 +03:00

domain_conf: fix internal flag verification

While working on virDomainBlockCopy, I noticed we had a verify()
concerning internal XML flags that was incomplete after several
recent flag additions; move that up higher in the code to make it
harder to forget to modify on the next flag addition.  Adjust
some formatting while at it.

* src/conf/domain_conf.c (verify): Move closer to internal flag
definitions.  Cover missing flags ALLOW_ROM and ALLOW_BOOT.

Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Eric Blake 2014-08-25 12:58:49 -06:00
parent 1db2f4f767
commit 79f4c4e694

View File

@ -89,19 +89,33 @@ struct _virDomainXMLOption {
/* Private flags used internally by virDomainSaveStatus and
* virDomainLoadStatus. */
* virDomainLoadStatus, in addition to the public virDomainXMLFlags. */
typedef enum {
/* dump internal domain status information */
VIR_DOMAIN_XML_INTERNAL_STATUS = (1<<16),
VIR_DOMAIN_XML_INTERNAL_STATUS = 1 << 16,
/* dump/parse <actual> element */
VIR_DOMAIN_XML_INTERNAL_ACTUAL_NET = (1<<17),
VIR_DOMAIN_XML_INTERNAL_ACTUAL_NET = 1 << 17,
/* dump/parse original states of host PCI device */
VIR_DOMAIN_XML_INTERNAL_PCI_ORIG_STATES = (1<<18),
VIR_DOMAIN_XML_INTERNAL_ALLOW_ROM = (1<<19),
VIR_DOMAIN_XML_INTERNAL_ALLOW_BOOT = (1<<20),
VIR_DOMAIN_XML_INTERNAL_CLOCK_ADJUST = (1<<21),
VIR_DOMAIN_XML_INTERNAL_PCI_ORIG_STATES = 1 << 18,
VIR_DOMAIN_XML_INTERNAL_ALLOW_ROM = 1 << 19,
VIR_DOMAIN_XML_INTERNAL_ALLOW_BOOT = 1 << 20,
VIR_DOMAIN_XML_INTERNAL_CLOCK_ADJUST = 1 << 21,
} virDomainXMLInternalFlags;
#define DUMPXML_FLAGS \
(VIR_DOMAIN_XML_SECURE | \
VIR_DOMAIN_XML_INACTIVE | \
VIR_DOMAIN_XML_UPDATE_CPU | \
VIR_DOMAIN_XML_MIGRATABLE)
verify(((VIR_DOMAIN_XML_INTERNAL_STATUS |
VIR_DOMAIN_XML_INTERNAL_ACTUAL_NET |
VIR_DOMAIN_XML_INTERNAL_PCI_ORIG_STATES |
VIR_DOMAIN_XML_INTERNAL_ALLOW_ROM |
VIR_DOMAIN_XML_INTERNAL_ALLOW_BOOT |
VIR_DOMAIN_XML_INTERNAL_CLOCK_ADJUST)
& DUMPXML_FLAGS) == 0);
VIR_ENUM_IMPL(virDomainTaint, VIR_DOMAIN_TAINT_LAST,
"custom-argv",
"custom-monitor",
@ -17726,18 +17740,6 @@ virDomainHugepagesFormat(virBufferPtr buf,
}
#define DUMPXML_FLAGS \
(VIR_DOMAIN_XML_SECURE | \
VIR_DOMAIN_XML_INACTIVE | \
VIR_DOMAIN_XML_UPDATE_CPU | \
VIR_DOMAIN_XML_MIGRATABLE)
verify(((VIR_DOMAIN_XML_INTERNAL_STATUS |
VIR_DOMAIN_XML_INTERNAL_ACTUAL_NET |
VIR_DOMAIN_XML_INTERNAL_PCI_ORIG_STATES |
VIR_DOMAIN_XML_INTERNAL_CLOCK_ADJUST)
& DUMPXML_FLAGS) == 0);
static bool
virDomainDefHasCapabilitiesFeatures(virDomainDefPtr def)
{