diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4ab6a5a889..f9d7b130a9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -222,9 +222,9 @@ VIR_ENUM_IMPL(virDomainSeclabel, VIR_DOMAIN_SECLABEL_LAST,
"dynamic",
"static")
-#define virDomainReportError(conn, code, fmt...) \
- virReportErrorHelper(conn, VIR_FROM_DOMAIN, code, __FILE__, \
- __FUNCTION__, __LINE__, fmt)
+#define virDomainReportError(code, fmt...) \
+ virReportErrorHelper(NULL, VIR_FROM_DOMAIN, code, __FILE__, \
+ __FUNCTION__, __LINE__, fmt)
#ifndef PROXY
@@ -686,8 +686,7 @@ int virDomainObjUnref(virDomainObjPtr dom)
return dom->refs;
}
-static virDomainObjPtr virDomainObjNew(virConnectPtr conn,
- virCapsPtr caps)
+static virDomainObjPtr virDomainObjNew(virCapsPtr caps)
{
virDomainObjPtr domain;
@@ -705,7 +704,7 @@ static virDomainObjPtr virDomainObjNew(virConnectPtr conn,
domain->privateDataFreeFunc = caps->privateDataFreeFunc;
if (virMutexInit(&domain->lock) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot initialize mutex"));
if (domain->privateDataFreeFunc)
(domain->privateDataFreeFunc)(domain->privateData);
@@ -721,8 +720,7 @@ static virDomainObjPtr virDomainObjNew(virConnectPtr conn,
return domain;
}
-virDomainObjPtr virDomainAssignDef(virConnectPtr conn,
- virCapsPtr caps,
+virDomainObjPtr virDomainAssignDef(virCapsPtr caps,
virDomainObjListPtr doms,
const virDomainDefPtr def)
{
@@ -742,7 +740,7 @@ virDomainObjPtr virDomainAssignDef(virConnectPtr conn,
return domain;
}
- if (!(domain = virDomainObjNew(conn, caps)))
+ if (!(domain = virDomainObjNew(caps)))
return NULL;
domain->def = def;
@@ -910,7 +908,7 @@ static int virDomainDeviceInfoFormat(virBufferPtr buf,
int flags)
{
if (!info) {
- virDomainReportError(NULL, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing device information"));
return -1;
}
@@ -944,7 +942,7 @@ static int virDomainDeviceInfoFormat(virBufferPtr buf,
break;
default:
- virDomainReportError(NULL, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown address type '%d'"), info->type);
return -1;
}
@@ -983,8 +981,7 @@ int virDomainDeviceDriveAddressEqual(virDomainDeviceDriveAddressPtr a,
static int
-virDomainDevicePCIAddressParseXML(virConnectPtr conn,
- xmlNodePtr node,
+virDomainDevicePCIAddressParseXML(xmlNodePtr node,
virDomainDevicePCIAddressPtr addr)
{
char *domain, *slot, *bus, *function;
@@ -999,34 +996,34 @@ virDomainDevicePCIAddressParseXML(virConnectPtr conn,
if (domain &&
virStrToLong_ui(domain, NULL, 16, &addr->domain) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse
'domain' attribute"));
goto cleanup;
}
if (bus &&
virStrToLong_ui(bus, NULL, 16, &addr->bus) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse 'bus' attribute"));
goto cleanup;
}
if (slot &&
virStrToLong_ui(slot, NULL, 16, &addr->slot) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse 'slot' attribute"));
goto cleanup;
}
if (function &&
virStrToLong_ui(function, NULL, 16, &addr->function) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse 'function' attribute"));
goto cleanup;
}
if (!virDomainDevicePCIAddressIsValid(addr)) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Insufficient specification for PCI address"));
goto cleanup;
}
@@ -1043,8 +1040,7 @@ cleanup:
static int
-virDomainDeviceDriveAddressParseXML(virConnectPtr conn,
- xmlNodePtr node,
+virDomainDeviceDriveAddressParseXML(xmlNodePtr node,
virDomainDeviceDriveAddressPtr addr)
{
char *bus, *unit, *controller;
@@ -1058,27 +1054,27 @@ virDomainDeviceDriveAddressParseXML(virConnectPtr conn,
if (controller &&
virStrToLong_ui(controller, NULL, 10, &addr->controller) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse 'controller' attribute"));
goto cleanup;
}
if (bus &&
virStrToLong_ui(bus, NULL, 10, &addr->bus) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse 'bus' attribute"));
goto cleanup;
}
if (unit &&
virStrToLong_ui(unit, NULL, 10, &addr->unit) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse 'unit' attribute"));
goto cleanup;
}
if (!virDomainDeviceDriveAddressIsValid(addr)) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Insufficient specification for drive address"));
goto cleanup;
}
@@ -1096,8 +1092,7 @@ cleanup:
* @param node XML nodeset to parse for device address definition
*/
static int
-virDomainDeviceInfoParseXML(virConnectPtr conn,
- xmlNodePtr node,
+virDomainDeviceInfoParseXML(xmlNodePtr node,
virDomainDeviceInfoPtr info,
int flags)
{
@@ -1134,30 +1129,30 @@ virDomainDeviceInfoParseXML(virConnectPtr conn,
if (type) {
if ((info->type = virDomainDeviceAddressTypeFromString(type)) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown address type '%s'"), type);
goto cleanup;
}
} else {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("No type specified for device address"));
goto cleanup;
}
switch (info->type) {
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
- if (virDomainDevicePCIAddressParseXML(conn, address, &info->addr.pci) < 0)
+ if (virDomainDevicePCIAddressParseXML(address, &info->addr.pci) < 0)
goto cleanup;
break;
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE:
- if (virDomainDeviceDriveAddressParseXML(conn, address, &info->addr.drive) < 0)
+ if (virDomainDeviceDriveAddressParseXML(address, &info->addr.drive) < 0)
goto cleanup;
break;
default:
/* Should not happen */
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unknown device address type"));
goto cleanup;
}
@@ -1215,8 +1210,7 @@ virDomainDiskDefAssignAddress(virDomainDiskDefPtr def)
* @param node XML nodeset to parse for disk definition
*/
static virDomainDiskDefPtr
-virDomainDiskDefParseXML(virConnectPtr conn,
- xmlNodePtr node,
+virDomainDiskDefParseXML(xmlNodePtr node,
int flags) {
virDomainDiskDefPtr def;
xmlNodePtr cur;
@@ -1240,7 +1234,7 @@ virDomainDiskDefParseXML(virConnectPtr conn,
type = virXMLPropString(node, "type");
if (type) {
if ((def->type = virDomainDiskTypeFromString(type)) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown disk type '%s'"), type);
goto error;
}
@@ -1265,7 +1259,7 @@ virDomainDiskDefParseXML(virConnectPtr conn,
source = virXMLPropString(cur, "dir");
break;
default:
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected disk type %s"),
virDomainDiskTypeToString(def->type));
goto error;
@@ -1303,7 +1297,7 @@ virDomainDiskDefParseXML(virConnectPtr conn,
devaddr = virXMLPropString(cur, "devaddr");
} else if (encryption == NULL &&
xmlStrEqual(cur->name, BAD_CAST "encryption")) {
- encryption = virStorageEncryptionParseNode(conn, node->doc,
+ encryption = virStorageEncryptionParseNode(NULL, node->doc,
cur);
if (encryption == NULL)
goto error;
@@ -1318,7 +1312,7 @@ virDomainDiskDefParseXML(virConnectPtr conn,
device = virXMLPropString(node, "device");
if (device) {
if ((def->device = virDomainDiskDeviceTypeFromString(device)) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown disk device '%s'"), device);
goto error;
}
@@ -1331,20 +1325,20 @@ virDomainDiskDefParseXML(virConnectPtr conn,
if (source == NULL &&
def->device != VIR_DOMAIN_DISK_DEVICE_CDROM &&
def->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
- virDomainReportError(conn, VIR_ERR_NO_SOURCE,
+ virDomainReportError(VIR_ERR_NO_SOURCE,
target ? "%s" : NULL, target);
goto error;
}
if (target == NULL) {
- virDomainReportError(conn, VIR_ERR_NO_TARGET,
+ virDomainReportError(VIR_ERR_NO_TARGET,
source ? "%s" : NULL, source);
goto error;
}
if (def->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
!STRPREFIX(target, "fd")) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid floppy device name: %s"), target);
goto error;
}
@@ -1359,14 +1353,14 @@ virDomainDiskDefParseXML(virConnectPtr conn,
!STRPREFIX((const char *)target, "vd") &&
!STRPREFIX((const char *)target, "xvd") &&
!STRPREFIX((const char *)target, "ubd")) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid harddisk device name: %s"), target);
goto error;
}
if (bus) {
if ((def->bus = virDomainDiskBusTypeFromString(bus)) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown disk bus type '%s'"), bus);
goto error;
}
@@ -1391,20 +1385,20 @@ virDomainDiskDefParseXML(virConnectPtr conn,
if (def->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
def->bus != VIR_DOMAIN_DISK_BUS_FDC) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid bus type '%s' for floppy disk"), bus);
goto error;
}
if (def->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
def->bus == VIR_DOMAIN_DISK_BUS_FDC) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid bus type '%s' for disk"), bus);
goto error;
}
if (cachetag &&
(def->cachemode = virDomainDiskCacheTypeFromString(cachetag)) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown disk cache mode '%s'"), cachetag);
goto error;
}
@@ -1414,14 +1408,14 @@ virDomainDiskDefParseXML(virConnectPtr conn,
&def->info.addr.pci.domain,
&def->info.addr.pci.bus,
&def->info.addr.pci.slot) < 3) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse devaddr parameter '%s'"),
devaddr);
goto error;
}
def->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
} else {
- if (virDomainDeviceInfoParseXML(conn, node, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(node, &def->info, flags) < 0)
goto error;
}
@@ -1467,8 +1461,7 @@ cleanup:
* @param node XML nodeset to parse for controller definition
*/
static virDomainControllerDefPtr
-virDomainControllerDefParseXML(virConnectPtr conn,
- xmlNodePtr node,
+virDomainControllerDefParseXML(xmlNodePtr node,
int flags)
{
virDomainControllerDefPtr def;
@@ -1483,7 +1476,7 @@ virDomainControllerDefParseXML(virConnectPtr conn,
type = virXMLPropString(node, "type");
if (type) {
if ((def->type = virDomainDiskBusTypeFromString(type)) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown disk controller type '%s'"), type);
goto error;
}
@@ -1492,18 +1485,18 @@ virDomainControllerDefParseXML(virConnectPtr conn,
idx = virXMLPropString(node, "index");
if (idx) {
if (virStrToLong_i(idx, NULL, 10, &def->idx) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse disk controller index %s"), idx);
goto error;
}
}
- if (virDomainDeviceInfoParseXML(conn, node, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(node, &def->info, flags) < 0)
goto error;
if (def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Disk controllers must use the 'pci' address type"));
goto error;
}
@@ -1524,8 +1517,7 @@ cleanup:
* @param node XML nodeset to parse for disk definition
*/
static virDomainFSDefPtr
-virDomainFSDefParseXML(virConnectPtr conn,
- xmlNodePtr node,
+virDomainFSDefParseXML(xmlNodePtr node,
int flags) {
virDomainFSDefPtr def;
xmlNodePtr cur;
@@ -1541,7 +1533,7 @@ virDomainFSDefParseXML(virConnectPtr conn,
type = virXMLPropString(node, "type");
if (type) {
if ((def->type = virDomainFSTypeFromString(type)) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown filesystem type '%s'"), type);
goto error;
}
@@ -1574,13 +1566,13 @@ virDomainFSDefParseXML(virConnectPtr conn,
}
if (source == NULL) {
- virDomainReportError(conn, VIR_ERR_NO_SOURCE,
+ virDomainReportError(VIR_ERR_NO_SOURCE,
target ? "%s" : NULL, target);
goto error;
}
if (target == NULL) {
- virDomainReportError(conn, VIR_ERR_NO_TARGET,
+ virDomainReportError(VIR_ERR_NO_TARGET,
source ? "%s" : NULL, source);
goto error;
}
@@ -1590,7 +1582,7 @@ virDomainFSDefParseXML(virConnectPtr conn,
def->dst = target;
target = NULL;
- if (virDomainDeviceInfoParseXML(conn, node, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(node, &def->info, flags) < 0)
goto error;
cleanup:
@@ -1613,8 +1605,7 @@ cleanup:
* @return 0 on success, -1 on failure
*/
static virDomainNetDefPtr
-virDomainNetDefParseXML(virConnectPtr conn,
- virCapsPtr caps,
+virDomainNetDefParseXML(virCapsPtr caps,
xmlNodePtr node,
int flags ATTRIBUTE_UNUSED) {
virDomainNetDefPtr def;
@@ -1640,7 +1631,7 @@ virDomainNetDefParseXML(virConnectPtr conn,
type = virXMLPropString(node, "type");
if (type != NULL) {
if ((def->type = virDomainNetTypeFromString(type)) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown interface type '%s'"), type);
goto error;
}
@@ -1708,7 +1699,7 @@ virDomainNetDefParseXML(virConnectPtr conn,
if (macaddr) {
if (virParseMacAddr((const char *)macaddr, def->mac) < 0) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to parse mac address '%s'"),
(const char *)macaddr);
goto error;
@@ -1722,14 +1713,14 @@ virDomainNetDefParseXML(virConnectPtr conn,
&def->info.addr.pci.domain,
&def->info.addr.pci.bus,
&def->info.addr.pci.slot) < 3) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse devaddr parameter '%s'"),
devaddr);
goto error;
}
def->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
} else {
- if (virDomainDeviceInfoParseXML(conn, node, &def->info, flags) < 0)
+ if (virDomainDeviceInfoParseXML(node, &def->info, flags) < 0)
goto error;
}
@@ -1737,7 +1728,7 @@ virDomainNetDefParseXML(virConnectPtr conn,
* them we should make sure address type is correct */
if (def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Network interfaces must use 'pci' address type"));
goto error;
}
@@ -1745,7 +1736,7 @@ virDomainNetDefParseXML(virConnectPtr conn,
switch (def->type) {
case VIR_DOMAIN_NET_TYPE_NETWORK:
if (network == NULL) {
- virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("No