pkg/pillar/vendor/github.com/shirou/gopsutil/disk/disk_darwin.h
int FetchNextDisk()
{
    while ((diskEntry = IOIteratorNext(diskIter)) != 0) {
        // We are iterating IOMedia. We need to get the parent too (IOBSD).
        if (IORegistryEntryGetParentEntry(diskEntry, kIOServicePlane, &parentEntry) != kIOReturnSuccess) {
            // something is wrong...
            IOObjectRelease(diskEntry);
            continue;
        }

        if (!IOObjectConformsTo(parentEntry, "IOBlockStorageDriver")) {
            // no use to us, try the next disk
            IOObjectRelease(diskEntry);
            IOObjectRelease(parentEntry);
            continue;
        }

        // Got a disk OK.
        return 1;
    }

    // No more disks.
    return 0;
}
// Fetches the next disk. Note that a disk entry is allocated, and will be held
// until it is processed and freed by ReadDiskInfo.
Fetches the next disk. Note that a disk entry is allocated, and will be held
until it is processed and freed by ReadDiskInfo.
Fetches the next disk . Note that a disk entry is allocated and will be held until it is processed and freed by ReadDiskInfo .
int FetchNextDisk()
{
    while ((diskEntry = IOIteratorNext(diskIter)) != 0) {
        if (IORegistryEntryGetParentEntry(diskEntry, kIOServicePlane, &parentEntry) != kIOReturnSuccess) {
            IOObjectRelease(diskEntry);
            continue;
        }
        if (!IOObjectConformsTo(parentEntry, "IOBlockStorageDriver")) {
            IOObjectRelease(diskEntry);
            IOObjectRelease(parentEntry);
            continue;
        }
        return 1;
    }
    return 0;
}
int FetchNextDisk ( ) { while ( ( diskEntry = IOIteratorNext ( diskIter ) ) != 0 ) { if ( IORegistryEntryGetParentEntry ( diskEntry , kIOServicePlane , & parentEntry ) != kIOReturnSuccess ) { IOObjectRelease ( diskEntry ) ; continue ; } if ( ! IOObjectConformsTo ( parentEntry , " " ) ) { IOObjectRelease ( diskEntry ) ; IOObjectRelease ( parentEntry ) ; continue ; } return 1 ; } return 0 ; }
Fetches the next disk.
Fetches the next disk .
// We are iterating IOMedia. We need to get the parent too (IOBSD). // something is wrong... // no use to us, try the next disk // Got a disk OK. // No more disks.