1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemuMonitorAddFileHandleToSet: Remove return of 'qemuMonitorAddFdInfo'

The only caller doesn't use the fdset info any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-05-05 17:06:10 +02:00
parent 1e925d1c17
commit c8f255c10e
5 changed files with 11 additions and 47 deletions

View File

@ -266,13 +266,10 @@ qemuFDPassTransferMonitor(qemuFDPass *fdpass,
for (i = 0; i < fdpass->nfds; i++) {
if (fdpass->useFDSet) {
qemuMonitorAddFdInfo fdsetinfo;
if (qemuMonitorAddFileHandleToSet(mon,
fdpass->fds[i].fd,
fdpass->fdSetID,
fdpass->fds[i].opaque,
&fdsetinfo) < 0)
fdpass->fds[i].opaque) < 0)
return -1;
} else {
if (qemuMonitorSendFileHandle(mon,

View File

@ -2506,7 +2506,6 @@ qemuMonitorGraphicsRelocate(qemuMonitor *mon,
* @fd: file descriptor to pass to qemu
* @fdset: the fdset to register this fd with, -1 to create a new fdset
* @opaque: opaque data to associated with this fd
* @info: structure that will be updated with the fd and fdset returned by qemu
*
* Attempts to register a file descriptor with qemu that can then be referenced
* via the file path /dev/fdset/$FDSETID
@ -2515,8 +2514,7 @@ int
qemuMonitorAddFileHandleToSet(qemuMonitor *mon,
int fd,
int fdset,
const char *opaque,
qemuMonitorAddFdInfo *info)
const char *opaque)
{
VIR_DEBUG("fd=%d,fdset=%i,opaque=%s", fd, fdset, opaque);
@ -2528,7 +2526,7 @@ qemuMonitorAddFileHandleToSet(qemuMonitor *mon,
return -1;
}
return qemuMonitorJSONAddFileHandleToSet(mon, fd, fdset, opaque, info);
return qemuMonitorJSONAddFileHandleToSet(mon, fd, fdset, opaque);
}

View File

@ -941,16 +941,11 @@ int qemuMonitorGraphicsRelocate(qemuMonitor *mon,
int tlsPort,
const char *tlsSubject);
typedef struct _qemuMonitorAddFdInfo qemuMonitorAddFdInfo;
struct _qemuMonitorAddFdInfo {
int fdset;
};
int
qemuMonitorAddFileHandleToSet(qemuMonitor *mon,
int fd,
int fdset,
const char *opaque,
qemuMonitorAddFdInfo *info);
const char *opaque);
int
qemuMonitorRemoveFdset(qemuMonitor *mon,

View File

@ -3594,34 +3594,11 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitor *mon,
}
static int
qemuAddfdInfoParse(virJSONValue *msg,
qemuMonitorAddFdInfo *fdinfo)
{
virJSONValue *returnObj;
if (!(returnObj = virJSONValueObjectGetObject(msg, "return"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid return data in add-fd response"));
return -1;
}
if (virJSONValueObjectGetNumberInt(returnObj, "fdset-id", &fdinfo->fdset) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or invalid fdset-id in add-fd response"));
return -1;
}
return 0;
}
/* if fdset is negative, qemu will create a new fdset and add the fd to that */
int qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon,
int fd,
int fdset,
const char *opaque,
qemuMonitorAddFdInfo *fdinfo)
int
qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon,
int fd,
int fdset,
const char *opaque)
{
g_autoptr(virJSONValue) args = NULL;
g_autoptr(virJSONValue) reply = NULL;
@ -3644,12 +3621,10 @@ int qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon,
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
return -1;
if (qemuAddfdInfoParse(reply, fdinfo) < 0)
return -1;
return 0;
}
static int
qemuMonitorJSONQueryFdsetsParse(virJSONValue *msg,
qemuMonitorFdsets **fdsets)

View File

@ -253,8 +253,7 @@ int
qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon,
int fd,
int fdset,
const char *opaque,
qemuMonitorAddFdInfo *info);
const char *opaque);
int
qemuMonitorJSONRemoveFdset(qemuMonitor *mon,