Skip to content

Instantly share code, notes, and snippets.

View XanClic's full-sized avatar

Hanna Czenczek XanClic

View GitHub Profile
From 0d158423eb3a4713d9a3b3ec07869956d20da752 Mon Sep 17 00:00:00 2001
From: Jean-Louis Dupond <jean-louis@dupond.be>
Date: Mon, 15 May 2023 09:36:44 +0200
Subject: [PATCH] qcow2: add discard-no-unref option
When we for example have a sparse qcow2 image and discard: unmap is enabled,
there can be a lot of fragmentation in the image after some time. Surely on VM's
that do a lot of writes/deletes.
This causes the qcow2 image to grow even over 110% of its virtual size,
because the free gaps in the image get to small to allocate new
#!/usr/bin/ruby
require 'json'
CLUSTER_SIZE = 65536
map = JSON.parse(IO.read('map.txt')).select { |e| e['offset'] }.sort { |x, y| x['offset'] <=> y['offset'] }
ofs = 0
max_gap = 0
diff --git a/block/amend.c b/block/amend.c
index 329bca53dc..f696a006e3 100644
--- a/block/amend.c
+++ b/block/amend.c
@@ -62,20 +62,22 @@ static int blockdev_amend_pre_run(BlockdevAmendJob *s, Error **errp)
return 0;
}
-static void blockdev_amend_clean(Job *job)
+static void blockdev_amend_free(Job *job)
diff --git a/block/amend.c b/block/amend.c
index 329bca53dc..f696a006e3 100644
--- a/block/amend.c
+++ b/block/amend.c
@@ -62,20 +62,22 @@ static int blockdev_amend_pre_run(BlockdevAmendJob *s, Error **errp)
return 0;
}
-static void blockdev_amend_clean(Job *job)
+static void blockdev_amend_free(Job *job)
diff --git a/tests/qemu-iotests/296 b/tests/qemu-iotests/296
index 099a3eeaa5..b0582044f1 100755
--- a/tests/qemu-iotests/296
+++ b/tests/qemu-iotests/296
@@ -174,8 +174,9 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
}
result = vm.qmp('x-blockdev-amend', **args)
- assert result['return'] == {}
- vm.run_job('job0')
diff --git a/tests/qemu-iotests/296 b/tests/qemu-iotests/296
index 099a3eeaa5..b0582044f1 100755
--- a/tests/qemu-iotests/296
+++ b/tests/qemu-iotests/296
@@ -174,8 +174,9 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
}
result = vm.qmp('x-blockdev-amend', **args)
- assert result['return'] == {}
- vm.run_job('job0')
diff --git a/tests/qemu-iotests/296 b/tests/qemu-iotests/296
index 099a3eeaa5..62de87bace 100755
--- a/tests/qemu-iotests/296
+++ b/tests/qemu-iotests/296
@@ -160,7 +160,7 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
###########################################################################
# add a key to an encrypted block device
- def addKeyQmp(self, vm, id, new_secret):
+ def addKeyQmp(self, vm, id, new_secret, expect_success):
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index 68af96907e..d865459a2b 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -79,7 +79,11 @@ int qemu_gettimeofday(qemu_timeval *tp);
static inline int os_set_daemonize(bool d)
{
- return -ENOTSUP;
+ if (d) {
use std::ops::Deref;
struct T {
x: isize,
}
impl T {
fn from(x: isize) -> Self {
T { x }
}
0000000000000000 <matrix_mul>:
matrix_mul():
0: c4 e2 7d 19 1e vbroadcastsd ymm3,QWORD PTR [rsi]
5: c4 e2 7d 19 56 18 vbroadcastsd ymm2,QWORD PTR [rsi+0x18]
b: c5 e5 59 1f vmulpd ymm3,ymm3,YMMWORD PTR [rdi]
f: c4 e2 7d 19 4e 08 vbroadcastsd ymm1,QWORD PTR [rsi+0x8]
15: c4 e2 7d 19 46 10 vbroadcastsd ymm0,QWORD PTR [rsi+0x10]
1b: c4 e2 7d 19 66 38 vbroadcastsd ymm4,QWORD PTR [rsi+0x38]
21: c4 e2 7d 19 6e 40 vbroadcastsd ymm5,QWORD PTR [rsi+0x40]
27: c4 e2 7d 19 76 68 vbroadcastsd ymm6,QWORD PTR [rsi+0x68]