|
|
ae23c9 |
From 5ab34ef15de3097ec4bcdb7ed369b8810a4e2d90 Mon Sep 17 00:00:00 2001
|
|
|
ae23c9 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
ae23c9 |
Date: Thu, 6 Dec 2018 17:12:29 +0000
|
|
|
ae23c9 |
Subject: [PATCH 04/15] include: Add IEC binary prefixes in "qemu/units.h"
|
|
|
ae23c9 |
MIME-Version: 1.0
|
|
|
ae23c9 |
Content-Type: text/plain; charset=UTF-8
|
|
|
ae23c9 |
Content-Transfer-Encoding: 8bit
|
|
|
ae23c9 |
|
|
|
ae23c9 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
ae23c9 |
Message-id: <20181206171240.5674-5-kwolf@redhat.com>
|
|
|
ae23c9 |
Patchwork-id: 83287
|
|
|
ae23c9 |
O-Subject: [RHEL-8.0 qemu-kvm PATCH 04/15] include: Add IEC binary prefixes in "qemu/units.h"
|
|
|
ae23c9 |
Bugzilla: 1656507
|
|
|
ae23c9 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
ae23c9 |
RH-Acked-by: John Snow <jsnow@redhat.com>
|
|
|
ae23c9 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
ae23c9 |
|
|
|
ae23c9 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
|
ae23c9 |
|
|
|
ae23c9 |
Loosely based on 076b35b5a56.
|
|
|
ae23c9 |
|
|
|
ae23c9 |
Suggested-by: Stefan Weil <sw@weilnetz.de>
|
|
|
ae23c9 |
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
|
ae23c9 |
Message-Id: <20180625124238.25339-2-f4bug@amsat.org>
|
|
|
ae23c9 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
ae23c9 |
(cherry picked from commit 7ecdc94c40f4958a66893c0eac423c6a80f376d4)
|
|
|
ae23c9 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
ae23c9 |
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
|
ae23c9 |
---
|
|
|
ae23c9 |
include/qemu/units.h | 20 ++++++++++++++++++++
|
|
|
ae23c9 |
1 file changed, 20 insertions(+)
|
|
|
ae23c9 |
create mode 100644 include/qemu/units.h
|
|
|
ae23c9 |
|
|
|
ae23c9 |
diff --git a/include/qemu/units.h b/include/qemu/units.h
|
|
|
ae23c9 |
new file mode 100644
|
|
|
ae23c9 |
index 0000000..692db3f
|
|
|
ae23c9 |
--- /dev/null
|
|
|
ae23c9 |
+++ b/include/qemu/units.h
|
|
|
ae23c9 |
@@ -0,0 +1,20 @@
|
|
|
ae23c9 |
+/*
|
|
|
ae23c9 |
+ * IEC binary prefixes definitions
|
|
|
ae23c9 |
+ *
|
|
|
ae23c9 |
+ * Copyright (C) 2015 Nikunj A Dadhania, IBM Corporation
|
|
|
ae23c9 |
+ * Copyright (C) 2018 Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
|
ae23c9 |
+ *
|
|
|
ae23c9 |
+ * SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
ae23c9 |
+ */
|
|
|
ae23c9 |
+
|
|
|
ae23c9 |
+#ifndef QEMU_UNITS_H
|
|
|
ae23c9 |
+#define QEMU_UNITS_H
|
|
|
ae23c9 |
+
|
|
|
ae23c9 |
+#define KiB (INT64_C(1) << 10)
|
|
|
ae23c9 |
+#define MiB (INT64_C(1) << 20)
|
|
|
ae23c9 |
+#define GiB (INT64_C(1) << 30)
|
|
|
ae23c9 |
+#define TiB (INT64_C(1) << 40)
|
|
|
ae23c9 |
+#define PiB (INT64_C(1) << 50)
|
|
|
ae23c9 |
+#define EiB (INT64_C(1) << 60)
|
|
|
ae23c9 |
+
|
|
|
ae23c9 |
+#endif
|
|
|
ae23c9 |
--
|
|
|
ae23c9 |
1.8.3.1
|
|
|
ae23c9 |
|