The function is now unused. Remove it to dissuade anybody from trying to
use it in the future.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/conf/domain_conf.c | 121 ---------------------------------------
src/conf/domain_conf.h | 4 --
src/libvirt_private.syms | 1 -
3 files changed, 126 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3790121cf7..ce16cc414a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -28347,127 +28347,6 @@ virDomainNetFindByName(virDomainDef *def,
}
-/**
- * virDomainDeviceDefCopy:
- * @caps: Capabilities
- * @def: Domain definition to which @src belongs
- * @src: source to be copied
- *
- * virDomainDeviceDefCopy does a deep copy of only the parts of a
- * DeviceDef that are valid when just the flag VIR_DOMAIN_DEF_PARSE_INACTIVE is
- * set. This means that any part of the device xml that is conditionally
- * parsed/formatted based on some other flag being set (or on the INACTIVE
- * flag being reset) *will not* be copied to the destination. Caveat emptor.
- *
- * Returns a pointer to copied @src or NULL in case of error.
- */
-virDomainDeviceDef *
-virDomainDeviceDefCopy(virDomainDeviceDef *src,
- const virDomainDef *def,
- virDomainXMLOption *xmlopt,
- void *parseOpaque)
-{
- g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- int flags = VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_FORMAT_SECURE;
- int rc = -1;
- g_autofree char *xmlStr = NULL;
-
- switch ((virDomainDeviceType) src->type) {
- case VIR_DOMAIN_DEVICE_DISK:
- rc = virDomainDiskDefFormat(&buf, src->data.disk, flags, xmlopt);
- break;
- case VIR_DOMAIN_DEVICE_LEASE:
- virDomainLeaseDefFormat(&buf, src->data.lease);
- rc = 0;
- break;
- case VIR_DOMAIN_DEVICE_FS:
- rc = virDomainFSDefFormat(&buf, src->data.fs, flags);
- break;
- case VIR_DOMAIN_DEVICE_NET:
- rc = virDomainNetDefFormat(&buf,
src->data.net, xmlopt, flags);
- break;
- case VIR_DOMAIN_DEVICE_INPUT:
- rc = virDomainInputDefFormat(&buf, src->data.input, flags);
- break;
- case VIR_DOMAIN_DEVICE_SOUND:
- rc = virDomainSoundDefFormat(&buf, src->data.sound, flags);
- break;
- case VIR_DOMAIN_DEVICE_VIDEO:
- rc = virDomainVideoDefFormat(&buf, src->data.video, flags);
- break;
- case VIR_DOMAIN_DEVICE_HOSTDEV:
- rc = virDomainHostdevDefFormat(&buf, src->data.hostdev, flags, xmlopt);
- break;
- case VIR_DOMAIN_DEVICE_WATCHDOG:
- rc = virDomainWatchdogDefFormat(&buf, src->data.watchdog, flags);
- break;
- case VIR_DOMAIN_DEVICE_CONTROLLER:
- rc = virDomainControllerDefFormat(&buf, src->data.controller, flags);
- break;
- case VIR_DOMAIN_DEVICE_GRAPHICS:
- rc = virDomainGraphicsDefFormat(&buf, src->data.graphics, flags);
- break;
- case VIR_DOMAIN_DEVICE_HUB:
- rc = virDomainHubDefFormat(&buf, src->data.hub, flags);
- break;
- case VIR_DOMAIN_DEVICE_REDIRDEV:
- rc = virDomainRedirdevDefFormat(&buf, src->data.redirdev, flags);
- break;
- case VIR_DOMAIN_DEVICE_RNG:
- rc = virDomainRNGDefFormat(&buf, src->data.rng, flags);
- break;
- case VIR_DOMAIN_DEVICE_CHR:
- rc = virDomainChrDefFormat(&buf, src->data.chr, flags);
- break;
- case VIR_DOMAIN_DEVICE_TPM:
- virDomainTPMDefFormat(&buf, src->data.tpm, flags, xmlopt);
- rc = 0;
- break;
- case VIR_DOMAIN_DEVICE_PANIC:
- virDomainPanicDefFormat(&buf, src->data.panic);
- rc = 0;
- break;
- case VIR_DOMAIN_DEVICE_MEMORY:
- rc = virDomainMemoryDefFormat(&buf, src->data.memory, flags);
- break;
- case VIR_DOMAIN_DEVICE_SHMEM:
- virDomainShmemDefFormat(&buf, src->data.shmem, flags);
- rc = 0;
- break;
- case VIR_DOMAIN_DEVICE_IOMMU:
- virDomainIOMMUDefFormat(&buf, src->data.iommu);
- rc = 0;
- break;
- case VIR_DOMAIN_DEVICE_VSOCK:
- virDomainVsockDefFormat(&buf, src->data.vsock);
- rc = 0;
- break;
- case VIR_DOMAIN_DEVICE_AUDIO:
- rc = virDomainAudioDefFormat(&buf, src->data.audio);
- break;
-
- case VIR_DOMAIN_DEVICE_NONE:
- case VIR_DOMAIN_DEVICE_SMARTCARD:
- case VIR_DOMAIN_DEVICE_MEMBALLOON:
- case VIR_DOMAIN_DEVICE_NVRAM:
- case VIR_DOMAIN_DEVICE_LAST:
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Copying definition of '%d' type "
- "is not implemented yet."),
- src->type);
- return NULL;
- }
-
- if (rc < 0)
- return NULL;
-
- xmlStr = virBufferContentAndReset(&buf);
- return virDomainDeviceDefParse(xmlStr, def, xmlopt, parseOpaque,
- VIR_DOMAIN_DEF_PARSE_INACTIVE |
- VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
-}
-
-
virSecurityLabelDef *
virDomainDefGetSecurityLabelDef(const virDomainDef *def, const char *model)
{
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index a9f7e8d977..c19dfc5470 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3471,10 +3471,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainShmemDef,
virDomainShmemDefFree);
void virDomainDeviceDefFree(virDomainDeviceDef *def);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainDeviceDef, virDomainDeviceDefFree);
-virDomainDeviceDef *virDomainDeviceDefCopy(virDomainDeviceDef *src,
- const virDomainDef *def,
- virDomainXMLOption *xmlopt,
- void *parseOpaque);
virDomainDeviceInfo *virDomainDeviceGetInfo(const virDomainDeviceDef *device);
void virDomainDeviceSetData(virDomainDeviceDef *device,
void *devicedata);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index ebd7bc61a8..fd79a9d440 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -353,7 +353,6 @@ virDomainDefSetVcpusMax;
virDomainDefVcpuOrderClear;
virDomainDeleteConfig;
virDomainDeviceAliasIsUserAlias;
-virDomainDeviceDefCopy;
virDomainDeviceDefFree;
virDomainDeviceDefParse;
virDomainDeviceFindSCSIController;
--
2.37.3