qemu: Clean up qemuDomainSecretPrepare

No need to pass a @driver parameter since all that's done is deref
the @cfg especially since the only caller can just pass an already
referenced @cfg.

Also, looks like commit id '0298531b' at one time had a different
name for the API, so I took the liberty of fixing the comments too
since I would already be updating them for the @cfg variable.
This commit is contained in:
John Ferlan 2017-08-30 15:40:58 -04:00
parent 13264dfd23
commit 23706c1708
3 changed files with 6 additions and 9 deletions

View File

@ -7494,7 +7494,7 @@ qemuDomainPrepareChannel(virDomainChrDefPtr channel,
}
/* qemuProcessPrepareDomainChardevSourceTLS:
/* qemuDomainPrepareChardevSourceTLS:
* @source: pointer to host interface data for char devices
* @cfg: driver configuration
*
@ -7518,19 +7518,18 @@ qemuDomainPrepareChardevSourceTLS(virDomainChrSourceDefPtr source,
}
/* qemuProcessPrepareDomainChardevSource:
/* qemuDomainPrepareChardevSource:
* @def: live domain definition
* @driver: qemu driver
* @cfg: driver configuration
*
* Iterate through all devices that use virDomainChrSourceDefPtr as host
* interface part.
*/
void
qemuDomainPrepareChardevSource(virDomainDefPtr def,
virQEMUDriverPtr driver)
virQEMUDriverConfigPtr cfg)
{
size_t i;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
for (i = 0; i < def->nserials; i++)
qemuDomainPrepareChardevSourceTLS(def->serials[i]->source, cfg);
@ -7555,8 +7554,6 @@ qemuDomainPrepareChardevSource(virDomainDefPtr def,
for (i = 0; i < def->nredirdevs; i++)
qemuDomainPrepareChardevSourceTLS(def->redirdevs[i]->source, cfg);
virObjectUnref(cfg);
}

View File

@ -861,7 +861,7 @@ void qemuDomainPrepareChardevSourceTLS(virDomainChrSourceDefPtr source,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void qemuDomainPrepareChardevSource(virDomainDefPtr def,
virQEMUDriverPtr driver)
virQEMUDriverConfigPtr cfg)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuDomainPrepareShmemChardev(virDomainShmemDefPtr shmem)

View File

@ -5323,7 +5323,7 @@ qemuProcessPrepareDomain(virConnectPtr conn,
goto cleanup;
VIR_DEBUG("Prepare chardev source backends for TLS");
qemuDomainPrepareChardevSource(vm->def, driver);
qemuDomainPrepareChardevSource(vm->def, cfg);
VIR_DEBUG("Add secrets to disks, hostdevs, and chardevs");
if (qemuDomainSecretPrepare(conn, driver, vm) < 0)