]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/ide/core.c: Prevent SIGSEGV during migration
authorDon Slutz <dslutz@verizon.com>
Mon, 17 Nov 2014 21:20:39 +0000 (16:20 -0500)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 7 Jan 2015 20:57:45 +0000 (14:57 -0600)
The other callers to blk_set_enable_write_cache() in this file
already check for s->blk == NULL.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1416259239-13281-1-git-send-email-dslutz@verizon.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 6b896ab261942f441a16836e3fa3c83f3f4488b9)

Conflicts:
hw/ide/core.c

*removed dependency on 4be746345

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ide/core.c

index 7256592ff6db237cb80c15e260cbf2d498f0a110..fa4cafa71cb2bc664dc5f7caf1ff3ef61f1ca403 100644 (file)
@@ -2299,7 +2299,7 @@ static int ide_drive_post_load(void *opaque, int version_id)
 {
     IDEState *s = opaque;
 
-    if (s->identify_set) {
+    if (s->bs && s->identify_set) {
         bdrv_set_enable_write_cache(s->bs, !!(s->identify_data[85] & (1 << 5)));
     }
     return 0;