NULL, /* domainSetSchedulerParameters */
};
-#define xenXMError(conn, code, ...) \
- virReportErrorHelper(conn, VIR_FROM_XENXM, code, __FILE__, \
+#define xenXMError(code, ...) \
+ virReportErrorHelper(NULL, VIR_FROM_XENXM, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
#ifndef WITH_XEN_INOTIFY
#endif
/* Convenience method to grab a int from the config file object */
-static int xenXMConfigGetBool(virConnectPtr conn,
- virConfPtr conf,
+static int xenXMConfigGetBool(virConfPtr conf,
const char *name,
int *value,
int def) {
} else if (val->type == VIR_CONF_STRING) {
*value = STREQ(val->str, "1") ? 1 : 0;
} else {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("config value %s was malformed"), name);
return -1;
}
/* Convenience method to grab a int from the config file object */
-static int xenXMConfigGetULong(virConnectPtr conn,
- virConfPtr conf,
+static int xenXMConfigGetULong(virConfPtr conf,
const char *name,
unsigned long *value,
int def) {
char *ret;
*value = strtol(val->str, &ret, 10);
if (ret == val->str) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("config value %s was malformed"), name);
return -1;
}
} else {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("config value %s was malformed"), name);
return -1;
}
/* Convenience method to grab a string from the config file object */
-static int xenXMConfigGetString(virConnectPtr conn,
- virConfPtr conf,
+static int xenXMConfigGetString(virConfPtr conf,
const char *name,
const char **value,
const char *def) {
}
if (val->type != VIR_CONF_STRING) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("config value %s was malformed"), name);
return -1;
}
return 0;
}
-static int xenXMConfigCopyStringInternal(virConnectPtr conn,
- virConfPtr conf,
+static int xenXMConfigCopyStringInternal(virConfPtr conf,
const char *name,
char **value,
int allowMissing) {
if (!(val = virConfGetValue(conf, name))) {
if (allowMissing)
return 0;
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("config value %s was missing"), name);
return -1;
}
if (val->type != VIR_CONF_STRING) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("config value %s was not a string"), name);
return -1;
}
if (!val->str) {
if (allowMissing)
return 0;
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("config value %s was missing"), name);
return -1;
}
}
-static int xenXMConfigCopyString(virConnectPtr conn,
- virConfPtr conf,
+static int xenXMConfigCopyString(virConfPtr conf,
const char *name,
char **value) {
- return xenXMConfigCopyStringInternal(conn, conf, name, value, 0);
+ return xenXMConfigCopyStringInternal(conf, name, value, 0);
}
-static int xenXMConfigCopyStringOpt(virConnectPtr conn,
- virConfPtr conf,
+static int xenXMConfigCopyStringOpt(virConfPtr conf,
const char *name,
char **value) {
- return xenXMConfigCopyStringInternal(conn, conf, name, value, 1);
+ return xenXMConfigCopyStringInternal(conf, name, value, 1);
}
if (virHashAddEntry(priv->configCache, entry->filename, entry) < 0) {
virDomainDefFree(entry->def);
VIR_FREE(entry);
- xenXMError (conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
"%s", _("xenXMConfigCacheRefresh: virHashAddEntry"));
return -1;
}
const char *filename;
xenXMConfCachePtr entry;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
- __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return(-1);
}
def->virtType = VIR_DOMAIN_VIRT_XEN;
def->id = -1;
- if (xenXMConfigCopyString(conn, conf, "name", &def->name) < 0)
+ if (xenXMConfigCopyString(conf, "name", &def->name) < 0)
goto cleanup;
if (xenXMConfigGetUUID(conf, "uuid", def->uuid) < 0)
goto cleanup;
- if ((xenXMConfigGetString(conn, conf, "builder", &str, "linux") == 0) &&
+ if ((xenXMConfigGetString(conf, "builder", &str, "linux") == 0) &&
STREQ(str, "hvm"))
hvm = 1;
defaultArch = virCapabilitiesDefaultGuestArch(priv->caps, def->os.type, virDomainVirtTypeToString(def->virtType));
if (defaultArch == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("no supported architecture for os type '%s'"),
def->os.type);
goto cleanup;
if (hvm) {
const char *boot;
- if (xenXMConfigCopyString(conn, conf, "kernel", &def->os.loader) < 0)
+ if (xenXMConfigCopyString(conf, "kernel", &def->os.loader) < 0)
goto cleanup;
- if (xenXMConfigGetString(conn, conf, "boot", &boot, "c") < 0)
+ if (xenXMConfigGetString(conf, "boot", &boot, "c") < 0)
goto cleanup;
for (i = 0 ; i < VIR_DOMAIN_BOOT_LAST && boot[i] ; i++) {
def->os.nBootDevs++;
}
} else {
- if (xenXMConfigCopyStringOpt(conn, conf, "bootloader", &def->os.bootloader) < 0)
+ if (xenXMConfigCopyStringOpt(conf, "bootloader", &def->os.bootloader) < 0)
goto cleanup;
- if (xenXMConfigCopyStringOpt(conn, conf, "bootargs", &def->os.bootloaderArgs) < 0)
+ if (xenXMConfigCopyStringOpt(conf, "bootargs", &def->os.bootloaderArgs) < 0)
goto cleanup;
- if (xenXMConfigCopyStringOpt(conn, conf, "kernel", &def->os.kernel) < 0)
+ if (xenXMConfigCopyStringOpt(conf, "kernel", &def->os.kernel) < 0)
goto cleanup;
- if (xenXMConfigCopyStringOpt(conn, conf, "ramdisk", &def->os.initrd) < 0)
+ if (xenXMConfigCopyStringOpt(conf, "ramdisk", &def->os.initrd) < 0)
goto cleanup;
- if (xenXMConfigCopyStringOpt(conn, conf, "extra", &def->os.cmdline) < 0)
+ if (xenXMConfigCopyStringOpt(conf, "extra", &def->os.cmdline) < 0)
goto cleanup;
}
- if (xenXMConfigGetULong(conn, conf, "memory", &def->memory, MIN_XEN_GUEST_SIZE * 2) < 0)
+ if (xenXMConfigGetULong(conf, "memory", &def->memory, MIN_XEN_GUEST_SIZE * 2) < 0)
goto cleanup;
- if (xenXMConfigGetULong(conn, conf, "maxmem", &def->maxmem, def->memory) < 0)
+ if (xenXMConfigGetULong(conf, "maxmem", &def->maxmem, def->memory) < 0)
goto cleanup;
def->memory *= 1024;
def->maxmem *= 1024;
- if (xenXMConfigGetULong(conn, conf, "vcpus", &def->vcpus, 1) < 0)
+ if (xenXMConfigGetULong(conf, "vcpus", &def->vcpus, 1) < 0)
goto cleanup;
- if (xenXMConfigGetString(conn, conf, "cpus", &str, NULL) < 0)
+ if (xenXMConfigGetString(conf, "cpus", &str, NULL) < 0)
goto cleanup;
if (str) {
def->cpumasklen = 4096;
}
- if (xenXMConfigGetString(conn, conf, "on_poweroff", &str, "destroy") < 0)
+ if (xenXMConfigGetString(conf, "on_poweroff", &str, "destroy") < 0)
goto cleanup;
if ((def->onPoweroff = virDomainLifecycleTypeFromString(str)) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("unexpected value %s for on_poweroff"), str);
goto cleanup;
}
- if (xenXMConfigGetString(conn, conf, "on_reboot", &str, "restart") < 0)
+ if (xenXMConfigGetString(conf, "on_reboot", &str, "restart") < 0)
goto cleanup;
if ((def->onReboot = virDomainLifecycleTypeFromString(str)) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("unexpected value %s for on_reboot"), str);
goto cleanup;
}
- if (xenXMConfigGetString(conn, conf, "on_crash", &str, "restart") < 0)
+ if (xenXMConfigGetString(conf, "on_crash", &str, "restart") < 0)
goto cleanup;
if ((def->onCrash = virDomainLifecycleTypeFromString(str)) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("unexpected value %s for on_crash"), str);
goto cleanup;
}
if (hvm) {
- if (xenXMConfigGetBool(conn, conf, "pae", &val, 0) < 0)
+ if (xenXMConfigGetBool(conf, "pae", &val, 0) < 0)
goto cleanup;
else if (val)
def->features |= (1 << VIR_DOMAIN_FEATURE_PAE);
- if (xenXMConfigGetBool(conn, conf, "acpi", &val, 0) < 0)
+ if (xenXMConfigGetBool(conf, "acpi", &val, 0) < 0)
goto cleanup;
else if (val)
def->features |= (1 << VIR_DOMAIN_FEATURE_ACPI);
- if (xenXMConfigGetBool(conn, conf, "apic", &val, 0) < 0)
+ if (xenXMConfigGetBool(conf, "apic", &val, 0) < 0)
goto cleanup;
else if (val)
def->features |= (1 << VIR_DOMAIN_FEATURE_APIC);
}
- if (xenXMConfigGetBool(conn, conf, "localtime", &vmlocaltime, 0) < 0)
+ if (xenXMConfigGetBool(conf, "localtime", &vmlocaltime, 0) < 0)
goto cleanup;
def->clock.offset = vmlocaltime ?
VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME :
VIR_DOMAIN_CLOCK_OFFSET_UTC;
- if (xenXMConfigCopyStringOpt(conn, conf, "device_model", &def->emulator) < 0)
+ if (xenXMConfigCopyStringOpt(conf, "device_model", &def->emulator) < 0)
goto cleanup;
list = virConfGetValue(conf, "disk");
goto no_memory;
if (virStrncpy(disk->src, head, offset - head,
(offset - head) + 1) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Source file %s too big for destination"),
head);
goto cleanup;
goto no_memory;
if (virStrncpy(disk->dst, head, offset - head,
(offset - head) + 1) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Dest file %s too big for destination"), head);
goto cleanup;
}
if (virStrncpy(disk->driverName, disk->src,
(tmp - disk->src),
(tmp - disk->src) + 1) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Driver name %s too big for destination"),
disk->src);
goto cleanup;
if (virStrncpy(disk->driverType, disk->src,
(tmp - disk->src),
(tmp - disk->src) + 1) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Driver type %s too big for destination"),
disk->src);
goto cleanup;
}
if (hvm && priv->xendConfigVersion == 1) {
- if (xenXMConfigGetString(conn, conf, "cdrom", &str, NULL) < 0)
+ if (xenXMConfigGetString(conf, "cdrom", &str, NULL) < 0)
goto cleanup;
if (str) {
if (VIR_ALLOC(disk) < 0)
if (STRPREFIX(key, "mac=")) {
int len = nextkey ? (nextkey - data) : sizeof(mac) - 1;
if (virStrncpy(mac, data, len, sizeof(mac)) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("MAC address %s too big for destination"),
data);
goto skipnic;
} else if (STRPREFIX(key, "bridge=")) {
int len = nextkey ? (nextkey - data) : sizeof(bridge) - 1;
if (virStrncpy(bridge, data, len, sizeof(bridge)) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Bridge %s too big for destination"),
data);
goto skipnic;
} else if (STRPREFIX(key, "script=")) {
int len = nextkey ? (nextkey - data) : sizeof(script) - 1;
if (virStrncpy(script, data, len, sizeof(script)) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Script %s too big for destination"),
data);
goto skipnic;
} else if (STRPREFIX(key, "model=")) {
int len = nextkey ? (nextkey - data) : sizeof(model) - 1;
if (virStrncpy(model, data, len, sizeof(model)) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Model %s too big for destination"), data);
goto skipnic;
}
} else if (STRPREFIX(key, "type=")) {
int len = nextkey ? (nextkey - data) : sizeof(type) - 1;
if (virStrncpy(type, data, len, sizeof(type)) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Type %s too big for destination"), data);
goto skipnic;
}
} else if (STRPREFIX(key, "vifname=")) {
int len = nextkey ? (nextkey - data) : sizeof(vifname) - 1;
if (virStrncpy(vifname, data, len, sizeof(vifname)) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Vifname %s too big for destination"),
data);
goto skipnic;
} else if (STRPREFIX(key, "ip=")) {
int len = nextkey ? (nextkey - data) : sizeof(ip) - 1;
if (virStrncpy(ip, data, len, sizeof(ip)) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("IP %s too big for destination"), data);
goto skipnic;
}
if (mac[0]) {
if (virParseMacAddr(mac, net->mac) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("malformed mac address '%s'"), mac);
goto cleanup;
}
goto skippci;
if (virStrncpy(domain, key, (nextkey - key), sizeof(domain)) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Domain %s too big for destination"), key);
goto skippci;
}
goto skippci;
if (virStrncpy(bus, key, (nextkey - key), sizeof(bus)) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Bus %s too big for destination"), key);
goto skippci;
}
goto skippci;
if (virStrncpy(slot, key, (nextkey - key), sizeof(slot)) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Slot %s too big for destination"), key);
goto skippci;
}
goto skippci;
if (virStrncpy(func, key, 1, sizeof(func)) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("Function %s too big for destination"), key);
goto skippci;
}
}
if (hvm) {
- if (xenXMConfigGetString(conn, conf, "usbdevice", &str, NULL) < 0)
+ if (xenXMConfigGetString(conf, "usbdevice", &str, NULL) < 0)
goto cleanup;
if (str &&
(STREQ(str, "tablet") ||
/* HVM guests, or old PV guests use this config format */
if (hvm || priv->xendConfigVersion < 3) {
- if (xenXMConfigGetBool(conn, conf, "vnc", &val, 0) < 0)
+ if (xenXMConfigGetBool(conf, "vnc", &val, 0) < 0)
goto cleanup;
if (val) {
if (VIR_ALLOC(graphics) < 0)
goto no_memory;
graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_VNC;
- if (xenXMConfigGetBool(conn, conf, "vncunused", &val, 1) < 0)
+ if (xenXMConfigGetBool(conf, "vncunused", &val, 1) < 0)
goto cleanup;
graphics->data.vnc.autoport = val ? 1 : 0;
if (!graphics->data.vnc.autoport) {
unsigned long vncdisplay;
- if (xenXMConfigGetULong(conn, conf, "vncdisplay", &vncdisplay, 0) < 0)
+ if (xenXMConfigGetULong(conf, "vncdisplay", &vncdisplay, 0) < 0)
goto cleanup;
graphics->data.vnc.port = (int)vncdisplay + 5900;
}
- if (xenXMConfigCopyStringOpt(conn, conf, "vnclisten", &graphics->data.vnc.listenAddr) < 0)
+ if (xenXMConfigCopyStringOpt(conf, "vnclisten", &graphics->data.vnc.listenAddr) < 0)
goto cleanup;
- if (xenXMConfigCopyStringOpt(conn, conf, "vncpasswd", &graphics->data.vnc.passwd) < 0)
+ if (xenXMConfigCopyStringOpt(conf, "vncpasswd", &graphics->data.vnc.passwd) < 0)
goto cleanup;
- if (xenXMConfigCopyStringOpt(conn, conf, "keymap", &graphics->data.vnc.keymap) < 0)
+ if (xenXMConfigCopyStringOpt(conf, "keymap", &graphics->data.vnc.keymap) < 0)
goto cleanup;
if (VIR_ALLOC_N(def->graphics, 1) < 0)
def->ngraphics = 1;
graphics = NULL;
} else {
- if (xenXMConfigGetBool(conn, conf, "sdl", &val, 0) < 0)
+ if (xenXMConfigGetBool(conf, "sdl", &val, 0) < 0)
goto cleanup;
if (val) {
if (VIR_ALLOC(graphics) < 0)
goto no_memory;
graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_SDL;
- if (xenXMConfigCopyStringOpt(conn, conf, "display", &graphics->data.sdl.display) < 0)
+ if (xenXMConfigCopyStringOpt(conf, "display", &graphics->data.sdl.display) < 0)
goto cleanup;
- if (xenXMConfigCopyStringOpt(conn, conf, "xauthority", &graphics->data.sdl.xauth) < 0)
+ if (xenXMConfigCopyStringOpt(conf, "xauthority", &graphics->data.sdl.xauth) < 0)
goto cleanup;
if (VIR_ALLOC_N(def->graphics, 1) < 0)
goto no_memory;
char *key = vfb;
if (virStrcpyStatic(vfb, list->list->str) == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("VFB %s too big for destination"),
list->list->str);
goto cleanup;
if (hvm) {
virDomainChrDefPtr chr = NULL;
- if (xenXMConfigGetString(conn, conf, "parallel", &str, NULL) < 0)
+ if (xenXMConfigGetString(conf, "parallel", &str, NULL) < 0)
goto cleanup;
if (str && STRNEQ(str, "none") &&
!(chr = xenDaemonParseSxprChar(str, NULL)))
chr = NULL;
}
- if (xenXMConfigGetString(conn, conf, "serial", &str, NULL) < 0)
+ if (xenXMConfigGetString(conf, "serial", &str, NULL) < 0)
goto cleanup;
if (str && STRNEQ(str, "none") &&
!(chr = xenDaemonParseSxprChar(str, NULL)))
}
if (hvm) {
- if (xenXMConfigGetString(conn, conf, "soundhw", &str, NULL) < 0)
+ if (xenXMConfigGetString(conf, "soundhw", &str, NULL) < 0)
goto cleanup;
if (str &&
char *ret = NULL;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
- __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return(NULL);
}
if (domain->id != -1)
int ret = -1;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
- __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return (-1);
}
if (domain->conn->flags & VIR_CONNECT_RO)
int ret = -1;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
- __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return (-1);
}
if (domain->conn->flags & VIR_CONNECT_RO)
unsigned long ret = 0;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
- __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return (0);
}
if (domain->id != -1)
int ret = -1;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
- __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return (-1);
}
if (domain->conn->flags & VIR_CONNECT_RO)
if (domain == NULL || domain->conn == NULL || domain->name == NULL
|| cpumap == NULL || maplen < 1 || maplen > (int)sizeof(cpumap_t)) {
- xenXMError(domain ? domain->conn : NULL, VIR_ERR_INVALID_ARG,
- __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
if (domain->conn->flags & VIR_CONNECT_RO) {
- xenXMError (domain->conn, VIR_ERR_INVALID_ARG,
+ xenXMError(VIR_ERR_INVALID_ARG,
"%s", _("read only connection"));
return -1;
}
if (domain->id != -1) {
- xenXMError (domain->conn, VIR_ERR_INVALID_ARG,
+ xenXMError(VIR_ERR_INVALID_ARG,
"%s", _("not inactive domain"));
return -1;
}
xenUnifiedLock(priv);
if (!(filename = virHashLookup(priv->nameConfigMap, domain->name))) {
- xenXMError (domain->conn, VIR_ERR_INTERNAL_ERROR, "%s", _("virHashLookup"));
+ xenXMError(VIR_ERR_INTERNAL_ERROR, "%s", _("virHashLookup"));
goto cleanup;
}
if (!(entry = virHashLookup(priv->configCache, filename))) {
- xenXMError (domain->conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
"%s", _("can't retrieve config file for domain"));
goto cleanup;
}
virDomainPtr ret = NULL;
if (!VIR_IS_CONNECT(conn)) {
- xenXMError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return (NULL);
}
if (domname == NULL) {
- xenXMError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return (NULL);
}
virDomainPtr ret = NULL;
if (!VIR_IS_CONNECT(conn)) {
- xenXMError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return (NULL);
}
if (uuid == NULL) {
- xenXMError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return (NULL);
}
}
-static int xenXMDomainConfigFormatDisk(virConnectPtr conn,
- virConfValuePtr list,
+static int xenXMDomainConfigFormatDisk(virConfValuePtr list,
virDomainDiskDefPtr disk,
int hvm,
int xendConfigVersion)
virBufferAddLit(&buf, "phy:");
break;
default:
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("unsupported disk type %s"),
virDomainDiskTypeToString(disk->type));
goto cleanup;
virNetworkPtr network = virNetworkLookupByName(conn, net->data.network.name);
char *bridge;
if (!network) {
- xenXMError(conn, VIR_ERR_NO_NETWORK, "%s",
+ xenXMError(VIR_ERR_NO_NETWORK, "%s",
net->data.network.name);
return -1;
}
bridge = virNetworkGetBridgeName(network);
virNetworkFree(network);
if (!bridge) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("network %s is not active"),
net->data.network.name);
return -1;
break;
default:
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("unsupported network type %d"),
net->type);
goto cleanup;
if (def->clock.offset == VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME) {
if (def->clock.data.timezone) {
- xenXMError(conn, VIR_ERR_CONFIG_UNSUPPORTED,
+ xenXMError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s", _("configurable timezones are not supported"));
goto cleanup;
}
goto no_memory;
} else {
/* XXX We could support Xen's rtc clock offset */
- xenXMError(conn, VIR_ERR_CONFIG_UNSUPPORTED,
+ xenXMError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unsupported clock offset '%s'"),
virDomainClockOffsetTypeToString(def->clock.offset));
goto cleanup;
}
if (!(lifecycle = virDomainLifecycleTypeToString(def->onPoweroff))) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("unexpected lifecycle action %d"), def->onPoweroff);
goto cleanup;
}
if (!(lifecycle = virDomainLifecycleTypeToString(def->onReboot))) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("unexpected lifecycle action %d"), def->onReboot);
goto cleanup;
}
if (!(lifecycle = virDomainLifecycleTypeToString(def->onCrash))) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
_("unexpected lifecycle action %d"), def->onCrash);
goto cleanup;
}
if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY)
continue;
- if (xenXMDomainConfigFormatDisk(conn, diskVal, def->disks[i],
+ if (xenXMDomainConfigFormatDisk(diskVal, def->disks[i],
hvm, priv->xendConfigVersion) < 0)
goto cleanup;
}
xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
if (!VIR_IS_CONNECT(conn)) {
- xenXMError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return (NULL);
}
if (xml == NULL) {
- xenXMError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return (NULL);
}
if (conn->flags & VIR_CONNECT_RO)
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(entry->def->uuid, uuidstr);
- xenXMError(conn, VIR_ERR_OPERATION_FAILED,
+ xenXMError(VIR_ERR_OPERATION_FAILED,
_("domain '%s' is already defined with uuid %s"),
entry->def->name, uuidstr);
entry = NULL;
/* domain exists, we will overwrite it */
if (!(oldfilename = (char *)virHashLookup(priv->nameConfigMap, def->name))) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
"%s", _("can't retrieve config filename for domain to overwrite"));
goto error;
}
if (!(entry = virHashLookup(priv->configCache, oldfilename))) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
"%s", _("can't retrieve config entry for domain to overwrite"));
goto error;
}
/* Remove the name -> filename mapping */
if (virHashRemoveEntry(priv->nameConfigMap, def->name, NULL) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
"%s", _("failed to remove old domain from config map"));
goto error;
}
/* Remove the config record itself */
if (virHashRemoveEntry(priv->configCache, oldfilename, xenXMConfigFree) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
"%s", _("failed to remove old domain from config map"));
goto error;
}
}
if ((strlen(priv->configDir) + 1 + strlen(def->name) + 1) > PATH_MAX) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
"%s", _("config file name is too long"));
goto error;
}
}
if ((entry->refreshedAt = time(NULL)) == ((time_t)-1)) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to get current time"));
goto error;
}
entry->def = def;
if (virHashAddEntry(priv->configCache, filename, entry) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to store config file handle"));
goto error;
}
if (virHashAddEntry(priv->nameConfigMap, def->name, entry->filename) < 0) {
virHashRemoveEntry(priv->configCache, filename, NULL);
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ xenXMError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to store config file handle"));
goto error;
}
int ret = -1;
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
- xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
- __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return (-1);
}
int i, ret = -1;
if (!VIR_IS_CONNECT(conn)) {
- xenXMError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return (-1);
}
int ret = -1;
if (!VIR_IS_CONNECT(conn)) {
- xenXMError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_CONN, __FUNCTION__);
return (-1);
}
xenUnifiedPrivatePtr priv;
if ((!domain) || (!domain->conn) || (!domain->name) || (!xml)) {
- xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
- __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
}
default:
- xenXMError(domain->conn, VIR_ERR_XML_ERROR,
+ xenXMError(VIR_ERR_XML_ERROR,
"%s", _("unknown device"));
goto cleanup;
}
xenUnifiedPrivatePtr priv;
if ((!domain) || (!domain->conn) || (!domain->name) || (!xml)) {
- xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
- __FUNCTION__);
+ xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1;
}
break;
}
default:
- xenXMError(domain->conn, VIR_ERR_XML_ERROR,
+ xenXMError(VIR_ERR_XML_ERROR,
"%s", _("unknown device"));
goto cleanup;
}
}
int
-xenXMDomainBlockPeek (virDomainPtr dom,
+xenXMDomainBlockPeek (virDomainPtr dom ATTRIBUTE_UNUSED,
const char *path ATTRIBUTE_UNUSED,
unsigned long long offset ATTRIBUTE_UNUSED,
size_t size ATTRIBUTE_UNUSED,
void *buffer ATTRIBUTE_UNUSED)
{
- xenXMError (dom->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ xenXMError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}