Eric Blake
fbaa6bb3d3
qcow2: Optimize write zero of unaligned tail cluster
...
We've already improved discards to operate efficiently on the tail
of an unaligned qcow2 image; it's time to make a similar improvement
to write zeroes. The special case is only valid at the tail
cluster of a file, where we must recognize that any sectors beyond
the image end would implicitly read as zero, and therefore should
not penalize our logic for widening a partial cluster into writing
the whole cluster as zero.
However, note that for now, the special case of end-of-file is only
recognized if there is no backing file, or if the backing file has
the same length; that's because when the backing file is shorter
than the active layer, we don't have code in place to recognize
that reads of a sector unallocated at the top and beyond the backing
end-of-file are implicitly zero. It's not much of a real loss,
because most people don't use images that aren't cluster-aligned,
or where the active layer is a different size than the backing
layer (especially where the difference falls within a single cluster).
Update test 154 to cover the new scenarios, using two images of
intentionally differing length.
While at it, fix the test to gracefully skip when run as
./check -qcow2 -o compat=0.10 154
since the older format lacks zero clusters already required earlier
in the test.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20170507000552.20847-11-eblake@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-05-11 14:28:07 +02:00
..
2016-03-14 16:46:42 +01:00
2017-02-12 00:47:42 +01:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-05-12 15:33:24 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-05-12 15:33:24 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2017-04-24 15:09:33 -04:00
2015-09-11 10:21:38 +03:00
2016-04-15 17:56:56 +02:00
2016-01-07 21:30:17 +01:00
2016-04-15 17:56:56 +02:00
2017-05-11 14:28:05 +02:00
2017-04-24 15:09:33 -04:00
2016-01-07 21:30:17 +01:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-05-12 15:33:24 +02:00
2016-04-15 17:56:56 +02:00
2016-01-07 21:30:17 +01:00
2017-03-13 12:49:33 +01:00
2017-04-27 15:46:16 +02:00
2017-04-27 15:46:16 +02:00
2017-04-27 15:46:16 +02:00
2016-04-15 17:56:56 +02:00
2017-04-24 15:09:33 -04:00
2017-04-27 15:39:49 +02:00
2017-04-24 15:09:33 -04:00
2017-05-11 11:08:40 +02:00
2016-10-31 16:52:39 +01:00
2016-04-15 17:56:56 +02:00
2016-01-20 13:36:23 +01:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:22:11 +02:00
2016-06-08 10:21:08 +02:00
2016-01-07 21:30:17 +01:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-03-17 15:47:56 +01:00
2016-04-15 17:56:56 +02:00
2016-01-07 21:30:17 +01:00
2016-04-15 17:56:56 +02:00
2016-01-07 21:30:17 +01:00
2016-04-15 17:56:56 +02:00
2016-05-12 15:33:24 +02:00
2015-11-11 16:25:47 +01:00
2015-11-11 16:25:47 +01:00
2017-04-07 14:44:06 +02:00
2017-04-07 14:44:06 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2015-12-18 14:36:17 +01:00
2017-05-11 11:08:40 +02:00
2015-09-11 10:21:38 +03:00
2016-04-15 17:56:56 +02:00
2016-05-12 15:33:24 +02:00
2016-05-12 15:33:24 +02:00
2016-04-15 17:56:56 +02:00
2017-02-28 20:40:31 +01:00
2016-04-15 17:56:56 +02:00
2016-01-07 21:30:17 +01:00
2017-04-27 15:39:49 +02:00
2017-04-27 15:39:49 +02:00
2017-04-27 15:39:49 +02:00
2016-05-12 15:33:24 +02:00
2016-05-12 15:33:24 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2017-05-11 11:08:40 +02:00
2016-09-05 19:06:48 +02:00
2015-12-03 11:08:07 +08:00
2015-12-03 11:08:07 +08:00
2016-09-05 19:06:47 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2017-02-12 00:47:42 +01:00
2016-04-15 17:56:56 +02:00
2017-05-11 14:28:07 +02:00
2016-04-15 17:56:56 +02:00
2016-05-12 15:33:24 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2017-05-11 12:08:24 +02:00
2017-05-11 12:08:24 +02:00
2016-10-24 17:54:03 +02:00
2016-09-23 13:45:36 +02:00
2017-04-27 15:39:49 +02:00
2017-04-27 15:39:49 +02:00
2016-04-15 17:56:56 +02:00
2016-01-13 15:16:18 +01:00
2016-04-15 17:56:56 +02:00
2017-02-12 00:47:42 +01:00
2016-10-24 17:54:03 +02:00
2017-01-09 13:30:52 +01:00
2016-04-15 17:56:56 +02:00
2017-04-24 15:09:33 -04:00
2015-09-11 10:21:38 +03:00
2016-04-15 17:56:56 +02:00
2017-02-12 00:47:42 +01:00
2016-04-15 17:56:56 +02:00
2017-02-12 00:47:42 +01:00
2016-06-07 14:40:51 +01:00
2016-06-07 14:40:51 +01:00
2016-04-15 17:56:56 +02:00
2017-02-12 00:47:42 +01:00
2016-04-15 17:56:56 +02:00
2015-09-11 10:21:38 +03:00
2016-04-15 17:56:56 +02:00
2017-02-12 00:47:42 +01:00
2016-10-24 17:54:03 +02:00
2016-03-14 17:35:06 +01:00
2016-04-15 17:56:56 +02:00
2015-09-11 10:21:38 +03:00
2016-05-12 15:33:23 +02:00
2017-02-12 00:47:42 +01:00
2016-04-15 17:56:56 +02:00
2017-05-11 11:08:40 +02:00
2017-05-11 11:08:40 +02:00
2016-04-15 17:56:56 +02:00
2017-05-11 11:08:40 +02:00
2016-10-07 19:22:11 +02:00
2016-04-15 17:56:56 +02:00
2017-02-12 00:47:42 +01:00
2016-04-15 17:56:56 +02:00
2016-07-18 18:19:01 -04:00
2016-04-15 17:56:56 +02:00
2017-05-11 11:08:40 +02:00
2016-04-15 17:56:56 +02:00
2017-02-12 00:47:42 +01:00
2016-10-24 17:54:03 +02:00
2016-10-24 17:54:03 +02:00
2017-04-24 15:09:33 -04:00
2016-06-16 15:20:37 +02:00
2016-01-07 21:30:17 +01:00
2016-05-19 16:45:31 +02:00
2015-10-16 15:34:29 +02:00
2017-04-03 17:11:40 +02:00
2017-04-03 17:11:40 +02:00
2016-04-15 17:56:56 +02:00
2015-09-11 10:21:38 +03:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2017-04-24 15:09:33 -04:00
2017-05-11 14:28:06 +02:00
2016-04-15 17:56:56 +02:00
2016-01-13 15:16:18 +01:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2017-04-27 16:01:11 +02:00
2017-04-27 16:01:11 +02:00
2016-04-15 17:56:56 +02:00
2015-12-18 14:36:17 +01:00
2016-04-15 17:56:56 +02:00
2016-04-15 17:56:56 +02:00
2015-12-18 14:34:43 +01:00
2016-04-15 17:56:56 +02:00
2017-04-24 15:09:33 -04:00
2016-01-13 15:16:18 +01:00
2016-04-15 17:56:56 +02:00
2015-09-11 10:21:38 +03:00
2016-04-15 17:56:56 +02:00
2017-02-12 00:47:42 +01:00
2017-04-24 15:09:33 -04:00
2016-02-02 17:50:46 +01:00
2016-10-24 17:54:03 +02:00
2015-11-11 16:25:47 +01:00
2016-04-15 17:56:56 +02:00
2015-06-12 15:54:08 +02:00
2016-04-15 17:56:56 +02:00
2015-06-12 15:54:08 +02:00
2016-04-15 17:56:56 +02:00
2015-09-11 10:21:38 +03:00
2016-04-15 17:56:56 +02:00
2017-05-11 14:28:07 +02:00
2016-04-15 17:56:56 +02:00
2016-11-14 22:47:34 -05:00
2016-11-14 22:47:34 -05:00
2016-04-15 17:56:56 +02:00
2017-04-24 15:09:33 -04:00
2017-04-27 15:39:49 +02:00
2016-04-15 17:56:56 +02:00
2017-02-12 00:47:42 +01:00
2015-07-02 10:06:23 +01:00
2015-07-02 10:06:23 +01:00
2016-04-15 17:56:56 +02:00
2015-12-18 14:34:43 +01:00
2017-04-24 15:09:33 -04:00
2016-03-30 12:12:15 +02:00
2016-04-15 17:56:56 +02:00
2015-07-27 17:19:07 +02:00
2016-05-19 16:56:58 +02:00
2016-05-19 16:45:31 +02:00
2017-02-24 16:09:22 +01:00
2016-05-12 15:33:24 +02:00
2016-04-15 17:56:56 +02:00
2015-09-14 16:51:37 +02:00
2017-03-28 15:23:23 +02:00
2016-09-23 13:45:36 +02:00
2017-04-24 15:09:33 -04:00
2017-02-12 00:47:42 +01:00
2017-04-24 15:09:33 -04:00
2017-02-28 20:47:46 +01:00
2017-04-27 15:39:49 +02:00
2017-04-27 15:39:49 +02:00
2017-04-24 15:09:33 -04:00
2016-02-16 17:16:11 +01:00
2016-02-02 18:07:27 +01:00
2016-07-18 18:19:01 -04:00
2017-04-27 15:39:49 +02:00
2017-04-27 15:39:49 +02:00
2016-03-14 16:46:42 +01:00
2017-05-11 14:28:06 +02:00
2017-04-03 17:11:39 +02:00
2016-10-27 19:05:23 +02:00
2016-04-12 18:07:39 +02:00
2016-03-17 16:43:30 +01:00
2016-07-04 10:46:59 +01:00
2016-07-04 10:46:59 +01:00
2016-04-15 17:56:56 +02:00
2016-04-12 18:06:51 +02:00
2016-04-20 16:52:55 +02:00
2016-04-20 16:52:55 +02:00
2017-05-11 11:15:32 +02:00
2017-05-11 11:15:32 +02:00
2017-05-11 14:28:07 +02:00
2017-05-11 14:28:07 +02:00
2016-10-24 17:54:03 +02:00
2016-06-16 15:20:37 +02:00
2017-04-24 15:09:33 -04:00
2016-06-16 15:20:37 +02:00
2016-07-13 13:41:39 +02:00
2016-07-13 13:41:39 +02:00
2017-04-24 15:09:33 -04:00
2016-09-23 13:36:09 +02:00
2016-09-20 22:10:57 +02:00
2016-09-20 22:10:57 +02:00
2016-09-20 22:10:57 +02:00
2016-09-20 22:10:57 +02:00
2016-11-11 15:56:22 +01:00
2016-10-24 17:54:03 +02:00
2016-09-20 22:10:57 +02:00
2016-09-20 22:10:57 +02:00
2016-10-31 16:52:39 +01:00
2016-10-31 16:52:39 +01:00
2017-05-11 11:08:40 +02:00
2017-05-11 11:08:40 +02:00
2017-02-12 00:47:42 +01:00
2017-02-12 00:47:42 +01:00
2017-02-12 00:47:42 +01:00
2017-02-12 00:47:42 +01:00
2017-02-24 16:09:22 +01:00
2017-02-24 16:09:22 +01:00
2017-04-03 17:11:40 +02:00
2017-04-03 17:11:40 +02:00
2017-05-11 14:28:06 +02:00
2017-05-11 14:28:06 +02:00
2017-05-11 14:28:07 +02:00
2017-05-11 14:28:07 +02:00
2017-04-27 15:39:49 +02:00
2017-04-27 15:39:49 +02:00
2017-05-11 12:08:20 +02:00
2017-05-11 12:08:20 +02:00
2017-02-12 00:47:42 +01:00
2017-04-28 18:40:41 +02:00
2017-04-27 15:39:50 +02:00
2017-05-11 14:28:07 +02:00
2017-05-11 14:28:05 +02:00
2017-04-27 15:39:49 +02:00
2017-04-27 15:39:50 +02:00
2017-05-11 14:28:07 +02:00
2017-04-07 14:44:06 +02:00
2017-02-12 00:47:42 +01:00
2016-02-08 17:29:54 +01:00
2016-06-16 15:19:55 +02:00
2016-10-27 19:05:23 +02:00