Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
qemu-file: Remove QEMUFileHooks
The only user was rdma, and its use is gone.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230509120700.78359-8-quintela@redhat.com>
  • Loading branch information
Juan Quintela committed May 30, 2023
1 parent af93423 commit 8df59e5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
6 changes: 0 additions & 6 deletions migration/qemu-file.c
Expand Up @@ -38,7 +38,6 @@
#define MAX_IOV_SIZE MIN_CONST(IOV_MAX, 64)

struct QEMUFile {
const QEMUFileHooks *hooks;
QIOChannel *ioc;
bool is_writable;

Expand Down Expand Up @@ -147,11 +146,6 @@ QEMUFile *qemu_file_new_input(QIOChannel *ioc)
return qemu_file_new_impl(ioc, false);
}

void qemu_file_set_hooks(QEMUFile *f, const QEMUFileHooks *hooks)
{
f->hooks = hooks;
}

/*
* Get last error for stream f with optional Error*
*
Expand Down
4 changes: 0 additions & 4 deletions migration/qemu-file.h
Expand Up @@ -36,12 +36,8 @@
#define RAM_CONTROL_ROUND 1
#define RAM_CONTROL_FINISH 3

typedef struct QEMUFileHooks {
} QEMUFileHooks;

QEMUFile *qemu_file_new_input(QIOChannel *ioc);
QEMUFile *qemu_file_new_output(QIOChannel *ioc);
void qemu_file_set_hooks(QEMUFile *f, const QEMUFileHooks *hooks);
int qemu_fclose(QEMUFile *f);

/*
Expand Down
9 changes: 0 additions & 9 deletions migration/rdma.c
Expand Up @@ -4010,13 +4010,6 @@ int qemu_rdma_registration_stop(QEMUFile *f, uint64_t flags)
return ret;
}

static const QEMUFileHooks rdma_read_hooks = {
};

static const QEMUFileHooks rdma_write_hooks = {
};


static void qio_channel_rdma_finalize(Object *obj)
{
QIOChannelRDMA *rioc = QIO_CHANNEL_RDMA(obj);
Expand Down Expand Up @@ -4075,12 +4068,10 @@ static QEMUFile *qemu_fopen_rdma(RDMAContext *rdma, const char *mode)
rioc->file = qemu_file_new_output(QIO_CHANNEL(rioc));
rioc->rdmaout = rdma;
rioc->rdmain = rdma->return_path;
qemu_file_set_hooks(rioc->file, &rdma_write_hooks);
} else {
rioc->file = qemu_file_new_input(QIO_CHANNEL(rioc));
rioc->rdmain = rdma;
rioc->rdmaout = rdma->return_path;
qemu_file_set_hooks(rioc->file, &rdma_read_hooks);
}

return rioc->file;
Expand Down

0 comments on commit 8df59e5

Please sign in to comment.