mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 03:42:19 +00:00
qemu: Move qemuVirCommandGetFDSet
Move function closer to where it's used in qemuBuildTPMCommandLine Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
f677d10b23
commit
6d9dcc04d6
@ -153,32 +153,6 @@ VIR_ENUM_IMPL(qemuNumaPolicy, VIR_DOMAIN_NUMATUNE_MEM_LAST,
|
|||||||
"preferred",
|
"preferred",
|
||||||
"interleave");
|
"interleave");
|
||||||
|
|
||||||
/**
|
|
||||||
* qemuVirCommandGetFDSet:
|
|
||||||
* @cmd: the command to modify
|
|
||||||
* @fd: fd to reassign to the child
|
|
||||||
*
|
|
||||||
* Get the parameters for the QEMU -add-fd command line option
|
|
||||||
* for the given file descriptor. The file descriptor must previously
|
|
||||||
* have been 'transferred' in a virCommandPassFD() call.
|
|
||||||
* This function for example returns "set=10,fd=20".
|
|
||||||
*/
|
|
||||||
static char *
|
|
||||||
qemuVirCommandGetFDSet(virCommandPtr cmd, int fd)
|
|
||||||
{
|
|
||||||
char *result = NULL;
|
|
||||||
int idx = virCommandPassFDGetFDIndex(cmd, fd);
|
|
||||||
|
|
||||||
if (idx >= 0) {
|
|
||||||
ignore_value(virAsprintf(&result, "set=%d,fd=%d", idx, fd));
|
|
||||||
} else {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("file descriptor %d has not been transferred"), fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qemuVirCommandGetDevSet:
|
* qemuVirCommandGetDevSet:
|
||||||
* @cmd: the command to modify
|
* @cmd: the command to modify
|
||||||
@ -8935,6 +8909,33 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qemuVirCommandGetFDSet:
|
||||||
|
* @cmd: the command to modify
|
||||||
|
* @fd: fd to reassign to the child
|
||||||
|
*
|
||||||
|
* Get the parameters for the QEMU -add-fd command line option
|
||||||
|
* for the given file descriptor. The file descriptor must previously
|
||||||
|
* have been 'transferred' in a virCommandPassFD() call.
|
||||||
|
* This function for example returns "set=10,fd=20".
|
||||||
|
*/
|
||||||
|
static char *
|
||||||
|
qemuVirCommandGetFDSet(virCommandPtr cmd, int fd)
|
||||||
|
{
|
||||||
|
char *result = NULL;
|
||||||
|
int idx = virCommandPassFDGetFDIndex(cmd, fd);
|
||||||
|
|
||||||
|
if (idx >= 0) {
|
||||||
|
ignore_value(virAsprintf(&result, "set=%d,fd=%d", idx, fd));
|
||||||
|
} else {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("file descriptor %d has not been transferred"), fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
qemuBuildTPMBackendStr(const virDomainDef *def,
|
qemuBuildTPMBackendStr(const virDomainDef *def,
|
||||||
virCommandPtr cmd,
|
virCommandPtr cmd,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user