[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v5 01/10] tests/perf: Test qemu-img convert from raw
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-block] [PATCH v5 01/10] tests/perf: Test qemu-img convert from raw to encrypted qcow2 |
Date: |
Tue, 2 Apr 2019 18:37:21 +0300 |
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
tests/perf/block/qcow2/convert-to-encrypted | 48 +++++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100755 tests/perf/block/qcow2/convert-to-encrypted
diff --git a/tests/perf/block/qcow2/convert-to-encrypted
b/tests/perf/block/qcow2/convert-to-encrypted
new file mode 100755
index 0000000000..7a6b7b1cab
--- /dev/null
+++ b/tests/perf/block/qcow2/convert-to-encrypted
@@ -0,0 +1,48 @@
+#!/bin/bash
+#
+# Test qemu-img convert from raw to encrypted qcow2
+#
+# Copyright (c) 2019 Virtuozzo International GmbH. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+if [ "$#" -lt 2 ]; then
+ echo "Usage: $0 SOURCE_FILE DESTINATION_FILE [additional qemu-img convert
parameters]"
+ exit 1
+fi
+
+ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../../.." >/dev/null 2>&1
&& pwd )"
+QEMU_IMG="$ROOT_DIR/qemu-img"
+QEMU_IO="$ROOT_DIR/qemu-io"
+
+size=1G
+
+src="$1"
+shift
+
+dst="$1"
+shift
+
+(
+# create source
+$QEMU_IMG create -f raw "$src" $size
+$QEMU_IO -f raw -c "write -P 0xa 0 $size" "$src"
+
+# create target
+$QEMU_IMG create -f qcow2 --object secret,id=sec0,data=test -o
encrypt.format=luks,encrypt.key-secret=sec0 "$dst" $size
+) > /dev/null
+
+# test with additional parameters left in $@
+/usr/bin/time -f %e $QEMU_IMG convert "$@" -f raw --object
secret,id=sec0,data=test --target-image-opts -n "$src"
"driver=qcow2,file.filename=$dst,encrypt.key-secret=sec0"
--
2.18.0
- [Qemu-block] [PATCH v5 04/10] qcow2-threads: use thread_pool_submit_co, (continued)
- [Qemu-block] [PATCH v5 09/10] qcow2: bdrv_co_pwritev: move encryption code out of the lock, Vladimir Sementsov-Ogievskiy, 2019/04/02
- [Qemu-block] [PATCH v5 06/10] qcow2-threads: split out generic path, Vladimir Sementsov-Ogievskiy, 2019/04/02
- [Qemu-block] [PATCH v5 02/10] qcow2.h: add missing include, Vladimir Sementsov-Ogievskiy, 2019/04/02
- [Qemu-block] [PATCH v5 03/10] qcow2: add separate file for threaded data processing functions, Vladimir Sementsov-Ogievskiy, 2019/04/02
- [Qemu-block] [PATCH v5 01/10] tests/perf: Test qemu-img convert from raw to encrypted qcow2,
Vladimir Sementsov-Ogievskiy <=
- [Qemu-block] [PATCH v5 10/10] qcow2: do encryption in threads, Vladimir Sementsov-Ogievskiy, 2019/04/02
- Re: [Qemu-block] [PATCH v5 00/10] qcow2: encryption threads, Vladimir Sementsov-Ogievskiy, 2019/04/16
- Re: [Qemu-block] [PATCH v5 00/10] qcow2: encryption threads, Max Reitz, 2019/04/28
- Re: [Qemu-block] [PATCH v5 00/10] qcow2: encryption threads, Max Reitz, 2019/04/29