Skip to content

Commit 9ba3fb1

Browse files
committed
Storage: Fix hotplug not working on the first attempt
1 parent d0a1cb8 commit 9ba3fb1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ MacHyperVSupport Changelog
1313
- Added ACPI fixup module to resolve ACPI issues on macOS 10.6 and older without SSDT
1414
- Removed requirement to force legacy mode on macOS 10.4 and 10.5, use the `ClearTaskSwitchBit` OpenCore Booter quirk instead
1515
- Added installer package for userspace components
16+
- Fixed storage hotplug not working on the first addition/removal of a disk
1617

1718
#### v0.9.7
1819
- Fixed disks on a passed-in PCI device not being usable

MacHyperVSupport/Storage/HyperVStoragePrivate.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ static const HyperVStorageProtocol storageProtocols[] = {
3939
};
4040

4141
bool HyperVStorage::wakePacketHandler(VMBusPacketHeader *pktHeader, UInt32 pktHeaderLength, UInt8 *pktData, UInt32 pktDataLength) {
42-
return true;
42+
//
43+
// Only CompleteIO requests should wake sleeping threads.
44+
//
45+
HyperVStoragePacket *storPkt = (HyperVStoragePacket*) pktData;
46+
return storPkt->operation == kHyperVStoragePacketOperationCompleteIO;
4347
}
4448

4549
void HyperVStorage::handlePacket(VMBusPacketHeader *pktHeader, UInt32 pktHeaderLength, UInt8 *pktData, UInt32 pktDataLength) {

0 commit comments

Comments
 (0)