12.08.2014 17:35, Roman Mamedov wrote:
> Package: qemu-kvm
> Version: 2.1+dfsg-2~bpo70+2
> Severity: normal
> 
> Hello,
> 
> I was able to successfully use the passthrough TRIM support with an IDE
> interface virtual disk in Qemu-KVM version 2.0.
> 
> However after upgrading to 2.1 and restarting my VM, TRIM now fails in it with
> messages like those quoted below (dmesg from the guest). There are no messages
> in dmesg related to that on the host.

Please try a test binary I just built for you, here:

 http://www.corpit.ru/mjt/tmp/qemu-system-x86_64-test-757927 .

It is signed with my usual debian gpg key, signature is here:

 http://www.corpit.ru/mjt/tmp/qemu-system-x86_64-test-757927.sig

It is just one binary, -- the one which gets installed as
/usr/bin/qemu-system-x86_64.  You may run it directly without
replacing your main binary.

It is the same as 2.1+dfsg-1~bpo70+2 but with a one-line patch
added:

diff --git a/hw/ide/core.c b/hw/ide/core.c
index db191a6..7256592 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -688,7 +688,8 @@ void ide_dma_cb(void *opaque, int ret)
            sector_num, n, s->dma_cmd);
 #endif

-    if (!ide_sect_range_ok(s, sector_num, n)) {
+    if ((s->dma_cmd == IDE_DMA_READ || s->dma_cmd == IDE_DMA_WRITE) &&
+        !ide_sect_range_ok(s, sector_num, n)) {
         dma_buf_commit(s);
         ide_dma_error(s);
         return;

The suspect is upstream commit 58ac3211 which introduced this very
check, which is okay for reads and writes but not for trim.

I can't easily verify this because I don't have a trim-capable
environment.

Thank you!

/mjt


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to