mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 13:58:34 +00:00
page-server: Clos last loc xfer on connection close
Currsntly this affects nothing, but xfer close should be called. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
10
page-xfer.c
10
page-xfer.c
@@ -50,6 +50,12 @@ static struct page_xfer_job cxfer = {
|
|||||||
.dst_id = ~0,
|
.dst_id = ~0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void page_server_close(void)
|
||||||
|
{
|
||||||
|
if (cxfer.dst_id != ~0)
|
||||||
|
cxfer.loc_xfer.close(&cxfer.loc_xfer);
|
||||||
|
}
|
||||||
|
|
||||||
static int page_server_open(struct page_server_iov *pi)
|
static int page_server_open(struct page_server_iov *pi)
|
||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
@@ -59,8 +65,7 @@ static int page_server_open(struct page_server_iov *pi)
|
|||||||
id = decode_pm_id(pi->dst_id);
|
id = decode_pm_id(pi->dst_id);
|
||||||
pr_info("Opening %d/%ld\n", type, id);
|
pr_info("Opening %d/%ld\n", type, id);
|
||||||
|
|
||||||
if (cxfer.dst_id != ~0)
|
page_server_close();
|
||||||
cxfer.loc_xfer.close(&cxfer.loc_xfer);
|
|
||||||
|
|
||||||
if (open_page_xfer(&cxfer.loc_xfer, type, id))
|
if (open_page_xfer(&cxfer.loc_xfer, type, id))
|
||||||
return -1;
|
return -1;
|
||||||
@@ -183,6 +188,7 @@ static int page_server_serve(int sk)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
page_server_close();
|
||||||
pr_info("Session over\n");
|
pr_info("Session over\n");
|
||||||
|
|
||||||
close(sk);
|
close(sk);
|
||||||
|
Reference in New Issue
Block a user