[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 12 of 13 v5] blktap3: Introduce tap-ctl-destroy



Signed-off-by: Thanos Makatos <thanos.makatos@xxxxxxxxxx>

---
Changed since v4:
  * Remove call to tap_ctl_destroy.

diff --git a/tools/blktap3/control/tap-ctl-destroy.c 
b/tools/blktap3/control/tap-ctl-destroy.c
new file mode 100644
--- /dev/null
+++ b/tools/blktap3/control/tap-ctl-destroy.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2012      Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <string.h>
+
+#include "tap-ctl.h"
+#include "blktap3.h"
+
+/* TODO Without VBD.detach, tap-ctl destroy is the same as tap-ctl close,
+ * merge them. */
+int
+tap_ctl_destroy(const int id, const char *params,
+        int force __attribute__((unused)), struct timeval *timeout)
+{
+    int err;
+
+    if (!params)
+        return -EINVAL;
+
+    err = tap_ctl_close(id, params, 0, timeout);
+    if (err) {
+        EPRINTF("failed to close tapdisk pid=%d, path=%s: %s\n", id, params,
+                strerror(-err));
+        return err;
+    }
+
+    return 0;
+}

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.