vchan: unify calls to xc_evtchn_close
Calls to this function can be the same on all systems and xen versions, so simplify code.
This commit is contained in:
parent
87115716ba
commit
a2a21c0467
20
vchan/init.c
20
vchan/init.c
@ -184,15 +184,7 @@ static int server_interface_init(struct libvchan *ctrl, int devno)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
fail2:
|
fail2:
|
||||||
if (ret)
|
if (ret)
|
||||||
#ifdef XENCTRL_HAS_XC_INTERFACE
|
|
||||||
xc_evtchn_close(evfd);
|
xc_evtchn_close(evfd);
|
||||||
#else
|
|
||||||
#ifdef WINNT
|
|
||||||
xc_evtchn_close(evfd);
|
|
||||||
#else
|
|
||||||
close(evfd);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
fail:
|
fail:
|
||||||
xs_daemon_close(xs);
|
xs_daemon_close(xs);
|
||||||
return ret;
|
return ret;
|
||||||
@ -268,11 +260,7 @@ int libvchan_server_handle_connected(struct libvchan *ctrl)
|
|||||||
#if 0
|
#if 0
|
||||||
fail2:
|
fail2:
|
||||||
if (ret)
|
if (ret)
|
||||||
#ifdef XENCTRL_HAS_XC_INTERFACE
|
|
||||||
xc_evtchn_close(ctrl->evfd);
|
xc_evtchn_close(ctrl->evfd);
|
||||||
#else
|
|
||||||
close(ctrl->evfd);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
xs_daemon_close(xs);
|
xs_daemon_close(xs);
|
||||||
return ret;
|
return ret;
|
||||||
@ -357,11 +345,7 @@ static int client_interface_init(struct libvchan *ctrl, int domain, int devno)
|
|||||||
ctrl->ring = (struct vchan_interface *)
|
ctrl->ring = (struct vchan_interface *)
|
||||||
xc_map_foreign_range(xcfd, domain, 4096,
|
xc_map_foreign_range(xcfd, domain, 4096,
|
||||||
PROT_READ | PROT_WRITE, ctrl->ring_ref);
|
PROT_READ | PROT_WRITE, ctrl->ring_ref);
|
||||||
#ifdef XENCTRL_HAS_XC_INTERFACE
|
|
||||||
xc_interface_close(xcfd);
|
xc_interface_close(xcfd);
|
||||||
#else
|
|
||||||
close(xcfd);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
xcg = xc_gnttab_open();
|
xcg = xc_gnttab_open();
|
||||||
@ -390,11 +374,7 @@ static int client_interface_init(struct libvchan *ctrl, int domain, int devno)
|
|||||||
ctrl->evport =
|
ctrl->evport =
|
||||||
xc_evtchn_bind_interdomain(evfd, domain, remote_port);
|
xc_evtchn_bind_interdomain(evfd, domain, remote_port);
|
||||||
if (ctrl->evport < 0 || xc_evtchn_notify(evfd, ctrl->evport))
|
if (ctrl->evport < 0 || xc_evtchn_notify(evfd, ctrl->evport))
|
||||||
#ifdef XENCTRL_HAS_XC_INTERFACE
|
|
||||||
xc_evtchn_close(evfd);
|
xc_evtchn_close(evfd);
|
||||||
#else
|
|
||||||
close(evfd);
|
|
||||||
#endif
|
|
||||||
else
|
else
|
||||||
ret = 0;
|
ret = 0;
|
||||||
fail:
|
fail:
|
||||||
|
Loading…
Reference in New Issue
Block a user