~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Devices/Storage/fdc.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2379
2379
    }
2380
2380
}
2381
2381
 
2382
 
static DECLCALLBACK(int) SaveExec (PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)
 
2382
static DECLCALLBACK(int) fdcSaveExec (PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)
2383
2383
{
2384
2384
    fdctrl_t *s = PDMINS_2_DATA (pDevIns, fdctrl_t *);
2385
2385
    QEMUFile *f = pSSMHandle;
2428
2428
    return TMR3TimerSave (s->result_timer, pSSMHandle);
2429
2429
}
2430
2430
 
2431
 
static DECLCALLBACK(int) LoadExec (PPDMDEVINS pDevIns,
2432
 
                                   PSSMHANDLE pSSMHandle,
2433
 
                                   uint32_t u32Version)
 
2431
static DECLCALLBACK(int) fdcLoadExec (PPDMDEVINS pDevIns,
 
2432
                                      PSSMHANDLE pSSMHandle,
 
2433
                                      uint32_t uVersion,
 
2434
                                      uint32_t uPass)
2434
2435
{
2435
2436
    fdctrl_t *s = PDMINS_2_DATA (pDevIns, fdctrl_t *);
2436
2437
    QEMUFile *f = pSSMHandle;
2437
2438
    unsigned int i;
2438
2439
 
2439
 
    if (u32Version != 1) {
2440
 
        AssertMsgFailed(("u32Version=%d\n", u32Version));
2441
 
        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
2442
 
    }
 
2440
    AssertMsgReturn(uVersion == 1, ("%d\n", uVersion), VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION);
 
2441
    Assert(uPass == SSM_PASS_FINAL); NOREF(uPass);
2443
2442
 
2444
2443
    qemu_get_8s (f, &s->version);
2445
2444
    qemu_get_8s (f, &s->irq_lvl);
2657
2656
 * @param   iLUN        The logical unit which is being detached.
2658
2657
 */
2659
2658
static DECLCALLBACK(int)  fdcAttach (PPDMDEVINS pDevIns,
2660
 
                                     unsigned iLUN)
 
2659
                                     unsigned iLUN, uint32_t fFlags)
2661
2660
{
2662
2661
    fdctrl_t *fdctrl = PDMINS_2_DATA (pDevIns, fdctrl_t *);
2663
2662
    fdrive_t *drv;
2664
2663
    int rc;
2665
2664
    LogFlow (("ideDetach: iLUN=%u\n", iLUN));
2666
2665
 
 
2666
    AssertMsgReturn(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
 
2667
                    ("The FDC device does not support hotplugging\n"),
 
2668
                    VERR_INVALID_PARAMETER);
 
2669
 
2667
2670
    /*
2668
2671
     * Validate.
2669
2672
     */
2705
2708
 * @param   iLUN        The logical unit which is being detached.
2706
2709
 */
2707
2710
static DECLCALLBACK(void) fdcDetach (PPDMDEVINS pDevIns,
2708
 
                                     unsigned iLUN)
 
2711
                                     unsigned iLUN, uint32_t fFlags)
2709
2712
{
2710
2713
    fdctrl_t *fdctrl = PDMINS_2_DATA (pDevIns, fdctrl_t *);
2711
2714
    LogFlow (("ideDetach: iLUN=%u\n", iLUN));
2891
2894
    /*
2892
2895
     * Register the saved state data unit.
2893
2896
     */
2894
 
    rc = PDMDevHlpSSMRegister (pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1, sizeof(*fdctrl),
2895
 
                               NULL, SaveExec, NULL, NULL, LoadExec, NULL);
 
2897
    rc = PDMDevHlpSSMRegister (pDevIns, 1 /*uVersion*/, sizeof(*fdctrl), fdcSaveExec, fdcLoadExec);
2896
2898
    if (RT_FAILURE(rc))
2897
2899
        return rc;
2898
2900