Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_backup.c | 5 ++--
src/qemu/qemu_command.c | 39 +++++++++++---------------------
src/qemu/qemu_command.h | 10 +++-----
src/qemu/qemu_driver.c | 15 ++++--------
src/qemu/qemu_hotplug.c | 13 ++++-------
src/qemu/qemu_hotplug.h | 3 +--
src/qemu/qemu_migration_params.c | 2 +-
src/qemu/qemu_snapshot.c | 3 +--
8 files changed, 31 insertions(+), 59 deletions(-)
diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index d7583e7399..abbfcf3682 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -323,8 +323,7 @@ qemuBackupDiskPrepareDataOne(virDomainObj *vm,
/* use original disk as backing to prevent opening the backing chain */
if (!(dd->crdata =
qemuBuildStorageSourceChainAttachPrepareBlockdevTop(dd->store,
-
dd->backingStore,
-
priv->qemuCaps)))
+
dd->backingStore)))
return -1;
return 0;
@@ -728,7 +727,7 @@ qemuBackupBeginPrepareTLS(virDomainObj *vm,
if (qemuBuildTLSx509BackendProps(cfg->backupTLSx509certdir, true,
cfg->backupTLSx509verify, tlsObjAlias,
- tlsKeySecretAlias, priv->qemuCaps,
+ tlsKeySecretAlias,
tlsProps) < 0)
return -1;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 48f6ccbf50..a8d2b1ce74 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -754,7 +754,6 @@ qemuBuildObjectSecretCommandLine(virCommand *cmd,
* @verifypeer: boolean to enable peer verification (form of authorization)
* @alias: alias for the TLS credentials object
* @secalias: if one exists, the alias of the security object for passwordid
- * @qemuCaps: capabilities
* @propsret: json properties to return
*
* Create a backend string for the tls-creds-x509 object.
@@ -767,7 +766,6 @@ qemuBuildTLSx509BackendProps(const char *tlspath,
bool verifypeer,
const char *alias,
const char *secalias,
- virQEMUCaps *qemuCaps G_GNUC_UNUSED,
virJSONValue **propsret)
{
if (qemuMonitorCreateObjectProps(propsret, "tls-creds-x509", alias,
@@ -809,7 +807,7 @@ qemuBuildTLSx509CommandLine(virCommand *cmd,
g_autoptr(virJSONValue) props = NULL;
if (qemuBuildTLSx509BackendProps(tlspath, isListen, verifypeer, alias,
- certEncSecretAlias, qemuCaps, &props) < 0)
+ certEncSecretAlias, &props) < 0)
return -1;
if (qemuBuildObjectCommandlineFromJSON(&buf, props, qemuCaps) < 0)
@@ -1936,8 +1934,7 @@ qemuBuildDiskSourceCommandLine(virCommand *cmd,
if (virStorageSourceIsEmpty(disk->src))
return 0;
- if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->src,
- qemuCaps)))
+ if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->src)))
return -1;
if (disk->copy_on_read == VIR_TRISTATE_SWITCH_ON &&
@@ -5062,7 +5059,7 @@ qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef *hostdev,
}
if (src &&
- qemuBuildStorageSourceAttachPrepareCommon(src, ret, qemuCaps) < 0)
+ qemuBuildStorageSourceAttachPrepareCommon(src, ret) < 0)
return NULL;
return g_steal_pointer(&ret);
@@ -9962,8 +9959,7 @@ qemuBuildPflashBlockdevOne(virCommand *cmd,
g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
size_t i;
- if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(src,
- qemuCaps)))
+ if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(src)))
return -1;
for (i = data->nsrcdata; i > 0; i--) {
@@ -10840,15 +10836,13 @@ qemuBuildStorageSourceAttachPrepareChardev(virDomainDiskDef
*disk)
* qemuBuildStorageSourceAttachPrepareCommon:
* @src: storage source
* @data: already initialized data for disk source addition
- * @qemuCaps: qemu capabilities object
*
* Prepare data for configuration associated with the disk source such as
* secrets/TLS/pr objects etc ...
*/
int
qemuBuildStorageSourceAttachPrepareCommon(virStorageSource *src,
- qemuBlockStorageSourceAttachData *data,
- virQEMUCaps *qemuCaps)
+ qemuBlockStorageSourceAttachData *data)
{
qemuDomainStorageSourcePrivate *srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
const char *tlsKeySecretAlias = NULL;
@@ -10881,7 +10875,7 @@ qemuBuildStorageSourceAttachPrepareCommon(virStorageSource *src,
if (src->haveTLS == VIR_TRISTATE_BOOL_YES &&
qemuBuildTLSx509BackendProps(src->tlsCertdir, false, true, src->tlsAlias,
- tlsKeySecretAlias, qemuCaps, &data->tlsProps)
< 0)
+ tlsKeySecretAlias, &data->tlsProps) < 0)
return -1;
return 0;
@@ -10907,7 +10901,7 @@ qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDef
*disk,
if (!(elem = qemuBuildStorageSourceAttachPrepareDrive(disk, qemuCaps)))
return NULL;
- if (qemuBuildStorageSourceAttachPrepareCommon(disk->src, elem, qemuCaps) < 0)
+ if (qemuBuildStorageSourceAttachPrepareCommon(disk->src, elem) < 0)
return NULL;
VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, elem);
@@ -10943,15 +10937,14 @@ qemuBuildStorageSourceChainAttachPrepareChardev(virDomainDiskDef
*disk)
static int
qemuBuildStorageSourceChainAttachPrepareBlockdevOne(qemuBlockStorageSourceChainData
*data,
virStorageSource *src,
- virStorageSource *backingStore,
- virQEMUCaps *qemuCaps)
+ virStorageSource *backingStore)
{
g_autoptr(qemuBlockStorageSourceAttachData) elem = NULL;
if (!(elem = qemuBlockStorageSourceAttachPrepareBlockdev(src, backingStore, true)))
return -1;
- if (qemuBuildStorageSourceAttachPrepareCommon(src, elem, qemuCaps) < 0)
+ if (qemuBuildStorageSourceAttachPrepareCommon(src, elem) < 0)
return -1;
VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, elem);
@@ -10963,14 +10956,12 @@
qemuBuildStorageSourceChainAttachPrepareBlockdevOne(qemuBlockStorageSourceChainD
/**
* qemuBuildStorageSourceChainAttachPrepareBlockdev:
* @top: storage source chain
- * @qemuCaps: qemu capabilities object
*
* Prepares qemuBlockStorageSourceChainData *for attaching the chain of images
* starting at @top via -blockdev.
*/
qemuBlockStorageSourceChainData *
-qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSource *top,
- virQEMUCaps *qemuCaps)
+qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSource *top)
{
g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
virStorageSource *n;
@@ -10979,8 +10970,7 @@ qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSource
*top,
for (n = top; virStorageSourceIsBacking(n); n = n->backingStore) {
if (qemuBuildStorageSourceChainAttachPrepareBlockdevOne(data, n,
- n->backingStore,
- qemuCaps) < 0)
+ n->backingStore) <
0)
return NULL;
}
@@ -10992,22 +10982,19 @@
qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSource *top,
* qemuBuildStorageSourceChainAttachPrepareBlockdevTop:
* @top: storage source chain
* @backingStore: a storage source to use as backing of @top
- * @qemuCaps: qemu capabilities object
*
* Prepares qemuBlockStorageSourceChainData *for attaching of @top image only
* via -blockdev.
*/
qemuBlockStorageSourceChainData *
qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSource *top,
- virStorageSource *backingStore,
- virQEMUCaps *qemuCaps)
+ virStorageSource *backingStore)
{
g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
data = g_new0(qemuBlockStorageSourceChainData, 1);
- if (qemuBuildStorageSourceChainAttachPrepareBlockdevOne(data, top, backingStore,
- qemuCaps) < 0)
+ if (qemuBuildStorageSourceChainAttachPrepareBlockdevOne(data, top, backingStore) <
0)
return NULL;
return g_steal_pointer(&data);
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 188e63ea1f..a0e6af9d3f 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -77,7 +77,6 @@ int qemuBuildTLSx509BackendProps(const char *tlspath,
bool verifypeer,
const char *alias,
const char *secalias,
- virQEMUCaps *qemuCaps,
virJSONValue **propsret);
/* Open a UNIX socket for chardev FD passing */
@@ -121,8 +120,7 @@ qemuBuildStorageSourceAttachPrepareChardev(virDomainDiskDef *disk);
int
qemuBuildStorageSourceAttachPrepareCommon(virStorageSource *src,
- qemuBlockStorageSourceAttachData *data,
- virQEMUCaps *qemuCaps);
+ qemuBlockStorageSourceAttachData *data);
qemuBlockStorageSourceChainData *
@@ -135,13 +133,11 @@ qemuBuildStorageSourceChainAttachPrepareChardev(virDomainDiskDef
*disk);
qemuBlockStorageSourceChainData *
-qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSource *top,
- virQEMUCaps *qemuCaps);
+qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSource *top);
qemuBlockStorageSourceChainData *
qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSource *top,
- virStorageSource *backingStore,
- virQEMUCaps *qemuCaps);
+ virStorageSource *backingStore);
char
*qemuBuildDiskDeviceStr(const virDomainDef *def,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 28aa7351ee..4bd79b9537 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14076,8 +14076,7 @@ qemuDomainBlockPivot(virQEMUDriver *driver,
virQEMUCapsGet(priv->qemuCaps,
QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY) &&
virStorageSourceHasBacking(disk->mirror)) {
- if (!(chainattachdata =
qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->mirror->backingStore,
-
priv->qemuCaps)))
+ if (!(chainattachdata =
qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->mirror->backingStore)))
return -1;
reopenactions = virJSONValueNewArray();
@@ -14898,12 +14897,10 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
g_autoptr(virStorageSource) terminator = virStorageSourceNew();
if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror,
-
terminator,
-
priv->qemuCaps)))
+
terminator)))
goto endjob;
} else {
- if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror,
-
priv->qemuCaps)))
+ if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror)))
goto endjob;
}
} else {
@@ -14917,8 +14914,7 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
if (mirror_shallow) {
/* if external backing store is populated we'll need to open it */
if (virStorageSourceHasBacking(mirror)) {
- if (!(data =
qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror->backingStore,
-
priv->qemuCaps)))
+ if (!(data =
qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror->backingStore)))
goto endjob;
mirrorBacking = mirror->backingStore;
@@ -14932,8 +14928,7 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
}
if (!(crdata = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror,
-
mirrorBacking,
-
priv->qemuCaps)))
+
mirrorBacking)))
goto endjob;
}
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 9b0dcf2629..33d2dcc794 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -526,8 +526,7 @@ qemuDomainChangeMediaBlockdev(virQEMUDriver *driver,
return -1;
if (!virStorageSourceIsEmpty(newsrc)) {
- if (!(newbackend = qemuBuildStorageSourceChainAttachPrepareBlockdev(newsrc,
-
priv->qemuCaps)))
+ if (!(newbackend = qemuBuildStorageSourceChainAttachPrepareBlockdev(newsrc)))
return -1;
if (qemuDomainDiskGetBackendAlias(disk, priv->qemuCaps, &nodename) <
0)
@@ -734,8 +733,7 @@ qemuDomainAttachDiskGeneric(virQEMUDriver *driver,
if (!(data = qemuBuildStorageSourceChainAttachPrepareChardev(disk)))
return -1;
} else if (blockdev) {
- if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->src,
-
priv->qemuCaps)))
+ if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->src)))
return -1;
if (disk->copy_on_read == VIR_TRISTATE_SWITCH_ON) {
@@ -1831,8 +1829,7 @@ qemuDomainAddTLSObjects(virQEMUDriver *driver,
int
-qemuDomainGetTLSObjects(virQEMUCaps *qemuCaps,
- qemuDomainSecretInfo *secinfo,
+qemuDomainGetTLSObjects(qemuDomainSecretInfo *secinfo,
const char *tlsCertdir,
bool tlsListen,
bool tlsVerify,
@@ -1850,7 +1847,7 @@ qemuDomainGetTLSObjects(virQEMUCaps *qemuCaps,
}
if (qemuBuildTLSx509BackendProps(tlsCertdir, tlsListen, tlsVerify,
- alias, secAlias, qemuCaps, tlsProps) < 0)
+ alias, secAlias, tlsProps) < 0)
return -1;
return 0;
@@ -1895,7 +1892,7 @@ qemuDomainAddChardevTLSObjects(virQEMUDriver *driver,
if (!(*tlsAlias = qemuAliasTLSObjFromSrcAlias(charAlias)))
goto cleanup;
- if (qemuDomainGetTLSObjects(priv->qemuCaps, secinfo,
+ if (qemuDomainGetTLSObjects(secinfo,
cfg->chardevTLSx509certdir,
dev->data.tcp.listen,
cfg->chardevTLSx509verify,
diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h
index b5f7afb076..83bcaf980f 100644
--- a/src/qemu/qemu_hotplug.h
+++ b/src/qemu/qemu_hotplug.h
@@ -43,8 +43,7 @@ int qemuDomainAddTLSObjects(virQEMUDriver *driver,
virJSONValue **secProps,
virJSONValue **tlsProps);
-int qemuDomainGetTLSObjects(virQEMUCaps *qemuCaps,
- qemuDomainSecretInfo *secinfo,
+int qemuDomainGetTLSObjects(qemuDomainSecretInfo *secinfo,
const char *tlsCertdir,
bool tlsListen,
bool tlsVerify,
diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index 88dba3b999..b6c582aaca 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -961,7 +961,7 @@ qemuMigrationParamsEnableTLS(virQEMUDriver *driver,
if (!(*tlsAlias = qemuAliasTLSObjFromSrcAlias(QEMU_MIGRATION_TLS_ALIAS_BASE)))
return -1;
- if (qemuDomainGetTLSObjects(priv->qemuCaps, priv->migSecinfo,
+ if (qemuDomainGetTLSObjects(priv->migSecinfo,
cfg->migrateTLSx509certdir, tlsListen,
cfg->migrateTLSx509verify,
*tlsAlias, &tlsProps, &secProps) < 0)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index fa1f9ce973..d105eead27 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -1023,8 +1023,7 @@ qemuSnapshotDiskPrepareOneBlockdev(virQEMUDriver *driver,
return -1;
if (!(dd->crdata =
qemuBuildStorageSourceChainAttachPrepareBlockdevTop(dd->src,
- terminator,
-
priv->qemuCaps)))
+ terminator)))
return -1;
if (reuse) {
--
2.31.1