[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC for-3.0 4/4] block/qcow2-rust: Register block driver
From: |
Max Reitz |
Subject: |
[Qemu-devel] [RFC for-3.0 4/4] block/qcow2-rust: Register block driver |
Date: |
Tue, 18 Apr 2017 15:58:30 -0000 |
The rust qcow2 driver is now actually MUCH BETTER than the LEGACY
CROOKED qcow2 driver, so let's not beat around the bush and just
register it as a block driver. Has always been my opinion, never said
anything different. The QEMU project will deal with the C issue in a
decisive way. Q.M.U.
Signed-off-by: Max Reitz <address@hidden>
---
block/Makefile.objs | 1 +
block/qcow2-rust.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
create mode 100644 block/qcow2-rust.c
diff --git a/block/Makefile.objs b/block/Makefile.objs
index de96f8ee80..4802946e4e 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -24,6 +24,7 @@ block-obj-y += accounting.o dirty-bitmap.o
block-obj-y += write-threshold.o
block-obj-y += backup.o
block-obj-$(CONFIG_REPLICATION) += replication.o
+block-obj-y += qcow2-rust.o
block-obj-y += crypto.o
diff --git a/block/qcow2-rust.c b/block/qcow2-rust.c
new file mode 100644
index 0000000000..1465fa9fe1
--- /dev/null
+++ b/block/qcow2-rust.c
@@ -0,0 +1,38 @@
+/* C basis of the Rust qcow2 block driver
+ *
+ * Copyright (C) 2017 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "qemu/osdep.h"
+#include "block/block_int.h"
+#include "qapi/error.h"
+#include "qemu/option.h"
+
+
+/* This is just for the module loading system to detect this driver */
+static BlockDriver _ __attribute__((used)) = {
+ .format_name = "qcow2-rust",
+};
+
+
+extern void bdrv_qcow2_rust_init(void);
+
+block_init(bdrv_qcow2_rust_init);
--
2.12.2
- [Qemu-devel] [RFC for-3.0 0/4] block: Add qcow2-rust block driver, Max Reitz, 2017/04/18
- [Qemu-devel] [RFC for-3.0 2/4] block/qcow2-rust: Add qcow2-rust block driver, Max Reitz, 2017/04/18
- [Qemu-devel] [RFC for-3.0 1/4] block: Add Rust interface, Max Reitz, 2017/04/18
- [Qemu-devel] [RFC for-3.0 3/4] block/qcow2-rust: Add partial write support, Max Reitz, 2017/04/18
- [Qemu-devel] [RFC for-3.0 4/4] block/qcow2-rust: Register block driver,
Max Reitz <=
- Re: [Qemu-devel] [RFC for-3.0 0/4] block: Add qcow2-rust block driver, no-reply, 2017/04/18
- Re: [Qemu-devel] [RFC for-3.0 0/4] block: Add qcow2-rust block driver, no-reply, 2017/04/18
- Re: [Qemu-devel] [RFC for-3.0 0/4] block: Add qcow2-rust block driver, Marc-André Lureau, 2017/04/18
- Re: [Qemu-devel] [RFC for-3.0 0/4] block: Add qcow2-rust block driver, no-reply, 2017/04/18
- Re: [Qemu-devel] [Qemu-block] [RFC for-3.0 0/4] block: Add qcow2-rust block driver, Stefan Hajnoczi, 2017/04/21