|
|
383d26 |
From 887a7e12d07315fe03f0b8efe7054d7c4f946bc2 Mon Sep 17 00:00:00 2001
|
|
|
383d26 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
383d26 |
Date: Wed, 7 Nov 2018 17:59:59 +0100
|
|
|
383d26 |
Subject: [PATCH 25/34] include: Add IEC binary prefixes in "qemu/units.h"
|
|
|
383d26 |
MIME-Version: 1.0
|
|
|
383d26 |
Content-Type: text/plain; charset=UTF-8
|
|
|
383d26 |
Content-Transfer-Encoding: 8bit
|
|
|
383d26 |
|
|
|
383d26 |
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
383d26 |
Message-id: <20181107180007.22954-2-pbonzini@redhat.com>
|
|
|
383d26 |
Patchwork-id: 82941
|
|
|
383d26 |
O-Subject: [RHEL7.6.z qemu-kvm-rhev PATCH 1/9] include: Add IEC binary prefixes in "qemu/units.h"
|
|
|
383d26 |
Bugzilla: 1566195
|
|
|
383d26 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
383d26 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
383d26 |
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
383d26 |
|
|
|
383d26 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
|
383d26 |
|
|
|
383d26 |
Loosely based on 076b35b5a56.
|
|
|
383d26 |
|
|
|
383d26 |
Suggested-by: Stefan Weil <sw@weilnetz.de>
|
|
|
383d26 |
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
|
383d26 |
Message-Id: <20180625124238.25339-2-f4bug@amsat.org>
|
|
|
383d26 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
383d26 |
(cherry picked from commit 7ecdc94c40f4958a66893c0eac423c6a80f376d4)
|
|
|
383d26 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
383d26 |
---
|
|
|
383d26 |
include/qemu/units.h | 20 ++++++++++++++++++++
|
|
|
383d26 |
1 file changed, 20 insertions(+)
|
|
|
383d26 |
create mode 100644 include/qemu/units.h
|
|
|
383d26 |
|
|
|
383d26 |
diff --git a/include/qemu/units.h b/include/qemu/units.h
|
|
|
383d26 |
new file mode 100644
|
|
|
383d26 |
index 0000000..692db3f
|
|
|
383d26 |
--- /dev/null
|
|
|
383d26 |
+++ b/include/qemu/units.h
|
|
|
383d26 |
@@ -0,0 +1,20 @@
|
|
|
383d26 |
+/*
|
|
|
383d26 |
+ * IEC binary prefixes definitions
|
|
|
383d26 |
+ *
|
|
|
383d26 |
+ * Copyright (C) 2015 Nikunj A Dadhania, IBM Corporation
|
|
|
383d26 |
+ * Copyright (C) 2018 Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
|
383d26 |
+ *
|
|
|
383d26 |
+ * SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
383d26 |
+ */
|
|
|
383d26 |
+
|
|
|
383d26 |
+#ifndef QEMU_UNITS_H
|
|
|
383d26 |
+#define QEMU_UNITS_H
|
|
|
383d26 |
+
|
|
|
383d26 |
+#define KiB (INT64_C(1) << 10)
|
|
|
383d26 |
+#define MiB (INT64_C(1) << 20)
|
|
|
383d26 |
+#define GiB (INT64_C(1) << 30)
|
|
|
383d26 |
+#define TiB (INT64_C(1) << 40)
|
|
|
383d26 |
+#define PiB (INT64_C(1) << 50)
|
|
|
383d26 |
+#define EiB (INT64_C(1) << 60)
|
|
|
383d26 |
+
|
|
|
383d26 |
+#endif
|
|
|
383d26 |
--
|
|
|
383d26 |
1.8.3.1
|
|
|
383d26 |
|