Revisão | e2f775205a3523751ac479ec3194eb054376419d (tree) |
---|---|
Hora | 2011-08-05 06:19:04 |
Autor | Anthony Liguori <aliguori@us.i...> |
Commiter | Anthony Liguori |
Revert "floppy: save and restore DIR register"
This reverts commit 7d905f716bea633f2836e1d661387983aacdc6d6.
The use of subsections by this commit are broken because of a fundamental
limitations of subsections in the current protocol.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
@@ -36,7 +36,6 @@ | ||
36 | 36 | #include "qdev-addr.h" |
37 | 37 | #include "blockdev.h" |
38 | 38 | #include "sysemu.h" |
39 | -#include "block_int.h" | |
40 | 39 | |
41 | 40 | /********************************************************/ |
42 | 41 | /* debug Floppy devices */ |
@@ -83,7 +82,6 @@ typedef struct FDrive { | ||
83 | 82 | uint8_t max_track; /* Nb of tracks */ |
84 | 83 | uint16_t bps; /* Bytes per sector */ |
85 | 84 | uint8_t ro; /* Is read-only */ |
86 | - uint8_t media_changed; /* Is media changed */ | |
87 | 85 | } FDrive; |
88 | 86 | |
89 | 87 | static void fd_init(FDrive *drv) |
@@ -535,63 +533,16 @@ static CPUWriteMemoryFunc * const fdctrl_mem_write_strict[3] = { | ||
535 | 533 | NULL, |
536 | 534 | }; |
537 | 535 | |
538 | -static void fdrive_media_changed_pre_save(void *opaque) | |
539 | -{ | |
540 | - FDrive *drive = opaque; | |
541 | - | |
542 | - drive->media_changed = drive->bs->media_changed; | |
543 | -} | |
544 | - | |
545 | -static int fdrive_media_changed_post_load(void *opaque, int version_id) | |
546 | -{ | |
547 | - FDrive *drive = opaque; | |
548 | - | |
549 | - if (drive->bs != NULL) { | |
550 | - drive->bs->media_changed = drive->media_changed; | |
551 | - } | |
552 | - | |
553 | - /* User ejected the floppy when drive->bs == NULL */ | |
554 | - return 0; | |
555 | -} | |
556 | - | |
557 | -static bool fdrive_media_changed_needed(void *opaque) | |
558 | -{ | |
559 | - FDrive *drive = opaque; | |
560 | - | |
561 | - return (drive->bs != NULL && drive->bs->media_changed != 1); | |
562 | -} | |
563 | - | |
564 | -static const VMStateDescription vmstate_fdrive_media_changed = { | |
565 | - .name = "fdrive/media_changed", | |
566 | - .version_id = 1, | |
567 | - .minimum_version_id = 1, | |
568 | - .minimum_version_id_old = 1, | |
569 | - .pre_save = fdrive_media_changed_pre_save, | |
570 | - .post_load = fdrive_media_changed_post_load, | |
571 | - .fields = (VMStateField[]) { | |
572 | - VMSTATE_UINT8(media_changed, FDrive), | |
573 | - VMSTATE_END_OF_LIST() | |
574 | - } | |
575 | -}; | |
576 | - | |
577 | 536 | static const VMStateDescription vmstate_fdrive = { |
578 | 537 | .name = "fdrive", |
579 | 538 | .version_id = 1, |
580 | 539 | .minimum_version_id = 1, |
581 | 540 | .minimum_version_id_old = 1, |
582 | - .fields = (VMStateField[]) { | |
541 | + .fields = (VMStateField []) { | |
583 | 542 | VMSTATE_UINT8(head, FDrive), |
584 | 543 | VMSTATE_UINT8(track, FDrive), |
585 | 544 | VMSTATE_UINT8(sect, FDrive), |
586 | 545 | VMSTATE_END_OF_LIST() |
587 | - }, | |
588 | - .subsections = (VMStateSubsection[]) { | |
589 | - { | |
590 | - .vmsd = &vmstate_fdrive_media_changed, | |
591 | - .needed = &fdrive_media_changed_needed, | |
592 | - } , { | |
593 | - /* empty */ | |
594 | - } | |
595 | 546 | } |
596 | 547 | }; |
597 | 548 |