Changeset 64834 in vbox for trunk/src/VBox
- Timestamp:
- Dec 12, 2016 4:35:07 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VirtIO/Virtio.cpp
r64825 r64834 492 492 { 493 493 case VPCI_GUEST_FEATURES: 494 /* Check if the guest negotiates properly, fall back to basics if it does not. */ 495 if (VPCI_F_BAD_FEATURE & u32) 494 { 495 const uint32_t uHostFeatures = vpciGetHostFeatures(pState, pCallbacks->pfnGetHostFeatures); 496 497 if (RT_LIKELY((u32 & ~uHostFeatures) == 0)) 496 498 { 497 Log(("%s WARNING! Guest failed to negotiate properly (guest=%x)\n", 498 INSTANCE(pState), u32)); 499 pState->uGuestFeatures = pCallbacks->pfnGetHostMinimalFeatures(pState); 500 } 501 /* The guest may potentially desire features we don't support! */ 502 else if (~vpciGetHostFeatures(pState, pCallbacks->pfnGetHostFeatures) & u32) 503 { 504 Log(("%s Guest asked for features host does not support! (host=%x guest=%x)\n", 505 INSTANCE(pState), 506 vpciGetHostFeatures(pState, pCallbacks->pfnGetHostFeatures), u32)); 507 pState->uGuestFeatures = 508 vpciGetHostFeatures(pState, pCallbacks->pfnGetHostFeatures); 499 pState->uGuestFeatures = u32; 509 500 } 510 501 else 511 pState->uGuestFeatures = u32; 502 { 503 /* 504 * Guest requests features we don't advertise. Stick 505 * to the minimum if negotiation looks completely 506 * botched, otherwise restrict to advertised features. 507 */ 508 if (u32 & VPCI_F_BAD_FEATURE) 509 { 510 Log(("%s WARNING! Guest failed to negotiate properly (guest=%x)\n", 511 INSTANCE(pState), u32)); 512 pState->uGuestFeatures = pCallbacks->pfnGetHostMinimalFeatures(pState); 513 } 514 else 515 { 516 Log(("%s Guest asked for features host does not support! (host=%x guest=%x)\n", 517 INSTANCE(pState), uHostFeatures, u32)); 518 pState->uGuestFeatures = u32 & uHostFeatures; 519 } 520 } 512 521 pCallbacks->pfnSetHostFeatures(pState, pState->uGuestFeatures); 513 522 break; 523 } 514 524 515 525 case VPCI_QUEUE_PFN:
Note:
See TracChangeset
for help on using the changeset viewer.