[ipxe-devel] [PATCH] vmbus: do not expect version in version_response

Roman Kagan rkagan at virtuozzo.com
Sat Jun 9 14:53:31 UTC 2018


The definition of version_response channel message in Linux doesn't
include version field, so the upcoming VMBus implementation in QEMU
doesn't set it either.  Neither Windows nor Linux had any problem with
this.

The check against this field is redundant because the message is the
response to initiate_contact message containing the specific version
requested, so the response with version_supported=true is unambiguous.

Drop this check and don't rely on the field to be present in the
message.

Signed-off-by: Roman Kagan <rkagan at virtuozzo.com>
---
 src/interface/hyperv/vmbus.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/interface/hyperv/vmbus.c b/src/interface/hyperv/vmbus.c
index 45a7caec..7cd4e95a 100644
--- a/src/interface/hyperv/vmbus.c
+++ b/src/interface/hyperv/vmbus.c
@@ -195,16 +195,10 @@ static int vmbus_initiate_contact ( struct hv_hypervisor *hv,
 		       vmbus );
 		return -ENOTSUP;
 	}
-	if ( version->version.raw != cpu_to_le32 ( raw ) ) {
-		DBGC ( vmbus, "VMBUS %p unexpected version %d.%d\n",
-		       vmbus, le16_to_cpu ( version->version.major ),
-		       le16_to_cpu ( version->version.minor ) );
-		return -EPROTO;
-	}
 
 	DBGC ( vmbus, "VMBUS %p initiated contact using version %d.%d\n",
-	       vmbus, le16_to_cpu ( version->version.major ),
-	       le16_to_cpu ( version->version.minor ) );
+	       vmbus, le16_to_cpu ( raw >> 16 ),
+	       le16_to_cpu ( raw & 0xffff ) );
 	return 0;
 }
 
-- 
2.17.1




More information about the ipxe-devel mailing list