+ /* If xendConfigVersion is 2, then we can only report _LIVE (and
+ * xm_internal reports _CONFIG). If it is 3, then _LIVE and
+ * _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;
+ if (domain->id < 0 && (flags & VIR_DOMAIN_VCPU_LIVE)) {
+ virXendError(VIR_ERR_OPERATION_INVALID, "%s",
+ * depends on xendConfigVersion. */
+ if (dom) {
+ priv = dom->conn->privateData;
-+ if (priv->xendConfigVersion >= 3)
++ if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4)
+ flags |= VIR_DOMAIN_VCPU_CONFIG;
+ }
+ return xenUnifiedDomainSetVcpusFlags(dom, nvcpus, flags);
+
+ 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))
+ return -2;
+
+ /* With xendConfigVersion 2, only _LIVE is supported. With
+ * xendConfigVersion 3, only _LIVE|_CONFIG is supported for
+ * 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) {
+ virXendError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Xend version does not support modifying "
-
- 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);
-
- snprintf(buf, sizeof(buf), "%d", vcpus);
/* XenD is active, so try the xm & xs drivers too, both requird to
* succeed if root, optional otherwise */
- if (priv->xendConfigVersion <= 2) {
+ if (priv->xendConfigVersion <= XEND_CONFIG_VERSION_3_0_3) {
VIR_DEBUG("Trying XM sub-driver");
if (xenXMOpen(conn, auth, flags) == VIR_DRV_OPEN_SUCCESS) {
VIR_DEBUG("Activated XM sub-driver");
* depends on xendConfigVersion. */
if (dom) {
priv = dom->conn->privateData;
- if (priv->xendConfigVersion >= 3)
+ if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4)
flags |= VIR_DOMAIN_VCPU_CONFIG;
}
return xenUnifiedDomainSetVcpusFlags(dom, nvcpus, flags);
{
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])
return xenXMDomainGetXMLDesc(dom, flags);
} else {
* to make this API work
*/
if (priv->opened[XEN_UNIFIED_XEND_OFFSET] &&
- priv->xendConfigVersion >= 3)
+ priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4)
flags |= VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
* to make this API work
*/
if (priv->opened[XEN_UNIFIED_XEND_OFFSET] &&
- priv->xendConfigVersion >= 3)
+ priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4)
flags |= VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
{
GET_PRIVATE(dom->conn);
- if (priv->xendConfigVersion < 3) {
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
if (priv->opened[XEN_UNIFIED_XM_OFFSET])
return xenXMDomainGetAutostart(dom, autostart);
} else {
{
GET_PRIVATE(dom->conn);
- if (priv->xendConfigVersion < 3) {
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
if (priv->opened[XEN_UNIFIED_XM_OFFSET])
return xenXMDomainSetAutostart(dom, autostart);
} else {
} else {
/* Xen prior to 3.0.3 did not have the xend_config_format
field, and is implicitly version 1. */
- priv->xendConfigVersion = 1;
+ priv->xendConfigVersion = XEND_CONFIG_VERSION_3_0_2;
}
sexpr_free(root);
return (0);
/* New 3.0.4 XenD will not report a domid for inactive domains,
* so only error out for old XenD
*/
- if (!tmp && priv->xendConfigVersion < 3)
+ if (!tmp && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
goto error;
if (tmp)
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);
/* can we ask for a subset ? worth it ? */
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);
/* can we ask for a subset ? worth it ? */
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);
snprintf(buf, sizeof(buf), "%lu", VIR_DIV_UP(memory, 1024));
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);
snprintf(buf, sizeof(buf), "%lu", VIR_DIV_UP(memory, 1024));
}
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 */
return(NULL);
}
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);
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
virCheckFlags(0, -1);
- if (domain->id < 0 && priv->xendConfigVersion < 3)
+ if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return -1;
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
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))
return -2;
/* With xendConfigVersion 2, only _LIVE is supported. With
* xendConfigVersion 3, only _LIVE|_CONFIG is supported for
* 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) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
_("Xend version does not support modifying "
}
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- if (priv->xendConfigVersion < 3) {
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
mapstr[0] = '[';
mapstr[1] = 0;
} else {
snprintf(buf, sizeof(buf), "%d,", (8 * i) + j);
strcat(mapstr, buf);
}
- if (priv->xendConfigVersion < 3)
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
mapstr[strlen(mapstr) - 1] = ']';
else
mapstr[strlen(mapstr) - 1] = 0;
/* If xendConfigVersion is 2, then we can only report _LIVE (and
* xm_internal reports _CONFIG). If it is 3, then _LIVE and
* _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;
if (domain->id < 0 && (flags & VIR_DOMAIN_VCPU_LIVE)) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
/* Old approach for xen <= 3.0.3 */
- if (priv->xendConfigVersion < 3) {
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
char **names, **tmp;
unsigned char ident[VIR_UUID_BUFLEN];
names = xenDaemonListDomainsOld(conn);
return -1;
}
/* 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",
_("Xend version does not support modifying "
"persistent config"));
}
} else {
/* 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_LIVE)) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
/* Xen only supports modifying both live and persistent config if
* xendConfigVersion >= 3
*/
- if (priv->xendConfigVersion >= 3 &&
+ if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4 &&
(flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
return -1;
}
/* 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",
_("Xend version does not support modifying "
"persistent config"));
}
} else {
/* 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_LIVE)) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
/* Xen only supports modifying both live and persistent config if
* xendConfigVersion >= 3
*/
- if (priv->xendConfigVersion >= 3 &&
+ if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4 &&
(flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
return -1;
}
/* 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",
_("Xend version does not support modifying "
"persistent config"));
}
} else {
/* 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_LIVE)) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
/* Xen only supports modifying both live and persistent config if
* xendConfigVersion >= 3
*/
- if (priv->xendConfigVersion >= 3 &&
+ if (priv->xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4 &&
(flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
* config files used by old Xen) will handle this.
*/
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- if (priv->xendConfigVersion < 3)
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1);
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
* config files used by old Xen) will handle this.
*/
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- if (priv->xendConfigVersion < 3)
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1);
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
priv = (xenUnifiedPrivatePtr) conn->privateData;
- if (priv->xendConfigVersion < 3)
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(NULL);
if (!(def = virDomainDefParseString(priv->caps, xmlDesc,
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- if (priv->xendConfigVersion < 3)
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1);
ret = xend_op(domain->conn, domain->name, "op", "start", NULL);
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- if (priv->xendConfigVersion < 3)
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1);
return xend_op(domain->conn, domain->name, "op", "delete", NULL);
/* xm_internal.c (the support for defined domains from /etc/xen
* config files used by old Xen) will handle this.
*/
- if (priv->xendConfigVersion < 3)
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1);
root = sexpr_get(conn, "/xend/domain?state=halted");
struct sexpr *_for_i, *node;
xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
- if (priv->xendConfigVersion < 3)
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return(-1);
if ((names == NULL) || (maxnames < 0))
/* Support only xendConfigVersion >=4 */
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- if (priv->xendConfigVersion < 4) {
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) {
virXendError(VIR_ERR_OPERATION_INVALID,
"%s", _("unsupported in xendConfigVersion < 4"));
return NULL;
/* Support only xendConfigVersion >=4 */
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- if (priv->xendConfigVersion < 4) {
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) {
virXendError(VIR_ERR_OPERATION_INVALID,
"%s", _("unsupported in xendConfigVersion < 4"));
return (-1);
/* Support only xendConfigVersion >=4 and active domains */
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- if (priv->xendConfigVersion < 4) {
+ if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) {
virXendError(VIR_ERR_OPERATION_INVALID,
"%s", _("unsupported in xendConfigVersion < 4"));
return (-1);
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. */
/* Security check: The path must correspond to a block device. */
{
int id = -1;
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,
"%s", _("domain information incomplete, missing id"));
} else {
disk->device = VIR_DOMAIN_DISK_DEVICE_DISK;
/* New style disk config from Xen >= 3.0.3 */
- if (xendConfigVersion > 1) {
+ if (xendConfigVersion >= XEND_CONFIG_VERSION_3_0_3) {
offset = strrchr(dst, ':');
if (offset) {
if (STREQ (offset, ":cdrom")) {
* present yet. Subsquent dumps of the XML will eventually
* 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;
if ((unused && STREQ(unused, "1")) || port == -1)
goto no_memory;
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,
"%s", _("domain information incomplete, missing id"));
goto error;
/* Old style cdrom config from Xen <= 3.0.2 */
if (hvm &&
- xendConfigVersion == 1) {
+ xendConfigVersion == XEND_CONFIG_VERSION_3_0_2) {
tmp = sexpr_node(root, "domain/image/hvm/cdrom");
if ((tmp != NULL) && (tmp[0] != 0)) {
virDomainDiskDefPtr disk;
virBufferAsprintf(buf, "(xauthority '%s')", def->data.sdl.xauth);
} else if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
virBufferAddLit(buf, "(vnc 1)");
- if (xendConfigVersion >= 2) {
+ if (xendConfigVersion >= XEND_CONFIG_VERSION_3_0_3) {
if (def->data.vnc.autoport) {
virBufferAddLit(buf, "(vncunused 1)");
} else {
/* Xend <= 3.0.2 doesn't include cdrom config here */
if (hvm &&
def->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
- xendConfigVersion == 1) {
+ xendConfigVersion == XEND_CONFIG_VERSION_3_0_2) {
if (isAttach) {
XENXS_ERROR(VIR_ERR_INVALID_ARG,
_("Cannot directly attach CDROM %s"), def->src);
if (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);
} else {
/* But newer does not */
switch (def->disks[i]->device) {
case VIR_DOMAIN_DISK_DEVICE_CDROM:
/* Only xend <= 3.0.2 wants cdrom config here */
- if (xendConfigVersion != 1)
+ if (xendConfigVersion != XEND_CONFIG_VERSION_3_0_2)
break;
if (!STREQ(def->disks[i]->dst, "hdc") ||
def->disks[i]->src == NULL)
}
/* 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);
/* look for HPET in order to override the hypervisor/xend default */
/* PV graphics for xen <= 3.0.4, or HVM graphics for xen <= 3.1.0 */
if ((!hvm && xendConfigVersion < XEND_CONFIG_MIN_VERS_PVFB_NEWCONF) ||
- (hvm && xendConfigVersion < 4)) {
+ (hvm && xendConfigVersion < XEND_CONFIG_VERSION_3_1_0)) {
if ((def->ngraphics == 1) &&
xenFormatSxprGraphicsOld(def->graphics[0],
&buf, xendConfigVersion) < 0)
/* New style PV graphics config xen >= 3.0.4,
* or HVM graphics config xen >= 3.0.5 */
if ((xendConfigVersion >= XEND_CONFIG_MIN_VERS_PVFB_NEWCONF && !hvm) ||
- (xendConfigVersion >= 4 && hvm)) {
+ (xendConfigVersion >= XEND_CONFIG_VERSION_3_1_0 && hvm)) {
if ((def->ngraphics == 1) &&
xenFormatSxprGraphicsNew(def->graphics[0], &buf) < 0)
goto error;
/*
* xen_sxpr.h: Xen SEXPR parsing functions
*
+ * Copyright (C) 2006-2008, 2010, 2012 Red Hat, Inc.
* Copyright (C) 2011 Univention GmbH
- * Copyright (C) 2006-2008, 2010 Red Hat, Inc.
* Copyright (C) 2005,2006
*
* This library is free software; you can redistribute it and/or
# include "domain_conf.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 */
int xenGetDomIdFromSxprString(const char *sexpr, int xendConfigVersion);
int xenGetDomIdFromSxpr(const struct sexpr *root, int xendConfigVersion);
}
}
- if (hvm && xendConfigVersion == 1) {
+ if (hvm && xendConfigVersion == XEND_CONFIG_VERSION_3_0_2) {
if (xenXMConfigGetString(conf, "cdrom", &str, NULL) < 0)
goto cleanup;
if (str) {
}
/* 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)
goto cleanup;
virBufferAdd(&buf, disk->src, -1);
}
virBufferAddLit(&buf, ",");
- if (hvm && xendConfigVersion == 1)
+ if (hvm && xendConfigVersion == XEND_CONFIG_VERSION_3_0_2)
virBufferAddLit(&buf, "ioemu:");
virBufferAdd(&buf, disk->dst, -1);
(1 << VIR_DOMAIN_FEATURE_APIC)) ? 1 : 0) < 0)
goto no_memory;
- if (xendConfigVersion >= 3) {
+ if (xendConfigVersion >= XEND_CONFIG_VERSION_3_0_4) {
if (xenXMConfigSetInt(conf, "hap",
(def->features &
(1 << VIR_DOMAIN_FEATURE_HAP)) ? 1 : 0) < 0)
break;
}
- if (xendConfigVersion == 1) {
+ if (xendConfigVersion == XEND_CONFIG_VERSION_3_0_2) {
for (i = 0 ; i < def->ndisks ; i++) {
if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
def->disks[i]->dst &&
}
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 (xenXMConfigSetInt(conf, "sdl", 1) < 0)
goto no_memory;
diskVal->list = NULL;
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]->dst &&
STREQ(def->disks[i]->dst, "hdc")) {
# include <stdint.h>
# include <xen/xen.h>
+# include "xen_sxpr.h"
/* xen-unstable changeset 19788 removed MAX_VIRT_CPUS from public
* headers. Its semantic was retained with XEN_LEGACY_MAX_VCPUS.
# ifdef WITH_RHEL5_API
# 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
-# define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 3
-# define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 3
+# define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU XEND_CONFIG_VERSION_3_0_4
+# define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF XEND_CONFIG_VERSION_3_0_4
# endif
# define MIN_XEN_GUEST_SIZE 64 /* 64 megabytes */