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