qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/3] ide: Split error status from status registe


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 1/3] ide: Split error status from status register
Date: Thu, 09 Jun 2011 15:27:30 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 06/09/2011 03:15 PM, Kevin Wolf wrote:
+/* This function accesses bm->bus->error_status which is loaded only after
+ * BMDMA itself. This is why the function is called from ide_pci_post_load
+ * instead of being registered with VMState where it would run too early. */
+static int ide_bmdma_post_load(void *opaque, int version_id)
+{
+    BMDMAState *bm = opaque;
+    uint8_t abused_bits = BM_MIGRATION_COMPAT_STATUS_BITS;
+
+    if (bm->status == 0) {
+        bm->status = bm->migration_compat_status&  ~abused_bits;
+        bm->bus->error_status |= bm->migration_compat_status&  abused_bits;
+    }
+
+    return 0;
+}
+

Why the if?

Otherwise looks good.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]