yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-block-add-BlockLimits-structure-to-BlockDriverState.patch.patch.patch

0a122b
From ef41c637feebd279b017838b46dc5cfdb52c1ef6 Mon Sep 17 00:00:00 2001
0a122b
Message-Id: <ef41c637feebd279b017838b46dc5cfdb52c1ef6.1389014116.git.minovotn@redhat.com>
0a122b
In-Reply-To: <c8cc35838d42aa286242772d97e3a9be7bb786ba.1389014116.git.minovotn@redhat.com>
0a122b
References: <c8cc35838d42aa286242772d97e3a9be7bb786ba.1389014116.git.minovotn@redhat.com>
0a122b
From: Paolo Bonzini <pbonzini@redhat.com>
0a122b
Date: Mon, 9 Dec 2013 14:09:00 +0100
0a122b
Subject: [PATCH 12/50] block: add BlockLimits structure to BlockDriverState
0a122b
0a122b
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
0a122b
Message-id: <1386598178-11845-15-git-send-email-pbonzini@redhat.com>
0a122b
Patchwork-id: 56049
0a122b
O-Subject: [RHEL 7.0 qemu-kvm PATCH 14/52] block: add BlockLimits structure to BlockDriverState
0a122b
Bugzilla: 1007815
0a122b
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
0a122b
RH-Acked-by: Fam Zheng <famz@redhat.com>
0a122b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
0a122b
From: Peter Lieven <pl@kamp.de>
0a122b
0a122b
this patch adds BlockLimits which introduces discard and write_zeroes
0a122b
limits and alignment information to the BlockDriverState.
0a122b
0a122b
Signed-off-by: Peter Lieven <pl@kamp.de>
0a122b
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
(cherry picked from commit fe81c2cca6dc69a5e423f6d8b235606b7f3ca7b7)
0a122b
---
0a122b
 include/block/block_int.h | 17 +++++++++++++++++
0a122b
 1 file changed, 17 insertions(+)
0a122b
0a122b
Signed-off-by: Michal Novotny <minovotn@redhat.com>
0a122b
---
0a122b
 include/block/block_int.h | 17 +++++++++++++++++
0a122b
 1 file changed, 17 insertions(+)
0a122b
0a122b
diff --git a/include/block/block_int.h b/include/block/block_int.h
0a122b
index 236c0c2..ab98c07 100644
0a122b
--- a/include/block/block_int.h
0a122b
+++ b/include/block/block_int.h
0a122b
@@ -219,6 +219,20 @@ struct BlockDriver {
0a122b
     QLIST_ENTRY(BlockDriver) list;
0a122b
 };
0a122b
 
0a122b
+typedef struct BlockLimits {
0a122b
+    /* maximum number of sectors that can be discarded at once */
0a122b
+    int max_discard;
0a122b
+
0a122b
+    /* optimal alignment for discard requests in sectors */
0a122b
+    int64_t discard_alignment;
0a122b
+
0a122b
+    /* maximum number of sectors that can zeroized at once */
0a122b
+    int max_write_zeroes;
0a122b
+
0a122b
+    /* optimal alignment for write zeroes requests in sectors */
0a122b
+    int64_t write_zeroes_alignment;
0a122b
+} BlockLimits;
0a122b
+
0a122b
 /*
0a122b
  * Note: the function bdrv_append() copies and swaps contents of
0a122b
  * BlockDriverStates, so if you add new fields to this struct, please
0a122b
@@ -273,6 +287,9 @@ struct BlockDriverState {
0a122b
     uint64_t total_time_ns[BDRV_MAX_IOTYPE];
0a122b
     uint64_t wr_highest_sector;
0a122b
 
0a122b
+    /* I/O Limits */
0a122b
+    BlockLimits bl;
0a122b
+
0a122b
     /* Whether the disk can expand beyond total_sectors */
0a122b
     int growable;
0a122b
 
0a122b
-- 
0a122b
1.7.11.7
0a122b