Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 340e01248478ba8b78a6d4d1809b1eff > files > 214

kvm-83-270.el5_11.src.rpm

From 45352d34884276d46e556ad10fc55f474899bde5 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Tue, 21 Jun 2011 11:33:34 -0300
Subject: [PATCH] Revert "floppy: save and restore DIR register"

RH-Reverts: c49782a51ece39446c434273d37fcb05567d874d
RH-Reverts-patchwork-id: 26206
Bugzilla-related: 699370
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 qemu/hw/fdc.c |   55 -------------------------------------------------------
 qemu/vl.c     |    3 ---
 2 files changed, 0 insertions(+), 58 deletions(-)

diff --git a/qemu/hw/fdc.c b/qemu/hw/fdc.c
index 223076b..dd87a13 100644
--- a/qemu/hw/fdc.c
+++ b/qemu/hw/fdc.c
@@ -31,7 +31,6 @@
 #include "block.h"
 #include "qemu-timer.h"
 #include "isa.h"
-#include "block_int.h"
 
 /********************************************************/
 /* debug Floppy devices */
@@ -509,55 +508,6 @@ struct fdctrl_t {
     fdrive_t drives[MAX_FD];
 };
 
-static void fdctrl_media_changed_save(QEMUFile *f, void *opaque, int version_id)
-{
-    fdctrl_t *fdctrl = opaque;
-    int i;
-
-    for (i = 0; i < MAX_FD; i++) {
-        fdrive_t *drive = &fdctrl->drives[i];
-        if (drive->bs != NULL) {
-            qemu_put_ubyte(f, (uint8_t)(drive->bs->media_changed != 0));
-        } else {
-            /* no drive, put a hint to let dest know about this. */
-            qemu_put_ubyte(f, 2u);
-        }
-    }
-}
-
-static int fdctrl_media_changed_load(QEMUFile *f, void *opaque, int version_id)
-{
-    fdctrl_t *fdctrl = opaque;
-    int i;
-
-    for (i = 0; i < MAX_FD; i++) {
-        fdrive_t *drive = &fdctrl->drives[i];
-        uint8_t changed = qemu_get_ubyte(f);
-        if (changed == 2 || drive->bs == NULL) {
-            /* no drive in either src or dst */
-            continue;
-        } else {
-            drive->bs->media_changed = changed;
-        }
-    }
-
-    return 0;
-}
-
-static int fdctrl_media_changed_needed(void *opaque)
-{
-    fdctrl_t *fdctrl = opaque;
-    int i;
-
-    for (i = 0; i < MAX_FD; i++) {
-        fdrive_t *drive = &fdctrl->drives[i];
-        if (drive->bs != NULL && drive->bs->media_changed != 1) {
-            return 1;
-        }
-    }
-    return 0;
-}
-
 static uint32_t fdctrl_read (void *opaque, uint32_t reg)
 {
     fdctrl_t *fdctrl = opaque;
@@ -1933,11 +1883,6 @@ static fdctrl_t *fdctrl_init_common (qemu_irq irq, int dma_chann,
     }
     fdctrl_external_reset(fdctrl);
     register_savevm("fdc", io_base, 2, fdc_save, fdc_load, fdctrl);
-    register_optional_savevm("fdc/media_changed", 0, 1,
-                             fdctrl_media_changed_save,
-                             fdctrl_media_changed_load,
-                             fdctrl_media_changed_needed,
-                             fdctrl);
     qemu_register_reset(fdctrl_external_reset, fdctrl);
     for (i = 0; i < MAX_FD; i++) {
         fd_revalidate(&fdctrl->drives[i]);
diff --git a/qemu/vl.c b/qemu/vl.c
index 1685d48..781f11c 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -47,7 +47,6 @@
 #include "kvm.h"
 #include "balloon.h"
 #include "qemu-kvm.h"
-#include "block_int.h"
 
 #include <unistd.h>
 #include <fcntl.h>
@@ -2799,11 +2798,9 @@ int drives_reopen(void)
     for (i=0; i < nb_drives; i++)
         if (drives_table[i].used && drives_table[i].opened) {
             int res;
-            int media_changed = drives_table[i].bdrv->media_changed;
 
             bdrv_close(drives_table[i].bdrv);
             res = drive_open(drives_table[i]);
-            drives_table[i].bdrv->media_changed = media_changed;
             if (res) {
 		    fprintf(stderr, "qemu: re-open of %s failed wth error %d\n",
 			    drives_table[i].file, res);
-- 
1.7.3.2