mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +00:00
qemu: pass virDomainObjPtr to qemuBuildCommandLine
Extract the required data inside a function instead of passing it all as arguments. Reviewed-by: John Ferlan <jferlan@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
8c85b1ed4a
commit
e54d4d5e98
@ -9972,26 +9972,28 @@ qemuBuildCommandLineValidate(virQEMUDriverPtr driver,
|
|||||||
virCommandPtr
|
virCommandPtr
|
||||||
qemuBuildCommandLine(virQEMUDriverPtr driver,
|
qemuBuildCommandLine(virQEMUDriverPtr driver,
|
||||||
virLogManagerPtr logManager,
|
virLogManagerPtr logManager,
|
||||||
virDomainDefPtr def,
|
virDomainObjPtr vm,
|
||||||
virDomainChrSourceDefPtr monitor_chr,
|
|
||||||
bool monitor_json,
|
|
||||||
virQEMUCapsPtr qemuCaps,
|
|
||||||
const char *migrateURI,
|
const char *migrateURI,
|
||||||
virDomainSnapshotObjPtr snapshot,
|
virDomainSnapshotObjPtr snapshot,
|
||||||
virNetDevVPortProfileOp vmop,
|
virNetDevVPortProfileOp vmop,
|
||||||
bool standalone,
|
bool standalone,
|
||||||
bool enableFips,
|
bool enableFips,
|
||||||
virBitmapPtr nodeset,
|
|
||||||
size_t *nnicindexes,
|
size_t *nnicindexes,
|
||||||
int **nicindexes,
|
int **nicindexes)
|
||||||
const char *domainLibDir,
|
|
||||||
bool chardevStdioLogd)
|
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
char uuid[VIR_UUID_STRING_BUFLEN];
|
char uuid[VIR_UUID_STRING_BUFLEN];
|
||||||
virCommandPtr cmd = NULL;
|
virCommandPtr cmd = NULL;
|
||||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||||
unsigned int bootHostdevNet = 0;
|
unsigned int bootHostdevNet = 0;
|
||||||
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
|
virDomainDefPtr def = vm->def;
|
||||||
|
virDomainChrSourceDefPtr monitor_chr = priv->monConfig;
|
||||||
|
bool monitor_json = priv->monJSON;
|
||||||
|
virQEMUCapsPtr qemuCaps = priv->qemuCaps;
|
||||||
|
virBitmapPtr nodeset = priv->autoNodeset;
|
||||||
|
const char *domainLibDir = priv->libDir;
|
||||||
|
bool chardevStdioLogd = priv->chardevStdioLogd;
|
||||||
|
|
||||||
VIR_DEBUG("driver=%p def=%p mon=%p json=%d "
|
VIR_DEBUG("driver=%p def=%p mon=%p json=%d "
|
||||||
"qemuCaps=%p migrateURI=%s snapshot=%p vmop=%d",
|
"qemuCaps=%p migrateURI=%s snapshot=%p vmop=%d",
|
||||||
|
@ -45,21 +45,14 @@ VIR_ENUM_DECL(qemuVideo)
|
|||||||
|
|
||||||
virCommandPtr qemuBuildCommandLine(virQEMUDriverPtr driver,
|
virCommandPtr qemuBuildCommandLine(virQEMUDriverPtr driver,
|
||||||
virLogManagerPtr logManager,
|
virLogManagerPtr logManager,
|
||||||
virDomainDefPtr def,
|
virDomainObjPtr vm,
|
||||||
virDomainChrSourceDefPtr monitor_chr,
|
|
||||||
bool monitor_json,
|
|
||||||
virQEMUCapsPtr qemuCaps,
|
|
||||||
const char *migrateURI,
|
const char *migrateURI,
|
||||||
virDomainSnapshotObjPtr snapshot,
|
virDomainSnapshotObjPtr snapshot,
|
||||||
virNetDevVPortProfileOp vmop,
|
virNetDevVPortProfileOp vmop,
|
||||||
bool standalone,
|
bool standalone,
|
||||||
bool enableFips,
|
bool enableFips,
|
||||||
virBitmapPtr nodeset,
|
|
||||||
size_t *nnicindexes,
|
size_t *nnicindexes,
|
||||||
int **nicindexes,
|
int **nicindexes);
|
||||||
const char *domainLibDir,
|
|
||||||
bool chardevStdioLogd)
|
|
||||||
ATTRIBUTE_NONNULL(15);
|
|
||||||
|
|
||||||
|
|
||||||
/* Generate the object properties for a secret */
|
/* Generate the object properties for a secret */
|
||||||
|
@ -5650,16 +5650,12 @@ qemuProcessLaunch(virConnectPtr conn,
|
|||||||
VIR_DEBUG("Building emulator command line");
|
VIR_DEBUG("Building emulator command line");
|
||||||
if (!(cmd = qemuBuildCommandLine(driver,
|
if (!(cmd = qemuBuildCommandLine(driver,
|
||||||
qemuDomainLogContextGetManager(logCtxt),
|
qemuDomainLogContextGetManager(logCtxt),
|
||||||
vm->def, priv->monConfig,
|
vm,
|
||||||
priv->monJSON, priv->qemuCaps,
|
|
||||||
incoming ? incoming->launchURI : NULL,
|
incoming ? incoming->launchURI : NULL,
|
||||||
snapshot, vmop,
|
snapshot, vmop,
|
||||||
false,
|
false,
|
||||||
qemuCheckFips(),
|
qemuCheckFips(),
|
||||||
priv->autoNodeset,
|
&nnicindexes, &nicindexes)))
|
||||||
&nnicindexes, &nicindexes,
|
|
||||||
priv->libDir,
|
|
||||||
priv->chardevStdioLogd)))
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (incoming && incoming->fd != -1)
|
if (incoming && incoming->fd != -1)
|
||||||
@ -6086,7 +6082,6 @@ qemuProcessCreatePretendCmd(virConnectPtr conn,
|
|||||||
bool standalone,
|
bool standalone,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
|
||||||
virCommandPtr cmd = NULL;
|
virCommandPtr cmd = NULL;
|
||||||
|
|
||||||
virCheckFlagsGoto(VIR_QEMU_PROCESS_START_COLD |
|
virCheckFlagsGoto(VIR_QEMU_PROCESS_START_COLD |
|
||||||
@ -6106,20 +6101,14 @@ qemuProcessCreatePretendCmd(virConnectPtr conn,
|
|||||||
VIR_DEBUG("Building emulator command line");
|
VIR_DEBUG("Building emulator command line");
|
||||||
cmd = qemuBuildCommandLine(driver,
|
cmd = qemuBuildCommandLine(driver,
|
||||||
NULL,
|
NULL,
|
||||||
vm->def,
|
vm,
|
||||||
priv->monConfig,
|
|
||||||
priv->monJSON,
|
|
||||||
priv->qemuCaps,
|
|
||||||
migrateURI,
|
migrateURI,
|
||||||
NULL,
|
NULL,
|
||||||
VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
|
VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
|
||||||
standalone,
|
standalone,
|
||||||
enableFips,
|
enableFips,
|
||||||
priv->autoNodeset,
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL);
|
||||||
priv->libDir,
|
|
||||||
priv->chardevStdioLogd);
|
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return cmd;
|
return cmd;
|
||||||
|
Loading…
Reference in New Issue
Block a user