mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
socket shutdown
Add QEMUFile interface to allow a socket to be 'shut down' - i.e. any reads/writes will fail (and any blocking read/write will be woken). Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
This commit is contained in:
parent
8580b06498
commit
e1a8c9b67f
4 changed files with 48 additions and 4 deletions
|
@ -30,6 +30,18 @@
|
|||
#include "migration/qemu-file-internal.h"
|
||||
#include "trace.h"
|
||||
|
||||
/*
|
||||
* Stop a file from being read/written - not all backing files can do this
|
||||
* typically only sockets can.
|
||||
*/
|
||||
int qemu_file_shutdown(QEMUFile *f)
|
||||
{
|
||||
if (!f->ops->shut_down) {
|
||||
return -ENOSYS;
|
||||
}
|
||||
return f->ops->shut_down(f->opaque, true, true);
|
||||
}
|
||||
|
||||
bool qemu_file_mode_is_not_valid(const char *mode)
|
||||
{
|
||||
if (mode == NULL ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue