Skip to content

Commit

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

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-8-quintela@redhat.com>
  • Loading branch information
Juan Quintela committed Oct 17, 2023
1 parent e493008 commit 8b670f4
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
Original file line number Diff line number Diff line change
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 @@ -133,11 +132,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -4003,13 +4003,6 @@ int qemu_rdma_registration_stop(QEMUFile *f, uint64_t flags)
return -1;
}

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 @@ -4061,7 +4054,6 @@ static QEMUFile *rdma_new_input(RDMAContext *rdma)
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 All @@ -4073,7 +4065,6 @@ static QEMUFile *rdma_new_output(RDMAContext *rdma)
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);

return rioc->file;
}
Expand Down

0 comments on commit 8b670f4

Please sign in to comment.