[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC V5 62/62] qmp: Add block_resume_dedup.
From: |
Benoît Canet |
Subject: |
[Qemu-devel] [RFC V5 62/62] qmp: Add block_resume_dedup. |
Date: |
Wed, 16 Jan 2013 16:48:41 +0100 |
---
blockdev.c | 18 ++++++++++++++++++
qapi-schema.json | 18 ++++++++++++++++++
qmp-commands.hx | 23 +++++++++++++++++++++++
3 files changed, 59 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index 4c5f954..02b6535 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -914,6 +914,24 @@ void qmp_block_pause_dedup(const char *device, Error
**errp)
}
}
+void qmp_block_resume_dedup(const char *device, Error **errp)
+{
+ BlockDriverState *bs;
+ int err;
+
+ bs = bdrv_find(device);
+ if (!bs) {
+ error_set(errp, QERR_DEVICE_NOT_FOUND, device);
+ return;
+ }
+
+ err = bdrv_resume_dedup(bs);
+ if (err == -EINVAL) {
+ error_set(errp, QERR_DEVICE_NOT_DEDUPLICATED,
bdrv_get_device_name(bs));
+ return;
+ }
+}
+
static void qmp_bdrv_open_encrypted(BlockDriverState *bs, const char *filename,
int bdrv_flags, BlockDriver *drv,
const char *password, Error **errp)
diff --git a/qapi-schema.json b/qapi-schema.json
index d8c8348..607f24b 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -738,6 +738,24 @@
{ 'command': 'block-pause-dedup', 'data': {'device': 'str' } }
##
+# @block-resume-dedup:
+#
+# This command resume the deduplication on a device that support it.
+#
+# @device: the name of the device to resume the deduplication on
+#
+# Returns: nothing on success
+# If @device is not a valid block device, DeviceNotFound
+# If @device is not deduplicated, DeviceNotDeduplicated
+#
+# Notes: Not all block formats support deduplication one must use
+# query-blockstats before and look at the optional deduplication field.
+#
+# Since: 1.5
+##
+{ 'command': 'block-resume-dedup', 'data': {'device': 'str' } }
+
+##
# @BlockDeviceDedupInfo
#
# Statistics of the deduplication on a virtual block device implementing it
diff --git a/qmp-commands.hx b/qmp-commands.hx
index acc9fd0..d953847 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -1259,6 +1259,29 @@ Example:
EQMP
{
+ .name = "block-resume-dedup",
+ .args_type = "device:B",
+ .mhandler.cmd_new = qmp_marshal_input_block_resume_dedup,
+ },
+
+SQMP
+block-resume-dedup
+------------
+
+Resume the deduplication on a device that support it.
+
+Arguments:
+
+- "device": device name (json-string)
+
+Example:
+
+-> { "execute": "block-resume-dedup", "arguments": { "device": "ide0-hd0" } }
+<- { "return": {} }
+
+EQMP
+
+ {
.name = "block_set_io_throttle",
.args_type =
"device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
.mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
--
1.7.10.4
- [Qemu-devel] [RFC V5 31/62] qcow2: Use large L2 table for deduplication., (continued)
- [Qemu-devel] [RFC V5 31/62] qcow2: Use large L2 table for deduplication., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 32/62] qcow: Set large dedup hash block size., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 45/62] qcow2: Count deduplication refcount overflow metric., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 42/62] qcow2: Count QCowHashNode creation metrics., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 46/62] qapi: Add support for deduplication infos in qapi-schema.json., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 53/62] block: Add bdrv_has_dedup., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 52/62] qcow2: Add code to deduplicate cluster flagged with QCOW_OFLAG_TO_DEDUP., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 54/62] block: Add bdrv_is_dedup_running., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 55/62] block: Add bdrv_resume_dedup., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 61/62] qmp: Add block-pause-dedup., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 62/62] qmp: Add block_resume_dedup.,
Benoît Canet <=
- Re: [Qemu-devel] [RFC V5 00/62] QCOW2 deduplication, Eric Blake, 2013/01/16
- [Qemu-devel] [RFC V5 41/62] qcow2: Collect undeduplicated cluster metric., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 25/62] qcow2: Add verification of dedup table., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 39/62] qcow2: Collect unaligned writes missing data reads metric., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 59/62] qcow2: Make dedup status persists., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 21/62] qcow2: Remove hash when cluster is deleted., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 51/62] block: Add BlockDriver function prototype to pause and resume deduplication., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 37/62] qcow2: Add deduplication metrics structures., Benoît Canet, 2013/01/16
- [Qemu-devel] [RFC V5 24/62] qcow2: Serialize write requests when deduplication is activated., Benoît Canet, 2013/01/16