VirtualBox

Changeset 98271 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Jan 24, 2023 10:08:42 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155474
Message:

Devices/Storage: Suspend the VM when the file handle became stale (often due to a restarted MFS server), bugref:9811

Location:
trunk/src/VBox/Devices/Storage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r98103 r98271  
    17231723}
    17241724
     1725static void ataR3WarningFileStale(PPDMDEVINS pDevIns)
     1726{
     1727    int rc;
     1728    LogRel(("PIIX3 ATA: File handle became stale\n"));
     1729    rc = PDMDevHlpVMSetRuntimeError(pDevIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DevATA_FILESTALE",
     1730                                    N_("The file became stale (often due to a restarted NFS server). VM execution is suspended. You can resume when it is available again"));
     1731    AssertRC(rc);
     1732}
     1733
     1734
    17251735static bool ataR3IsRedoSetWarning(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, int rc)
    17261736{
     
    17441754         * connection (second error). Pause VM. On resume we'll retry. */
    17451755        ataR3WarningISCSI(pDevIns);
     1756        return true;
     1757    }
     1758    if (rc == VERR_STALE_FILE_HANDLE)
     1759    {
     1760        pCtl->fRedoIdle = true;
     1761        ataR3WarningFileStale(pDevIns);
    17461762        return true;
    17471763    }
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r98103 r98271  
    23052305}
    23062306
     2307static void drvvdMediaExIoReqWarningFileStale(PPDMDRVINS pDrvIns)
     2308{
     2309    int rc;
     2310    LogRel(("VD#%u: File handle became stale\n", pDrvIns->iInstance));
     2311    rc = PDMDrvHlpVMSetRuntimeError(pDrvIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DrvVD_ISCSIDOWN",
     2312                                    N_("The file became stale (often due to a restarted NFS server). VM execution is suspended. You can resume when it is available again"));
     2313    AssertRC(rc);
     2314}
     2315
    23072316static void drvvdMediaExIoReqWarningDekMissing(PPDMDRVINS pDrvIns)
    23082317{
     
    23422351        if (ASMAtomicCmpXchgBool(&pThis->fRedo, true, false))
    23432352            drvvdMediaExIoReqWarningISCSI(pThis->pDrvIns);
     2353        return true;
     2354    }
     2355    if (rc == VERR_STALE_FILE_HANDLE)
     2356    {
     2357        if (ASMAtomicCmpXchgBool(&pThis->fRedo, true, false))
     2358            drvvdMediaExIoReqWarningFileStale(pThis->pDrvIns);
    23442359        return true;
    23452360    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette