From nobody Mon Feb 9 08:34:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575469326; cv=none; d=zohomail.com; s=zohoarc; b=RpEfAa7mkX53K9//WmLvC9bLAJyBVU6tW9QI9wC9P4Qc0F7UfUHN27A9ipWMmBHg+PwWk8f5GxjMhp8HACfHaEETxNoOiQqLdADIqIcLB6MneVSSZA8aJiL514OYB3PDcvP/bi7KkgaSeNdVlyY0hKsHxLxdZYjPfn6/GuogN2A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575469326; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gYntaEa0Lft/sOsJHSD8a0CYX8+nRzy7DDyRoiMXd/s=; b=hRP5+y0W09+VayrTKOMIgTAxxyqKQfXqP8+OFctv7eqlb/U0Q+A90LNUnUfckT7CX+7vZ8kgmF9tUNxvAGaWL2qm2mXtPLT0y3MH4wN/qKQeOyRbEQl07erwwe4Yodk6otmeJ34Kc8yLeH6HJ1PKMG/tyz9ojp5Tzz1s3JewRNc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1575469326668159.00456109495622; Wed, 4 Dec 2019 06:22:06 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-153-BK-1H2jQOiW-UcqG_mPExA-1; Wed, 04 Dec 2019 09:22:01 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7B0E2801E7E; Wed, 4 Dec 2019 14:21:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4EE2E67E62; Wed, 4 Dec 2019 14:21:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 03D8A1803B48; Wed, 4 Dec 2019 14:21:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB4ELgr7008234 for ; Wed, 4 Dec 2019 09:21:42 -0500 Received: by smtp.corp.redhat.com (Postfix) id D740D608F7; Wed, 4 Dec 2019 14:21:42 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-55.ams2.redhat.com [10.36.112.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFED167E62; Wed, 4 Dec 2019 14:21:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575469324; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=gYntaEa0Lft/sOsJHSD8a0CYX8+nRzy7DDyRoiMXd/s=; b=EmNXn0hANZJ+qiZbYvE7Zl/Q6zbJGSIl2lOjfgYAF+FtQyUTkJXqM2TztFgazYnfHxpEfK 1yT8zw8ABQWOmXJLHqfT4cPdwpi1SoJboXLm5HBDMUx4afxFdal3hT5pSR5L21FiA98Vf8 EU2MqzcdGqkuJLQ8k6uSMcRUYLSgpuU= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 4 Dec 2019 14:21:00 +0000 Message-Id: <20191204142113.2961028-18-berrange@redhat.com> In-Reply-To: <20191204142113.2961028-1-berrange@redhat.com> References: <20191204142113.2961028-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 17/30] conf: drop virCapsPtr param from domain formatting APIs X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: BK-1H2jQOiW-UcqG_mPExA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) This parameter is now unused and can be removed entirely. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/bhyve/bhyve_driver.c | 16 ++-------------- src/conf/checkpoint_conf.c | 4 ++-- src/conf/domain_conf.c | 26 +++++++++++--------------- src/conf/domain_conf.h | 4 ---- src/conf/snapshot_conf.c | 6 +++--- src/esx/esx_driver.c | 4 ++-- src/hyperv/hyperv_driver.c | 2 +- src/libxl/libxl_domain.c | 12 ++++++------ src/libxl/libxl_driver.c | 8 ++++---- src/libxl/libxl_migration.c | 4 ++-- src/lxc/lxc_driver.c | 4 ++-- src/lxc/lxc_process.c | 12 ++++++------ src/openvz/openvz_driver.c | 4 ++-- src/phyp/phyp_driver.c | 2 +- src/qemu/qemu_domain.c | 2 +- src/security/security_apparmor.c | 2 +- src/test/test_driver.c | 6 +++--- src/vbox/vbox_common.c | 2 +- src/vmware/vmware_driver.c | 4 ++-- src/vz/vz_driver.c | 4 ++-- tests/bhyveargv2xmltest.c | 2 +- tests/lxcconf2xmltest.c | 2 +- tests/openvzutilstest.c | 2 +- tests/qemuhotplugtest.c | 6 +++--- tests/qemuxml2xmltest.c | 2 +- tests/testutils.c | 2 +- tests/vmx2xmltest.c | 2 +- tests/xlconfigtest.c | 2 +- tests/xmconfigtest.c | 2 +- 29 files changed, 65 insertions(+), 85 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 18b5d1e950..8432044b60 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -480,7 +480,6 @@ bhyveDomainGetXMLDesc(virDomainPtr domain, unsigned int= flags) { bhyveConnPtr privconn =3D domain->conn->privateData; virDomainObjPtr vm; - virCapsPtr caps =3D NULL; char *ret =3D NULL; =20 virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS, NULL); @@ -491,14 +490,9 @@ bhyveDomainGetXMLDesc(virDomainPtr domain, unsigned in= t flags) if (virDomainGetXMLDescEnsureACL(domain->conn, vm->def, flags) < 0) goto cleanup; =20 - caps =3D bhyveDriverGetCapabilities(privconn); - if (!caps) - goto cleanup; - - ret =3D virDomainDefFormat(vm->def, privconn->xmlopt, caps, + ret =3D virDomainDefFormat(vm->def, privconn->xmlopt, virDomainDefFormatConvertXMLFlags(flags)); =20 - virObjectUnref(caps); cleanup: virDomainObjEndAPI(&vm); return ret; @@ -1561,7 +1555,6 @@ bhyveConnectDomainXMLFromNative(virConnectPtr conn, char *xml =3D NULL; virDomainDefPtr def =3D NULL; bhyveConnPtr privconn =3D conn->privateData; - virCapsPtr capabilities =3D NULL; unsigned caps =3D bhyveDriverGetCaps(conn); =20 virCheckFlags(0, NULL); @@ -1569,10 +1562,6 @@ bhyveConnectDomainXMLFromNative(virConnectPtr conn, if (virConnectDomainXMLFromNativeEnsureACL(conn) < 0) return NULL; =20 - capabilities =3D bhyveDriverGetCapabilities(privconn); - if (!capabilities) - return NULL; - if (STRNEQ(nativeFormat, BHYVE_CONFIG_FORMAT_ARGV)) { virReportError(VIR_ERR_INVALID_ARG, _("unsupported config type %s"), nativeFormat); @@ -1583,10 +1572,9 @@ bhyveConnectDomainXMLFromNative(virConnectPtr conn, if (def =3D=3D NULL) goto cleanup; =20 - xml =3D virDomainDefFormat(def, privconn->xmlopt, capabilities, 0); + xml =3D virDomainDefFormat(def, privconn->xmlopt, 0); =20 cleanup: - virObjectUnref(capabilities); virDomainDefFree(def); return xml; } diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index cb2d83796c..37cc8e5e6c 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -446,7 +446,7 @@ virDomainCheckpointDiskDefFormat(virBufferPtr buf, static int virDomainCheckpointDefFormatInternal(virBufferPtr buf, virDomainCheckpointDefPtr def, - virCapsPtr caps, + virCapsPtr caps G_GNUC_UNUSED, virDomainXMLOptionPtr xmlopt, unsigned int flags) { @@ -490,7 +490,7 @@ virDomainCheckpointDefFormatInternal(virBufferPtr buf, =20 if (!(flags & VIR_DOMAIN_CHECKPOINT_FORMAT_NO_DOMAIN) && virDomainDefFormatInternal(def->parent.dom, xmlopt, - caps, buf, domainflags) < 0) + buf, domainflags) < 0) goto error; =20 virBufferAdjustIndent(buf, -2); diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7431aad0cf..44e56976d9 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23559,8 +23559,8 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr = src, error: virErrorPreserveLast(&err); =20 - strSrc =3D virDomainDefFormat(src, xmlopt, NULL, 0); - strDst =3D virDomainDefFormat(dst, xmlopt, NULL, 0); + strSrc =3D virDomainDefFormat(src, xmlopt, 0); + strDst =3D virDomainDefFormat(dst, xmlopt, 0); VIR_DEBUG("XMLs that failed stability check were: src=3D\"%s\", dst=3D= \"%s\"", NULLSTR(strSrc), NULLSTR(strDst)); =20 @@ -28247,11 +28247,10 @@ virDomainDefFormatFeatures(virBufferPtr buf, int virDomainDefFormatInternal(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt, - virCapsPtr caps, virBufferPtr buf, unsigned int flags) { - return virDomainDefFormatInternalSetRootName(def, xmlopt, caps, buf, + return virDomainDefFormatInternalSetRootName(def, xmlopt, buf, "domain", flags); } =20 @@ -28263,7 +28262,6 @@ virDomainDefFormatInternal(virDomainDefPtr def, int virDomainDefFormatInternalSetRootName(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt, - virCapsPtr caps G_GNUC_UNUSED, virBufferPtr buf, const char *rootname, unsigned int flags) @@ -28802,13 +28800,12 @@ unsigned int virDomainDefFormatConvertXMLFlags(un= signed int flags) char * virDomainDefFormat(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt, - virCapsPtr caps, unsigned int flags) { virBuffer buf =3D VIR_BUFFER_INITIALIZER; =20 virCheckFlags(VIR_DOMAIN_DEF_FORMAT_COMMON_FLAGS, NULL); - if (virDomainDefFormatInternal(def, xmlopt, caps, &buf, flags) < 0) + if (virDomainDefFormatInternal(def, xmlopt, &buf, flags) < 0) return NULL; =20 return virBufferContentAndReset(&buf); @@ -28818,7 +28815,6 @@ virDomainDefFormat(virDomainDefPtr def, char * virDomainObjFormat(virDomainObjPtr obj, virDomainXMLOptionPtr xmlopt, - virCapsPtr caps, unsigned int flags) { g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; @@ -28843,7 +28839,7 @@ virDomainObjFormat(virDomainObjPtr obj, xmlopt->privateData.format(&buf, obj) < 0) goto error; =20 - if (virDomainDefFormatInternal(obj->def, xmlopt, caps, &buf, flags) < = 0) + if (virDomainDefFormatInternal(obj->def, xmlopt, &buf, flags) < 0) goto error; =20 virBufferAdjustIndent(&buf, -2); @@ -29004,12 +29000,12 @@ virDomainDefSaveXML(virDomainDefPtr def, int virDomainDefSave(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt, - virCapsPtr caps, + virCapsPtr caps G_GNUC_UNUSED, const char *configDir) { g_autofree char *xml =3D NULL; =20 - if (!(xml =3D virDomainDefFormat(def, xmlopt, caps, VIR_DOMAIN_DEF_FOR= MAT_SECURE))) + if (!(xml =3D virDomainDefFormat(def, xmlopt, VIR_DOMAIN_DEF_FORMAT_SE= CURE))) return -1; =20 return virDomainDefSaveXML(def, configDir, xml); @@ -29018,7 +29014,7 @@ virDomainDefSave(virDomainDefPtr def, int virDomainObjSave(virDomainObjPtr obj, virDomainXMLOptionPtr xmlopt, - virCapsPtr caps, + virCapsPtr caps G_GNUC_UNUSED, const char *statusDir) { unsigned int flags =3D (VIR_DOMAIN_DEF_FORMAT_SECURE | @@ -29029,7 +29025,7 @@ virDomainObjSave(virDomainObjPtr obj, =20 g_autofree char *xml =3D NULL; =20 - if (!(xml =3D virDomainObjFormat(obj, xmlopt, caps, flags))) + if (!(xml =3D virDomainObjFormat(obj, xmlopt, flags))) return -1; =20 return virDomainDefSaveXML(obj->def, statusDir, xml); @@ -29319,7 +29315,7 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def, * snapshots). */ virDomainDefPtr virDomainDefCopy(virDomainDefPtr src, - virCapsPtr caps, + virCapsPtr caps G_GNUC_UNUSED, virDomainXMLOptionPtr xmlopt, void *parseOpaque, bool migratable) @@ -29333,7 +29329,7 @@ virDomainDefCopy(virDomainDefPtr src, format_flags |=3D VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_= FORMAT_MIGRATABLE; =20 /* Easiest to clone via a round-trip through XML. */ - if (!(xml =3D virDomainDefFormat(src, xmlopt, caps, format_flags))) + if (!(xml =3D virDomainDefFormat(src, xmlopt, format_flags))) return NULL; =20 return virDomainDefParseString(xml, caps, xmlopt, parseOpaque, parse_f= lags); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index bbe73f1182..b98fe5eba5 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3098,26 +3098,22 @@ unsigned int virDomainDefFormatConvertXMLFlags(unsi= gned int flags); =20 char *virDomainDefFormat(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt, - virCapsPtr caps, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); char *virDomainObjFormat(virDomainObjPtr obj, virDomainXMLOptionPtr xmlopt, - virCapsPtr caps, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int virDomainDefFormatInternal(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt, - virCapsPtr caps, virBufferPtr buf, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); int virDomainDefFormatInternalSetRootName(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt, - virCapsPtr caps, virBufferPtr buf, const char *rootname, unsigned int flags) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 0bf7d497e4..015d54a128 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -838,7 +838,7 @@ static int virDomainSnapshotDefFormatInternal(virBufferPtr buf, const char *uuidstr, virDomainSnapshotDefPtr def, - virCapsPtr caps, + virCapsPtr caps G_GNUC_UNUSED, virDomainXMLOptionPtr xmlopt, unsigned int flags) { @@ -892,7 +892,7 @@ virDomainSnapshotDefFormatInternal(virBufferPtr buf, =20 if (def->parent.dom) { if (virDomainDefFormatInternal(def->parent.dom, xmlopt, - caps, buf, domainflags) < 0) + buf, domainflags) < 0) goto error; } else if (uuidstr) { virBufferAddLit(buf, "\n"); @@ -904,7 +904,7 @@ virDomainSnapshotDefFormatInternal(virBufferPtr buf, =20 if (def->parent.inactiveDom) { if (virDomainDefFormatInternalSetRootName(def->parent.inactiveDom,= xmlopt, - caps, buf, "inactiveDoma= in", + buf, "inactiveDomain", domainflags) < 0) goto error; } diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 2db89c7986..8e3da589c9 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -2648,7 +2648,7 @@ esxDomainGetXMLDesc(virDomainPtr domain, unsigned int= flags) if (powerState !=3D esxVI_VirtualMachinePowerState_PoweredOff) def->id =3D id; =20 - xml =3D virDomainDefFormat(def, priv->xmlopt, priv->caps, + xml =3D virDomainDefFormat(def, priv->xmlopt, virDomainDefFormatConvertXMLFlags(flags)); } =20 @@ -2706,7 +2706,7 @@ esxConnectDomainXMLFromNative(virConnectPtr conn, con= st char *nativeFormat, def =3D virVMXParseConfig(&ctx, priv->xmlopt, priv->caps, nativeConfig= ); =20 if (def) - xml =3D virDomainDefFormat(def, priv->xmlopt, priv->caps, + xml =3D virDomainDefFormat(def, priv->xmlopt, VIR_DOMAIN_DEF_FORMAT_INACTIVE); =20 virDomainDefFree(def); diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index ff9370d728..c9d22ec7c4 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -887,7 +887,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned in= t flags) /* FIXME: devices section is totally missing */ =20 /* XXX xmlopts must be non-NULL */ - xml =3D virDomainDefFormat(def, NULL, NULL, + xml =3D virDomainDefFormat(def, NULL, virDomainDefFormatConvertXMLFlags(flags)); =20 cleanup: diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index dfc8d8b611..f4f1781bae 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -851,7 +851,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver, =20 /* now that we know it's stopped call the hook if present */ if (virHookPresent(VIR_HOOK_DRIVER_LIBXL)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, cfg->cap= s, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); =20 /* we can't stop the operation even if the script raised an error = */ ignore_value(virHookCall(VIR_HOOK_DRIVER_LIBXL, vm->def->name, @@ -920,7 +920,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver, =20 /* The "release" hook cleans up additional resources */ if (virHookPresent(VIR_HOOK_DRIVER_LIBXL)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, cfg->cap= s, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); =20 /* we can't stop the operation even if the script raised an error = */ ignore_value(virHookCall(VIR_HOOK_DRIVER_LIBXL, vm->def->name, @@ -1327,7 +1327,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver, =20 /* Run an early hook to set-up missing devices */ if (virHookPresent(VIR_HOOK_DRIVER_LIBXL)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, cfg->cap= s, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); int hookret; =20 hookret =3D virHookCall(VIR_HOOK_DRIVER_LIBXL, vm->def->name, @@ -1365,7 +1365,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver, =20 /* now that we know it is about to start call the hook if present */ if (virHookPresent(VIR_HOOK_DRIVER_LIBXL)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, cfg->cap= s, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); int hookret; =20 hookret =3D virHookCall(VIR_HOOK_DRIVER_LIBXL, vm->def->name, @@ -1450,7 +1450,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver, libxlDomainCreateChannelPTY(vm->def, cfg->ctx); #endif =20 - if ((dom_xml =3D virDomainDefFormat(vm->def, driver->xmlopt, cfg->caps= , 0)) =3D=3D NULL) + if ((dom_xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0)) =3D= =3D NULL) goto destroy_dom; =20 if (libxl_userdata_store(cfg->ctx, domid, "libvirt-xml", @@ -1478,7 +1478,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver, =20 /* finally we can call the 'started' hook script if any */ if (virHookPresent(VIR_HOOK_DRIVER_LIBXL)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, cfg->cap= s, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); int hookret; =20 hookret =3D virHookCall(VIR_HOOK_DRIVER_LIBXL, vm->def->name, diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index fac3c1db49..ed754452f0 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -459,7 +459,7 @@ libxlReconnectDomain(virDomainObjPtr vm, /* now that we know it's reconnected call the hook if present */ if (virHookPresent(VIR_HOOK_DRIVER_LIBXL) && STRNEQ("Domain-0", vm->def->name)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, cfg->cap= s, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); int hookret; =20 /* we can't stop the operation even if the script raised an error = */ @@ -1828,7 +1828,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, goto cleanup; } =20 - if ((xml =3D virDomainDefFormat(vm->def, driver->xmlopt, cfg->caps, 0)= ) =3D=3D NULL) + if ((xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0)) =3D=3D NU= LL) goto cleanup; xml_len =3D strlen(xml) + 1; =20 @@ -2652,7 +2652,7 @@ libxlDomainGetXMLDesc(virDomainPtr dom, unsigned int = flags) else def =3D vm->def; =20 - ret =3D virDomainDefFormat(def, driver->xmlopt, cfg->caps, + ret =3D virDomainDefFormat(def, driver->xmlopt, virDomainDefFormatConvertXMLFlags(flags)); =20 cleanup: @@ -2703,7 +2703,7 @@ libxlConnectDomainXMLFromNative(virConnectPtr conn, goto cleanup; } =20 - xml =3D virDomainDefFormat(def, driver->xmlopt, cfg->caps, VIR_DOMAIN_= DEF_FORMAT_INACTIVE); + xml =3D virDomainDefFormat(def, driver->xmlopt, VIR_DOMAIN_DEF_FORMAT_= INACTIVE); =20 cleanup: virDomainDefFree(def); diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index 25a58f8018..f9bd004b2e 100644 --- a/src/libxl/libxl_migration.c +++ b/src/libxl/libxl_migration.c @@ -420,7 +420,7 @@ libxlDomainMigrationSrcBegin(virConnectPtr conn, if (!libxlDomainMigrationIsAllowed(def)) goto endjob; =20 - xml =3D virDomainDefFormat(def, driver->xmlopt, cfg->caps, VIR_DOMAIN_= DEF_FORMAT_SECURE); + xml =3D virDomainDefFormat(def, driver->xmlopt, VIR_DOMAIN_DEF_FORMAT_= SECURE); /* Valid xml means success! EndJob in the confirm phase */ if (xml) goto cleanup; @@ -494,7 +494,7 @@ libxlDomainMigrationPrepareAny(virConnectPtr dconn, char *xml; int hookret; =20 - if (!(xml =3D virDomainDefFormat(*def, driver->xmlopt, cfg->caps, + if (!(xml =3D virDomainDefFormat(*def, driver->xmlopt, VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_MIGRATABLE))) return -1; diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index f28e20d756..4639e603e0 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -987,7 +987,7 @@ static char *lxcDomainGetXMLDesc(virDomainPtr dom, =20 ret =3D virDomainDefFormat((flags & VIR_DOMAIN_XML_INACTIVE) && vm->newDef ? vm->newDef : vm->def, - driver->xmlopt, driver->caps, + driver->xmlopt, virDomainDefFormatConvertXMLFlags(flags)); =20 cleanup: @@ -1019,7 +1019,7 @@ static char *lxcConnectDomainXMLFromNative(virConnect= Ptr conn, if (!(def =3D lxcParseConfigString(nativeConfig, caps, driver->xmlopt)= )) goto cleanup; =20 - xml =3D virDomainDefFormat(def, driver->xmlopt, caps, 0); + xml =3D virDomainDefFormat(def, driver->xmlopt, 0); =20 cleanup: virObjectUnref(caps); diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index c1b8b6aa09..cd8ee4975b 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -171,7 +171,7 @@ static void virLXCProcessCleanup(virLXCDriverPtr driver, =20 /* now that we know it's stopped call the hook if present */ if (virHookPresent(VIR_HOOK_DRIVER_LXC)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, driver->= caps, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); =20 /* we can't stop the operation even if the script raised an error = */ virHookCall(VIR_HOOK_DRIVER_LXC, vm->def->name, @@ -248,7 +248,7 @@ static void virLXCProcessCleanup(virLXCDriverPtr driver, =20 /* The "release" hook cleans up additional resources */ if (virHookPresent(VIR_HOOK_DRIVER_LXC)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, driver->= caps, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); =20 /* we can't stop the operation even if the script raised an error = */ virHookCall(VIR_HOOK_DRIVER_LXC, vm->def->name, @@ -1271,7 +1271,7 @@ int virLXCProcessStart(virConnectPtr conn, =20 /* Run an early hook to set-up missing devices */ if (virHookPresent(VIR_HOOK_DRIVER_LXC)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, driver->= caps, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); int hookret; =20 hookret =3D virHookCall(VIR_HOOK_DRIVER_LXC, vm->def->name, @@ -1379,7 +1379,7 @@ int virLXCProcessStart(virConnectPtr conn, =20 /* now that we know it is about to start call the hook if present */ if (virHookPresent(VIR_HOOK_DRIVER_LXC)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, driver->= caps, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); int hookret; =20 hookret =3D virHookCall(VIR_HOOK_DRIVER_LXC, vm->def->name, @@ -1521,7 +1521,7 @@ int virLXCProcessStart(virConnectPtr conn, =20 /* finally we can call the 'started' hook script if any */ if (virHookPresent(VIR_HOOK_DRIVER_LXC)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, driver->= caps, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); int hookret; =20 hookret =3D virHookCall(VIR_HOOK_DRIVER_LXC, vm->def->name, @@ -1701,7 +1701,7 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm, =20 /* now that we know it's reconnected call the hook if present */ if (virHookPresent(VIR_HOOK_DRIVER_LXC)) { - char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, driv= er->caps, 0); + char *xml =3D virDomainDefFormat(vm->def, driver->xmlopt, 0); int hookret; =20 /* we can't stop the operation even if the script raised an er= ror */ diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 9b93bc5ca0..33c28a2721 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -473,7 +473,7 @@ static char *openvzDomainGetXMLDesc(virDomainPtr dom, u= nsigned int flags) { if (!(vm =3D openvzDomObjFromDomain(driver, dom->uuid))) return NULL; =20 - ret =3D virDomainDefFormat(vm->def, driver->xmlopt, driver->caps, + ret =3D virDomainDefFormat(vm->def, driver->xmlopt, virDomainDefFormatConvertXMLFlags(flags)); =20 virDomainObjEndAPI(&vm); @@ -2067,7 +2067,7 @@ openvzDomainMigrateBegin3Params(virDomainPtr domain, goto cleanup; } =20 - xml =3D virDomainDefFormat(vm->def, driver->xmlopt, driver->caps, + xml =3D virDomainDefFormat(vm->def, driver->xmlopt, VIR_DOMAIN_DEF_FORMAT_SECURE); =20 cleanup: diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index b22063642e..a5cb1b91b3 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -3252,7 +3252,7 @@ phypDomainGetXMLDesc(virDomainPtr dom, unsigned int f= lags) if (virDomainDefSetVcpus(&def, vcpus) < 0) goto err; =20 - return virDomainDefFormat(&def, phyp_driver->xmlopt, phyp_driver->caps, + return virDomainDefFormat(&def, phyp_driver->xmlopt, virDomainDefFormatConvertXMLFlags(flags)); =20 err: diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 49b6008d5c..926ec80ec8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9219,7 +9219,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr drive= r, } =20 format: - ret =3D virDomainDefFormatInternal(def, driver->xmlopt, caps, buf, + ret =3D virDomainDefFormatInternal(def, driver->xmlopt, buf, virDomainDefFormatConvertXMLFlags(fla= gs)); =20 cleanup: diff --git a/src/security/security_apparmor.c b/src/security/security_appar= mor.c index 6da79203d7..21560b2330 100644 --- a/src/security/security_apparmor.c +++ b/src/security/security_apparmor.c @@ -168,7 +168,7 @@ load_profile(virSecurityManagerPtr mgr G_GNUC_UNUSED, char *xml =3D NULL; virCommandPtr cmd =3D NULL; =20 - xml =3D virDomainDefFormat(def, NULL, NULL, VIR_DOMAIN_DEF_FORMAT_SECU= RE); + xml =3D virDomainDefFormat(def, NULL, VIR_DOMAIN_DEF_FORMAT_SECURE); if (!xml) goto cleanup; =20 diff --git a/src/test/test_driver.c b/src/test/test_driver.c index f2700d90bc..630cfa1574 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2178,7 +2178,7 @@ testDomainSaveImageWrite(testDriverPtr driver, int fd =3D -1; g_autofree char *xml =3D NULL; =20 - xml =3D virDomainDefFormat(def, driver->xmlopt, driver->caps, + xml =3D virDomainDefFormat(def, driver->xmlopt, VIR_DOMAIN_DEF_FORMAT_SECURE); =20 if (xml =3D=3D NULL) { @@ -2468,7 +2468,7 @@ testDomainSaveImageGetXMLDesc(virConnectPtr conn, if ((fd =3D testDomainSaveImageOpen(privconn, path, &def)) < 0) goto cleanup; =20 - ret =3D virDomainDefFormat(def, privconn->xmlopt, privconn->caps, + ret =3D virDomainDefFormat(def, privconn->xmlopt, VIR_DOMAIN_DEF_FORMAT_SECURE); =20 cleanup: @@ -3180,7 +3180,7 @@ static char *testDomainGetXMLDesc(virDomainPtr domain= , unsigned int flags) def =3D (flags & VIR_DOMAIN_XML_INACTIVE) && privdom->newDef ? privdom->newDef : privdom->def; =20 - ret =3D virDomainDefFormat(def, privconn->xmlopt, privconn->caps, + ret =3D virDomainDefFormat(def, privconn->xmlopt, virDomainDefFormatConvertXMLFlags(flags)); =20 virDomainObjEndAPI(&privdom); diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 0d22c94e06..1feb76c0a5 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -4126,7 +4126,7 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, u= nsigned int flags) /* dump USB devices/filters if active */ vboxHostDeviceGetXMLDesc(data, def, machine); =20 - ret =3D virDomainDefFormat(def, data->xmlopt, data->caps, + ret =3D virDomainDefFormat(def, data->xmlopt, virDomainDefFormatConvertXMLFlags(flags)); =20 cleanup: diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index eb2fcd438b..b30c8847d3 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -940,7 +940,7 @@ vmwareDomainGetXMLDesc(virDomainPtr dom, unsigned int f= lags) if (!(vm =3D vmwareDomObjFromDomain(driver, dom->uuid))) return NULL; =20 - ret =3D virDomainDefFormat(vm->def, driver->xmlopt, driver->caps, + ret =3D virDomainDefFormat(vm->def, driver->xmlopt, virDomainDefFormatConvertXMLFlags(flags)); =20 virDomainObjEndAPI(&vm); @@ -973,7 +973,7 @@ vmwareConnectDomainXMLFromNative(virConnectPtr conn, co= nst char *nativeFormat, def =3D virVMXParseConfig(&ctx, driver->xmlopt, driver->caps, nativeCo= nfig); =20 if (def !=3D NULL) - xml =3D virDomainDefFormat(def, driver->xmlopt, driver->caps, + xml =3D virDomainDefFormat(def, driver->xmlopt, VIR_DOMAIN_DEF_FORMAT_INACTIVE); =20 virDomainDefFree(def); diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 35baab1b82..a76c56334d 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -733,7 +733,7 @@ vzDomainGetXMLDesc(virDomainPtr domain, unsigned int fl= ags) def =3D (flags & VIR_DOMAIN_XML_INACTIVE) && dom->newDef ? dom->newDef : dom->def; =20 - ret =3D virDomainDefFormat(def, driver->xmlopt, privconn->driver->caps= , flags); + ret =3D virDomainDefFormat(def, driver->xmlopt, flags); =20 cleanup: virDomainObjEndAPI(&dom); @@ -2877,7 +2877,7 @@ vzDomainMigrateBeginStep(virDomainObjPtr dom, | VZ_MIGRATION_COOKIE_DOMAIN_NAME) < 0) return NULL; =20 - return virDomainDefFormat(dom->def, driver->xmlopt, driver->caps, + return virDomainDefFormat(dom->def, driver->xmlopt, VIR_DOMAIN_XML_MIGRATABLE); } =20 diff --git a/tests/bhyveargv2xmltest.c b/tests/bhyveargv2xmltest.c index 5e39face33..735cc4b338 100644 --- a/tests/bhyveargv2xmltest.c +++ b/tests/bhyveargv2xmltest.c @@ -77,7 +77,7 @@ testCompareXMLToArgvFiles(const char *xmlfile, goto fail; } =20 - if (vmdef && !(actualxml =3D virDomainDefFormat(vmdef, driver.caps, 0)= )) + if (vmdef && !(actualxml =3D virDomainDefFormat(vmdef, driver.xmlopt, = 0))) goto fail; =20 if (vmdef && virTestCompareToFile(actualxml, xmlfile) < 0) diff --git a/tests/lxcconf2xmltest.c b/tests/lxcconf2xmltest.c index fffe9cbf1a..ba0c7a1a0c 100644 --- a/tests/lxcconf2xmltest.c +++ b/tests/lxcconf2xmltest.c @@ -41,7 +41,7 @@ testCompareXMLToConfigFiles(const char *xmlfile, if (testSanitizeDef(vmdef) < 0) goto fail; =20 - if (!(actualxml =3D virDomainDefFormat(vmdef, driver->xmlopt, driv= er->caps, 0))) + if (!(actualxml =3D virDomainDefFormat(vmdef, driver->xmlopt, 0))) goto fail; =20 if (virTestCompareToFile(actualxml, xmlfile) < 0) diff --git a/tests/openvzutilstest.c b/tests/openvzutilstest.c index 681f1a52a0..c395b9dc19 100644 --- a/tests/openvzutilstest.c +++ b/tests/openvzutilstest.c @@ -116,7 +116,7 @@ testReadNetworkConf(const void *data G_GNUC_UNUSED) goto cleanup; } =20 - actual =3D virDomainDefFormat(def, driver.xmlopt, driver.caps, VIR_DOM= AIN_DEF_FORMAT_INACTIVE); + actual =3D virDomainDefFormat(def, driver.xmlopt, VIR_DOMAIN_DEF_FORMA= T_INACTIVE); =20 if (actual =3D=3D NULL) { fprintf(stderr, "ERROR: %s\n", virGetLastErrorMessage()); diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 9fbc1e1a64..b1e53505be 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -200,7 +200,7 @@ testQemuHotplugCheckResult(virDomainObjPtr vm, char *actual; int ret; =20 - actual =3D virDomainDefFormat(vm->def, driver.xmlopt, driver.caps, + actual =3D virDomainDefFormat(vm->def, driver.xmlopt, VIR_DOMAIN_DEF_FORMAT_SECURE); if (!actual) return -1; @@ -466,7 +466,7 @@ testQemuHotplugCpuFinalize(struct testQemuHotplugCpuDat= a *data) char *configXML =3D NULL; =20 if (data->file_xml_res_live) { - if (!(activeXML =3D virDomainDefFormat(data->vm->def, driver.xmlop= t, driver.caps, + if (!(activeXML =3D virDomainDefFormat(data->vm->def, driver.xmlop= t, VIR_DOMAIN_DEF_FORMAT_SECURE)= )) goto cleanup; =20 @@ -475,7 +475,7 @@ testQemuHotplugCpuFinalize(struct testQemuHotplugCpuDat= a *data) } =20 if (data->file_xml_res_conf) { - if (!(configXML =3D virDomainDefFormat(data->vm->newDef, driver.xm= lopt, driver.caps, + if (!(configXML =3D virDomainDefFormat(data->vm->newDef, driver.xm= lopt, VIR_DOMAIN_DEF_FORMAT_SECURE | VIR_DOMAIN_DEF_FORMAT_INACTIV= E))) goto cleanup; diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index a8f7dd4e1b..f849869735 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -68,7 +68,7 @@ testCompareStatusXMLToXMLFiles(const void *opaque) goto cleanup; } =20 - if (!(actual =3D virDomainObjFormat(obj, driver.xmlopt, NULL, + if (!(actual =3D virDomainObjFormat(obj, driver.xmlopt, VIR_DOMAIN_DEF_FORMAT_SECURE | VIR_DOMAIN_DEF_FORMAT_STATUS | VIR_DOMAIN_DEF_FORMAT_ACTUAL_NET | diff --git a/tests/testutils.c b/tests/testutils.c index ffcb56ca86..94a0e9068f 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -1140,7 +1140,7 @@ testCompareDomXML2XMLFiles(virCapsPtr caps, virDomain= XMLOptionPtr xmlopt, goto out; } =20 - if (!(actual =3D virDomainDefFormat(def, xmlopt, caps, format_flags)))= { + if (!(actual =3D virDomainDefFormat(def, xmlopt, format_flags))) { result =3D TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_FORMAT; goto out; } diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index beb82cbd7c..8d7b8ba2a4 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -84,7 +84,7 @@ testCompareFiles(const char *vmx, const char *xml) goto cleanup; } =20 - if (!(formatted =3D virDomainDefFormat(def, xmlopt, caps, + if (!(formatted =3D virDomainDefFormat(def, xmlopt, VIR_DOMAIN_DEF_FORMAT_SECURE))) goto cleanup; =20 diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c index d077933ca9..cdc2c37ed3 100644 --- a/tests/xlconfigtest.c +++ b/tests/xlconfigtest.c @@ -146,7 +146,7 @@ testCompareFormatXML(const char *xlcfg, const char *xml= , bool replaceVars) if (!(def =3D xenParseXL(conf, cfg->caps, driver->xmlopt))) goto fail; =20 - if (!(gotxml =3D virDomainDefFormat(def, driver->xmlopt, cfg->caps, + if (!(gotxml =3D virDomainDefFormat(def, driver->xmlopt, VIR_DOMAIN_XML_INACTIVE | VIR_DOMAIN_XML_SECURE))) goto fail; diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index 6971ad76e2..f8652e228c 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -101,7 +101,7 @@ testCompareFormatXML(const char *xmcfg, const char *xml) if (!(def =3D xenParseXM(conf, cfg->caps, driver->xmlopt))) goto fail; =20 - if (!(gotxml =3D virDomainDefFormat(def, driver->xmlopt, cfg->caps, VI= R_DOMAIN_DEF_FORMAT_SECURE))) + if (!(gotxml =3D virDomainDefFormat(def, driver->xmlopt, VIR_DOMAIN_DE= F_FORMAT_SECURE))) goto fail; =20 if (virTestCompareToFile(gotxml, xml) < 0) --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list