xen_xs: name xendConfigVersion magic numbers

libvirt supports 4 different versions of the user-land XenD daemon. When
queried the daemon just returns its generation number, which is hard to
match to the version of the Xen tools.

Replace the magic generation numbers by named enum definitions to
improve code readability.

Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
Philipp Hahn 2012-01-31 18:08:09 +01:00 committed by Eric Blake
parent be9fb5affc
commit 184fc07fda
9 changed files with 78 additions and 70 deletions

View File

@ -100,7 +100,7 @@ index dfc6415..3642296 100644
+ /* If xendConfigVersion is 2, then we can only report _LIVE (and + /* If xendConfigVersion is 2, then we can only report _LIVE (and
+ * xm_internal reports _CONFIG). If it is 3, then _LIVE and + * xm_internal reports _CONFIG). If it is 3, then _LIVE and
+ * _CONFIG are always in sync for a running system. */ + * _CONFIG are always in sync for a running system. */
+ if (domain->id < 0 && priv->xendConfigVersion < 3) + if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
+ return -2; + return -2;
+ if (domain->id < 0 && (flags & VIR_DOMAIN_VCPU_LIVE)) { + if (domain->id < 0 && (flags & VIR_DOMAIN_VCPU_LIVE)) {
+ virXendError(VIR_ERR_OPERATION_INVALID, "%s", + virXendError(VIR_ERR_OPERATION_INVALID, "%s",

View File

@ -110,7 +110,7 @@ index fe2ff86..66e8518 100644
+ * depends on xendConfigVersion. */ + * depends on xendConfigVersion. */
+ if (dom) { + if (dom) {
+ priv = dom->conn->privateData; + priv = dom->conn->privateData;
+ if (priv->xendConfigVersion >= 3) + if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4)
+ flags |= VIR_DOMAIN_VCPU_CONFIG; + flags |= VIR_DOMAIN_VCPU_CONFIG;
+ } + }
+ return xenUnifiedDomainSetVcpusFlags(dom, nvcpus, flags); + return xenUnifiedDomainSetVcpusFlags(dom, nvcpus, flags);
@ -163,14 +163,14 @@ index 3642296..55c2cc4 100644
+ +
+ priv = (xenUnifiedPrivatePtr) domain->conn->privateData; + priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
+ +
+ if ((domain->id < 0 && priv->xendConfigVersion < 3) || + if ((domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) ||
+ (flags & VIR_DOMAIN_VCPU_MAXIMUM)) + (flags & VIR_DOMAIN_VCPU_MAXIMUM))
+ return -2; + return -2;
+ +
+ /* With xendConfigVersion 2, only _LIVE is supported. With + /* With xendConfigVersion 2, only _LIVE is supported. With
+ * xendConfigVersion 3, only _LIVE|_CONFIG is supported for + * xendConfigVersion 3, only _LIVE|_CONFIG is supported for
+ * running domains, or _CONFIG for inactive domains. */ + * running domains, or _CONFIG for inactive domains. */
+ if (priv->xendConfigVersion < 3) { + if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
+ if (flags & VIR_DOMAIN_VCPU_CONFIG) { + if (flags & VIR_DOMAIN_VCPU_CONFIG) {
+ virXendError(VIR_ERR_OPERATION_INVALID, "%s", + virXendError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend version does not support modifying " + _("Xend version does not support modifying "

View File

@ -122,7 +122,7 @@ index 55c2cc4..b90c331 100644
- -
- priv = (xenUnifiedPrivatePtr) domain->conn->privateData; - priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- -
- if (domain->id < 0 && priv->xendConfigVersion < 3) - if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
- return(-1); - return(-1);
- -
- snprintf(buf, sizeof(buf), "%d", vcpus); - snprintf(buf, sizeof(buf), "%d", vcpus);

View File

@ -354,7 +354,7 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags)
/* XenD is active, so try the xm & xs drivers too, both requird to /* XenD is active, so try the xm & xs drivers too, both requird to
* succeed if root, optional otherwise */ * succeed if root, optional otherwise */
if (priv->xendConfigVersion <= 2) { if (priv->xendConfigVersion <= XEND_CONFIG_VERSION_3_0_3) {
VIR_DEBUG("Trying XM sub-driver"); VIR_DEBUG("Trying XM sub-driver");
if (xenXMOpen(conn, auth, flags) == VIR_DRV_OPEN_SUCCESS) { if (xenXMOpen(conn, auth, flags) == VIR_DRV_OPEN_SUCCESS) {
VIR_DEBUG("Activated XM sub-driver"); VIR_DEBUG("Activated XM sub-driver");
@ -1161,7 +1161,7 @@ xenUnifiedDomainSetVcpus (virDomainPtr dom, unsigned int nvcpus)
* depends on xendConfigVersion. */ * depends on xendConfigVersion. */
if (dom) { if (dom) {
priv = dom->conn->privateData; priv = dom->conn->privateData;
if (priv->xendConfigVersion >= 3) if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4)
flags |= VIR_DOMAIN_VCPU_CONFIG; flags |= VIR_DOMAIN_VCPU_CONFIG;
} }
return xenUnifiedDomainSetVcpusFlags(dom, nvcpus, flags); return xenUnifiedDomainSetVcpusFlags(dom, nvcpus, flags);
@ -1239,7 +1239,7 @@ xenUnifiedDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
{ {
GET_PRIVATE(dom->conn); GET_PRIVATE(dom->conn);
if (dom->id == -1 && priv->xendConfigVersion < 3 ) { if (dom->id == -1 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
if (priv->opened[XEN_UNIFIED_XM_OFFSET]) if (priv->opened[XEN_UNIFIED_XM_OFFSET])
return xenXMDomainGetXMLDesc(dom, flags); return xenXMDomainGetXMLDesc(dom, flags);
} else { } else {
@ -1561,7 +1561,7 @@ xenUnifiedDomainAttachDevice (virDomainPtr dom, const char *xml)
* to make this API work * to make this API work
*/ */
if (priv->opened[XEN_UNIFIED_XEND_OFFSET] && if (priv->opened[XEN_UNIFIED_XEND_OFFSET] &&
priv->xendConfigVersion >= 3) priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4)
flags |= VIR_DOMAIN_DEVICE_MODIFY_CONFIG; flags |= VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
@ -1600,7 +1600,7 @@ xenUnifiedDomainDetachDevice (virDomainPtr dom, const char *xml)
* to make this API work * to make this API work
*/ */
if (priv->opened[XEN_UNIFIED_XEND_OFFSET] && if (priv->opened[XEN_UNIFIED_XEND_OFFSET] &&
priv->xendConfigVersion >= 3) priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4)
flags |= VIR_DOMAIN_DEVICE_MODIFY_CONFIG; flags |= VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
@ -1642,7 +1642,7 @@ xenUnifiedDomainGetAutostart (virDomainPtr dom, int *autostart)
{ {
GET_PRIVATE(dom->conn); GET_PRIVATE(dom->conn);
if (priv->xendConfigVersion < 3) { if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
if (priv->opened[XEN_UNIFIED_XM_OFFSET]) if (priv->opened[XEN_UNIFIED_XM_OFFSET])
return xenXMDomainGetAutostart(dom, autostart); return xenXMDomainGetAutostart(dom, autostart);
} else { } else {
@ -1659,7 +1659,7 @@ xenUnifiedDomainSetAutostart (virDomainPtr dom, int autostart)
{ {
GET_PRIVATE(dom->conn); GET_PRIVATE(dom->conn);
if (priv->xendConfigVersion < 3) { if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
if (priv->opened[XEN_UNIFIED_XM_OFFSET]) if (priv->opened[XEN_UNIFIED_XM_OFFSET])
return xenXMDomainSetAutostart(dom, autostart); return xenXMDomainSetAutostart(dom, autostart);
} else { } else {

View File

@ -954,7 +954,7 @@ xend_detect_config_version(virConnectPtr conn) {
} else { } else {
/* Xen prior to 3.0.3 did not have the xend_config_format /* Xen prior to 3.0.3 did not have the xend_config_format
field, and is implicitly version 1. */ field, and is implicitly version 1. */
priv->xendConfigVersion = 1; priv->xendConfigVersion = XEND_CONFIG_VERSION_3_0_2;
} }
sexpr_free(root); sexpr_free(root);
return (0); return (0);
@ -1224,7 +1224,7 @@ sexpr_to_domain(virConnectPtr conn, const struct sexpr *root)
/* New 3.0.4 XenD will not report a domid for inactive domains, /* New 3.0.4 XenD will not report a domid for inactive domains,
* so only error out for old XenD * so only error out for old XenD
*/ */
if (!tmp && priv->xendConfigVersion < 3) if (!tmp && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
goto error; goto error;
if (tmp) if (tmp)
@ -1512,7 +1512,7 @@ xenDaemonDomainGetOSType(virDomainPtr domain)
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (domain->id < 0 && priv->xendConfigVersion < 3) if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(NULL); return(NULL);
/* can we ask for a subset ? worth it ? */ /* can we ask for a subset ? worth it ? */
@ -1652,7 +1652,7 @@ xenDaemonDomainGetMaxMemory(virDomainPtr domain)
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (domain->id < 0 && priv->xendConfigVersion < 3) if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1); return(-1);
/* can we ask for a subset ? worth it ? */ /* can we ask for a subset ? worth it ? */
@ -1691,7 +1691,7 @@ xenDaemonDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (domain->id < 0 && priv->xendConfigVersion < 3) if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1); return(-1);
snprintf(buf, sizeof(buf), "%lu", VIR_DIV_UP(memory, 1024)); snprintf(buf, sizeof(buf), "%lu", VIR_DIV_UP(memory, 1024));
@ -1728,7 +1728,7 @@ xenDaemonDomainSetMemory(virDomainPtr domain, unsigned long memory)
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (domain->id < 0 && priv->xendConfigVersion < 3) if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1); return(-1);
snprintf(buf, sizeof(buf), "%lu", VIR_DIV_UP(memory, 1024)); snprintf(buf, sizeof(buf), "%lu", VIR_DIV_UP(memory, 1024));
@ -1808,7 +1808,7 @@ xenDaemonDomainGetXMLDesc(virDomainPtr domain, unsigned int flags,
} }
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (domain->id < 0 && priv->xendConfigVersion < 3) { if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
/* fall-through to the next driver to handle */ /* fall-through to the next driver to handle */
return(NULL); return(NULL);
} }
@ -1852,7 +1852,7 @@ xenDaemonDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (domain->id < 0 && priv->xendConfigVersion < 3) if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1); return(-1);
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name); root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
@ -1887,7 +1887,7 @@ xenDaemonDomainGetState(virDomainPtr domain,
virCheckFlags(0, -1); virCheckFlags(0, -1);
if (domain->id < 0 && priv->xendConfigVersion < 3) if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return -1; return -1;
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name); root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
@ -2186,14 +2186,14 @@ xenDaemonDomainSetVcpusFlags(virDomainPtr domain, unsigned int vcpus,
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if ((domain->id < 0 && priv->xendConfigVersion < 3) || if ((domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) ||
(flags & VIR_DOMAIN_VCPU_MAXIMUM)) (flags & VIR_DOMAIN_VCPU_MAXIMUM))
return -2; return -2;
/* With xendConfigVersion 2, only _LIVE is supported. With /* With xendConfigVersion 2, only _LIVE is supported. With
* xendConfigVersion 3, only _LIVE|_CONFIG is supported for * xendConfigVersion 3, only _LIVE|_CONFIG is supported for
* running domains, or _CONFIG for inactive domains. */ * running domains, or _CONFIG for inactive domains. */
if (priv->xendConfigVersion < 3) { if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
if (flags & VIR_DOMAIN_VCPU_CONFIG) { if (flags & VIR_DOMAIN_VCPU_CONFIG) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
_("Xend version does not support modifying " _("Xend version does not support modifying "
@ -2267,7 +2267,7 @@ xenDaemonDomainPinVcpu(virDomainPtr domain, unsigned int vcpu,
} }
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < 3) { if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
mapstr[0] = '['; mapstr[0] = '[';
mapstr[1] = 0; mapstr[1] = 0;
} else { } else {
@ -2280,7 +2280,7 @@ xenDaemonDomainPinVcpu(virDomainPtr domain, unsigned int vcpu,
snprintf(buf, sizeof(buf), "%d,", (8 * i) + j); snprintf(buf, sizeof(buf), "%d,", (8 * i) + j);
strcat(mapstr, buf); strcat(mapstr, buf);
} }
if (priv->xendConfigVersion < 3) if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
mapstr[strlen(mapstr) - 1] = ']'; mapstr[strlen(mapstr) - 1] = ']';
else else
mapstr[strlen(mapstr) - 1] = 0; mapstr[strlen(mapstr) - 1] = 0;
@ -2343,7 +2343,7 @@ xenDaemonDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
/* If xendConfigVersion is 2, then we can only report _LIVE (and /* If xendConfigVersion is 2, then we can only report _LIVE (and
* xm_internal reports _CONFIG). If it is 3, then _LIVE and * xm_internal reports _CONFIG). If it is 3, then _LIVE and
* _CONFIG are always in sync for a running system. */ * _CONFIG are always in sync for a running system. */
if (domain->id < 0 && priv->xendConfigVersion < 3) if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return -2; return -2;
if (domain->id < 0 && (flags & VIR_DOMAIN_VCPU_LIVE)) { if (domain->id < 0 && (flags & VIR_DOMAIN_VCPU_LIVE)) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
@ -2477,7 +2477,7 @@ xenDaemonLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData; xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
/* Old approach for xen <= 3.0.3 */ /* Old approach for xen <= 3.0.3 */
if (priv->xendConfigVersion < 3) { if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
char **names, **tmp; char **names, **tmp;
unsigned char ident[VIR_UUID_BUFLEN]; unsigned char ident[VIR_UUID_BUFLEN];
names = xenDaemonListDomainsOld(conn); names = xenDaemonListDomainsOld(conn);
@ -2648,7 +2648,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
return -1; return -1;
} }
/* If xendConfigVersion < 3 only live config can be changed */ /* If xendConfigVersion < 3 only live config can be changed */
if (priv->xendConfigVersion < 3) { if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
_("Xend version does not support modifying " _("Xend version does not support modifying "
"persistent config")); "persistent config"));
@ -2656,7 +2656,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
} }
} else { } else {
/* Only live config can be changed if xendConfigVersion < 3 */ /* Only live config can be changed if xendConfigVersion < 3 */
if (priv->xendConfigVersion < 3 && if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4 &&
(flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT && (flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT &&
flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) { flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
@ -2667,7 +2667,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
/* Xen only supports modifying both live and persistent config if /* Xen only supports modifying both live and persistent config if
* xendConfigVersion >= 3 * xendConfigVersion >= 3
*/ */
if (priv->xendConfigVersion >= 3 && if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4 &&
(flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE | (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) { VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
@ -2816,7 +2816,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
return -1; return -1;
} }
/* If xendConfigVersion < 3 only live config can be changed */ /* If xendConfigVersion < 3 only live config can be changed */
if (priv->xendConfigVersion < 3) { if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
_("Xend version does not support modifying " _("Xend version does not support modifying "
"persistent config")); "persistent config"));
@ -2824,7 +2824,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
} }
} else { } else {
/* Only live config can be changed if xendConfigVersion < 3 */ /* Only live config can be changed if xendConfigVersion < 3 */
if (priv->xendConfigVersion < 3 && if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4 &&
(flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT && (flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT &&
flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) { flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
@ -2835,7 +2835,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
/* Xen only supports modifying both live and persistent config if /* Xen only supports modifying both live and persistent config if
* xendConfigVersion >= 3 * xendConfigVersion >= 3
*/ */
if (priv->xendConfigVersion >= 3 && if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4 &&
(flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE | (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) { VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
@ -2929,7 +2929,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
return -1; return -1;
} }
/* If xendConfigVersion < 3 only live config can be changed */ /* If xendConfigVersion < 3 only live config can be changed */
if (priv->xendConfigVersion < 3) { if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
_("Xend version does not support modifying " _("Xend version does not support modifying "
"persistent config")); "persistent config"));
@ -2937,7 +2937,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
} }
} else { } else {
/* Only live config can be changed if xendConfigVersion < 3 */ /* Only live config can be changed if xendConfigVersion < 3 */
if (priv->xendConfigVersion < 3 && if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4 &&
(flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT && (flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT &&
flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) { flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
@ -2948,7 +2948,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
/* Xen only supports modifying both live and persistent config if /* Xen only supports modifying both live and persistent config if
* xendConfigVersion >= 3 * xendConfigVersion >= 3
*/ */
if (priv->xendConfigVersion >= 3 && if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4 &&
(flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE | (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) { VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
@ -3016,7 +3016,7 @@ xenDaemonDomainGetAutostart(virDomainPtr domain,
* config files used by old Xen) will handle this. * config files used by old Xen) will handle this.
*/ */
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < 3) if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1); return(-1);
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name); root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
@ -3056,7 +3056,7 @@ xenDaemonDomainSetAutostart(virDomainPtr domain,
* config files used by old Xen) will handle this. * config files used by old Xen) will handle this.
*/ */
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < 3) if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1); return(-1);
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name); root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
@ -3318,7 +3318,7 @@ virDomainPtr xenDaemonDomainDefineXML(virConnectPtr conn, const char *xmlDesc) {
priv = (xenUnifiedPrivatePtr) conn->privateData; priv = (xenUnifiedPrivatePtr) conn->privateData;
if (priv->xendConfigVersion < 3) if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(NULL); return(NULL);
if (!(def = virDomainDefParseString(priv->caps, xmlDesc, if (!(def = virDomainDefParseString(priv->caps, xmlDesc,
@ -3367,7 +3367,7 @@ int xenDaemonDomainCreate(virDomainPtr domain)
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < 3) if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1); return(-1);
ret = xend_op(domain->conn, domain->name, "op", "start", NULL); ret = xend_op(domain->conn, domain->name, "op", "start", NULL);
@ -3394,7 +3394,7 @@ int xenDaemonDomainUndefine(virDomainPtr domain)
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < 3) if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1); return(-1);
return xend_op(domain->conn, domain->name, "op", "delete", NULL); return xend_op(domain->conn, domain->name, "op", "delete", NULL);
@ -3419,7 +3419,7 @@ xenDaemonNumOfDefinedDomains(virConnectPtr conn)
/* xm_internal.c (the support for defined domains from /etc/xen /* xm_internal.c (the support for defined domains from /etc/xen
* config files used by old Xen) will handle this. * config files used by old Xen) will handle this.
*/ */
if (priv->xendConfigVersion < 3) if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1); return(-1);
root = sexpr_get(conn, "/xend/domain?state=halted"); root = sexpr_get(conn, "/xend/domain?state=halted");
@ -3447,7 +3447,7 @@ xenDaemonListDefinedDomains(virConnectPtr conn, char **const names, int maxnames
struct sexpr *_for_i, *node; struct sexpr *_for_i, *node;
xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData; xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
if (priv->xendConfigVersion < 3) if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1); return(-1);
if ((names == NULL) || (maxnames < 0)) if ((names == NULL) || (maxnames < 0))
@ -3513,7 +3513,7 @@ xenDaemonGetSchedulerType(virDomainPtr domain, int *nparams)
/* Support only xendConfigVersion >=4 */ /* Support only xendConfigVersion >=4 */
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < 4) { if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) {
virXendError(VIR_ERR_OPERATION_INVALID, virXendError(VIR_ERR_OPERATION_INVALID,
"%s", _("unsupported in xendConfigVersion < 4")); "%s", _("unsupported in xendConfigVersion < 4"));
return NULL; return NULL;
@ -3586,7 +3586,7 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain,
/* Support only xendConfigVersion >=4 */ /* Support only xendConfigVersion >=4 */
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < 4) { if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) {
virXendError(VIR_ERR_OPERATION_INVALID, virXendError(VIR_ERR_OPERATION_INVALID,
"%s", _("unsupported in xendConfigVersion < 4")); "%s", _("unsupported in xendConfigVersion < 4"));
return (-1); return (-1);
@ -3694,7 +3694,7 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
/* Support only xendConfigVersion >=4 and active domains */ /* Support only xendConfigVersion >=4 and active domains */
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < 4) { if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) {
virXendError(VIR_ERR_OPERATION_INVALID, virXendError(VIR_ERR_OPERATION_INVALID,
"%s", _("unsupported in xendConfigVersion < 4")); "%s", _("unsupported in xendConfigVersion < 4"));
return (-1); return (-1);
@ -3802,7 +3802,7 @@ xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path,
priv = (xenUnifiedPrivatePtr) domain->conn->privateData; priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (domain->id < 0 && priv->xendConfigVersion < 3) if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return -2; /* Decline, allow XM to handle it. */ return -2; /* Decline, allow XM to handle it. */
/* Security check: The path must correspond to a block device. */ /* Security check: The path must correspond to a block device. */

View File

@ -55,7 +55,7 @@ int xenGetDomIdFromSxpr(const struct sexpr *root, int xendConfigVersion)
{ {
int id = -1; int id = -1;
const char * tmp = sexpr_node(root, "domain/domid"); const char * tmp = sexpr_node(root, "domain/domid");
if (tmp == NULL && xendConfigVersion < 3) { /* Old XenD, domid was mandatory */ if (tmp == NULL && xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) { /* domid was mandatory */
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR, XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
"%s", _("domain information incomplete, missing id")); "%s", _("domain information incomplete, missing id"));
} else { } else {
@ -468,7 +468,7 @@ xenParseSxprDisks(virDomainDefPtr def,
disk->device = VIR_DOMAIN_DISK_DEVICE_DISK; disk->device = VIR_DOMAIN_DISK_DEVICE_DISK;
/* New style disk config from Xen >= 3.0.3 */ /* New style disk config from Xen >= 3.0.3 */
if (xendConfigVersion > 1) { if (xendConfigVersion >= XEND_CONFIG_VERSION_3_0_3) {
offset = strrchr(dst, ':'); offset = strrchr(dst, ':');
if (offset) { if (offset) {
if (STREQ (offset, ":cdrom")) { if (STREQ (offset, ":cdrom")) {
@ -814,7 +814,7 @@ xenParseSxprGraphicsOld(virDomainDefPtr def,
* present yet. Subsquent dumps of the XML will eventually * present yet. Subsquent dumps of the XML will eventually
* find the port in XenStore once VNC server has started * find the port in XenStore once VNC server has started
*/ */
if (port == -1 && xendConfigVersion < 2) if (port == -1 && xendConfigVersion < XEND_CONFIG_VERSION_3_0_3)
port = 5900 + def->id; port = 5900 + def->id;
if ((unused && STREQ(unused, "1")) || port == -1) if ((unused && STREQ(unused, "1")) || port == -1)
@ -1132,7 +1132,7 @@ xenParseSxpr(const struct sexpr *root,
goto no_memory; goto no_memory;
tmp = sexpr_node(root, "domain/domid"); tmp = sexpr_node(root, "domain/domid");
if (tmp == NULL && xendConfigVersion < 3) { /* Old XenD, domid was mandatory */ if (tmp == NULL && xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) { /* domid was mandatory */
XENXS_ERROR(VIR_ERR_INTERNAL_ERROR, XENXS_ERROR(VIR_ERR_INTERNAL_ERROR,
"%s", _("domain information incomplete, missing id")); "%s", _("domain information incomplete, missing id"));
goto error; goto error;
@ -1318,7 +1318,7 @@ xenParseSxpr(const struct sexpr *root,
/* Old style cdrom config from Xen <= 3.0.2 */ /* Old style cdrom config from Xen <= 3.0.2 */
if (hvm && if (hvm &&
xendConfigVersion == 1) { xendConfigVersion == XEND_CONFIG_VERSION_3_0_2) {
tmp = sexpr_node(root, "domain/image/hvm/cdrom"); tmp = sexpr_node(root, "domain/image/hvm/cdrom");
if ((tmp != NULL) && (tmp[0] != 0)) { if ((tmp != NULL) && (tmp[0] != 0)) {
virDomainDiskDefPtr disk; virDomainDiskDefPtr disk;
@ -1617,7 +1617,7 @@ xenFormatSxprGraphicsOld(virDomainGraphicsDefPtr def,
virBufferAsprintf(buf, "(xauthority '%s')", def->data.sdl.xauth); virBufferAsprintf(buf, "(xauthority '%s')", def->data.sdl.xauth);
} else if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) { } else if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
virBufferAddLit(buf, "(vnc 1)"); virBufferAddLit(buf, "(vnc 1)");
if (xendConfigVersion >= 2) { if (xendConfigVersion >= XEND_CONFIG_VERSION_3_0_3) {
if (def->data.vnc.autoport) { if (def->data.vnc.autoport) {
virBufferAddLit(buf, "(vncunused 1)"); virBufferAddLit(buf, "(vncunused 1)");
} else { } else {
@ -1762,7 +1762,7 @@ xenFormatSxprDisk(virDomainDiskDefPtr def,
/* Xend <= 3.0.2 doesn't include cdrom config here */ /* Xend <= 3.0.2 doesn't include cdrom config here */
if (hvm && if (hvm &&
def->device == VIR_DOMAIN_DISK_DEVICE_CDROM && def->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
xendConfigVersion == 1) { xendConfigVersion == XEND_CONFIG_VERSION_3_0_2) {
if (isAttach) { if (isAttach) {
XENXS_ERROR(VIR_ERR_INVALID_ARG, XENXS_ERROR(VIR_ERR_INVALID_ARG,
_("Cannot directly attach CDROM %s"), def->src); _("Cannot directly attach CDROM %s"), def->src);
@ -1787,7 +1787,7 @@ xenFormatSxprDisk(virDomainDiskDefPtr def,
if (hvm) { if (hvm) {
/* Xend <= 3.0.2 wants a ioemu: prefix on devices for HVM */ /* Xend <= 3.0.2 wants a ioemu: prefix on devices for HVM */
if (xendConfigVersion == 1) { if (xendConfigVersion == XEND_CONFIG_VERSION_3_0_2) {
virBufferEscapeSexpr(buf, "(dev 'ioemu:%s')", def->dst); virBufferEscapeSexpr(buf, "(dev 'ioemu:%s')", def->dst);
} else { } else {
/* But newer does not */ /* But newer does not */
@ -2338,7 +2338,7 @@ xenFormatSxpr(virConnectPtr conn,
switch (def->disks[i]->device) { switch (def->disks[i]->device) {
case VIR_DOMAIN_DISK_DEVICE_CDROM: case VIR_DOMAIN_DISK_DEVICE_CDROM:
/* Only xend <= 3.0.2 wants cdrom config here */ /* Only xend <= 3.0.2 wants cdrom config here */
if (xendConfigVersion != 1) if (xendConfigVersion != XEND_CONFIG_VERSION_3_0_2)
break; break;
if (!STREQ(def->disks[i]->dst, "hdc") || if (!STREQ(def->disks[i]->dst, "hdc") ||
def->disks[i]->src == NULL) def->disks[i]->src == NULL)
@ -2437,7 +2437,7 @@ xenFormatSxpr(virConnectPtr conn,
} }
/* get the device emulation model */ /* get the device emulation model */
if (def->emulator && (hvm || xendConfigVersion >= 3)) if (def->emulator && (hvm || xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4))
virBufferEscapeSexpr(&buf, "(device_model '%s')", def->emulator); virBufferEscapeSexpr(&buf, "(device_model '%s')", def->emulator);
/* look for HPET in order to override the hypervisor/xend default */ /* look for HPET in order to override the hypervisor/xend default */
@ -2452,7 +2452,7 @@ xenFormatSxpr(virConnectPtr conn,
/* PV graphics for xen <= 3.0.4, or HVM graphics for xen <= 3.1.0 */ /* PV graphics for xen <= 3.0.4, or HVM graphics for xen <= 3.1.0 */
if ((!hvm && xendConfigVersion < XEND_CONFIG_MIN_VERS_PVFB_NEWCONF) || if ((!hvm && xendConfigVersion < XEND_CONFIG_MIN_VERS_PVFB_NEWCONF) ||
(hvm && xendConfigVersion < 4)) { (hvm && xendConfigVersion < XEND_CONFIG_VERSION_3_1_0)) {
if ((def->ngraphics == 1) && if ((def->ngraphics == 1) &&
xenFormatSxprGraphicsOld(def->graphics[0], xenFormatSxprGraphicsOld(def->graphics[0],
&buf, xendConfigVersion) < 0) &buf, xendConfigVersion) < 0)
@ -2484,7 +2484,7 @@ xenFormatSxpr(virConnectPtr conn,
/* New style PV graphics config xen >= 3.0.4, /* New style PV graphics config xen >= 3.0.4,
* or HVM graphics config xen >= 3.0.5 */ * or HVM graphics config xen >= 3.0.5 */
if ((xendConfigVersion >= XEND_CONFIG_MIN_VERS_PVFB_NEWCONF && !hvm) || if ((xendConfigVersion >= XEND_CONFIG_MIN_VERS_PVFB_NEWCONF && !hvm) ||
(xendConfigVersion >= 4 && hvm)) { (xendConfigVersion >= XEND_CONFIG_VERSION_3_1_0 && hvm)) {
if ((def->ngraphics == 1) && if ((def->ngraphics == 1) &&
xenFormatSxprGraphicsNew(def->graphics[0], &buf) < 0) xenFormatSxprGraphicsNew(def->graphics[0], &buf) < 0)
goto error; goto error;

View File

@ -1,8 +1,8 @@
/* /*
* xen_sxpr.h: Xen SEXPR parsing functions * xen_sxpr.h: Xen SEXPR parsing functions
* *
* Copyright (C) 2006-2008, 2010, 2012 Red Hat, Inc.
* Copyright (C) 2011 Univention GmbH * Copyright (C) 2011 Univention GmbH
* Copyright (C) 2006-2008, 2010 Red Hat, Inc.
* Copyright (C) 2005,2006 * Copyright (C) 2005,2006
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -32,6 +32,13 @@
# include "domain_conf.h" # include "domain_conf.h"
# include "sexpr.h" # include "sexpr.h"
typedef enum {
XEND_CONFIG_VERSION_3_0_2 = 1,
XEND_CONFIG_VERSION_3_0_3 = 2,
XEND_CONFIG_VERSION_3_0_4 = 3,
XEND_CONFIG_VERSION_3_1_0 = 4,
} xenConfigVersionEnum;
/* helper functions to get the dom id from a sexpr */ /* helper functions to get the dom id from a sexpr */
int xenGetDomIdFromSxprString(const char *sexpr, int xendConfigVersion); int xenGetDomIdFromSxprString(const char *sexpr, int xendConfigVersion);
int xenGetDomIdFromSxpr(const struct sexpr *root, int xendConfigVersion); int xenGetDomIdFromSxpr(const struct sexpr *root, int xendConfigVersion);

View File

@ -570,7 +570,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
} }
} }
if (hvm && xendConfigVersion == 1) { if (hvm && xendConfigVersion == XEND_CONFIG_VERSION_3_0_2) {
if (xenXMConfigGetString(conf, "cdrom", &str, NULL) < 0) if (xenXMConfigGetString(conf, "cdrom", &str, NULL) < 0)
goto cleanup; goto cleanup;
if (str) { if (str) {
@ -858,7 +858,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
} }
/* HVM guests, or old PV guests use this config format */ /* HVM guests, or old PV guests use this config format */
if (hvm || xendConfigVersion < 3) { if (hvm || xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
if (xenXMConfigGetBool(conf, "vnc", &val, 0) < 0) if (xenXMConfigGetBool(conf, "vnc", &val, 0) < 0)
goto cleanup; goto cleanup;
@ -1169,7 +1169,7 @@ static int xenFormatXMDisk(virConfValuePtr list,
virBufferAdd(&buf, disk->src, -1); virBufferAdd(&buf, disk->src, -1);
} }
virBufferAddLit(&buf, ","); virBufferAddLit(&buf, ",");
if (hvm && xendConfigVersion == 1) if (hvm && xendConfigVersion == XEND_CONFIG_VERSION_3_0_2)
virBufferAddLit(&buf, "ioemu:"); virBufferAddLit(&buf, "ioemu:");
virBufferAdd(&buf, disk->dst, -1); virBufferAdd(&buf, disk->dst, -1);
@ -1545,7 +1545,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
(1 << VIR_DOMAIN_FEATURE_APIC)) ? 1 : 0) < 0) (1 << VIR_DOMAIN_FEATURE_APIC)) ? 1 : 0) < 0)
goto no_memory; goto no_memory;
if (xendConfigVersion >= 3) { if (xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4) {
if (xenXMConfigSetInt(conf, "hap", if (xenXMConfigSetInt(conf, "hap",
(def->features & (def->features &
(1 << VIR_DOMAIN_FEATURE_HAP)) ? 1 : 0) < 0) (1 << VIR_DOMAIN_FEATURE_HAP)) ? 1 : 0) < 0)
@ -1584,7 +1584,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
break; break;
} }
if (xendConfigVersion == 1) { if (xendConfigVersion == XEND_CONFIG_VERSION_3_0_2) {
for (i = 0 ; i < def->ndisks ; i++) { for (i = 0 ; i < def->ndisks ; i++) {
if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_CDROM && if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
def->disks[i]->dst && def->disks[i]->dst &&
@ -1665,7 +1665,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
} }
if (def->ngraphics == 1) { if (def->ngraphics == 1) {
if (xendConfigVersion < (hvm ? 4 : XEND_CONFIG_MIN_VERS_PVFB_NEWCONF)) { if (xendConfigVersion < (hvm ? XEND_CONFIG_VERSION_3_1_0 : XEND_CONFIG_MIN_VERS_PVFB_NEWCONF)) {
if (def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) { if (def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) {
if (xenXMConfigSetInt(conf, "sdl", 1) < 0) if (xenXMConfigSetInt(conf, "sdl", 1) < 0)
goto no_memory; goto no_memory;
@ -1772,7 +1772,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
diskVal->list = NULL; diskVal->list = NULL;
for (i = 0 ; i < def->ndisks ; i++) { for (i = 0 ; i < def->ndisks ; i++) {
if (xendConfigVersion == 1 && if (xendConfigVersion == XEND_CONFIG_VERSION_3_0_2 &&
def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_CDROM && def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
def->disks[i]->dst && def->disks[i]->dst &&
STREQ(def->disks[i]->dst, "hdc")) { STREQ(def->disks[i]->dst, "hdc")) {

View File

@ -29,6 +29,7 @@
# include <stdint.h> # include <stdint.h>
# include <xen/xen.h> # include <xen/xen.h>
# include "xen_sxpr.h"
/* xen-unstable changeset 19788 removed MAX_VIRT_CPUS from public /* xen-unstable changeset 19788 removed MAX_VIRT_CPUS from public
* headers. Its semantic was retained with XEN_LEGACY_MAX_VCPUS. * headers. Its semantic was retained with XEN_LEGACY_MAX_VCPUS.
@ -40,10 +41,10 @@
# ifdef WITH_RHEL5_API # ifdef WITH_RHEL5_API
# define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 0 # define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 0
# define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 2 # define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF XEND_CONFIG_VERSION_3_0_3
# else # else
# define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 3 # define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU XEND_CONFIG_VERSION_3_0_4
# define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 3 # define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF XEND_CONFIG_VERSION_3_0_4
# endif # endif
# define MIN_XEN_GUEST_SIZE 64 /* 64 megabytes */ # define MIN_XEN_GUEST_SIZE 64 /* 64 megabytes */