return 0;
}
+static void xc_clean_hcall_buf(void);
+
int xc_interface_close(xc_interface *xch)
{
int rc = 0;
rc = xc_interface_close_core(xch, xch->fd);
if (rc) PERROR("Could not close hypervisor interface");
}
+
+ xc_clean_hcall_buf();
+
free(xch);
return rc;
}
int hcall_buf_prep(void **addr, size_t len) { return 0; }
void hcall_buf_release(void **addr, size_t len) { }
+static void xc_clean_hcall_buf(void) { }
+
#else /* !__sun__ */
int lock_pages(void *addr, size_t len)
pthread_key_create(&hcall_buf_pkey, _xc_clean_hcall_buf);
}
+static void xc_clean_hcall_buf(void)
+{
+ pthread_once(&hcall_buf_pkey_once, _xc_init_hcall_buf);
+
+ _xc_clean_hcall_buf(pthread_getspecific(hcall_buf_pkey));
+}
+
int hcall_buf_prep(void **addr, size_t len)
{
struct hcall_buf *hcall_buf;