summaryrefslogtreecommitdiff
path: root/src/import/qcow2-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/qcow2-util.c')
-rw-r--r--src/import/qcow2-util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/import/qcow2-util.c b/src/import/qcow2-util.c
index c84c6aa0d7..9b0c23bb14 100644
--- a/src/import/qcow2-util.c
+++ b/src/import/qcow2-util.c
@@ -24,6 +24,7 @@
#include "util.h"
#include "sparse-endian.h"
#include "qcow2-util.h"
+#include "btrfs-util.h"
#define QCOW2_MAGIC 0x514649fb
@@ -85,6 +86,11 @@ static int copy_cluster(
void *buffer) {
ssize_t l;
+ int r;
+
+ r = btrfs_clone_range(sfd, soffset, dfd, doffset, cluster_size);
+ if (r >= 0)
+ return r;
l = pread(sfd, buffer, cluster_size, soffset);
if (l < 0)