From: VMware, Inc <> Date: Tue, 13 Mar 2012 20:03:30 +0000 (-0700) Subject: VMCI: report VMCI_ERROR_DST_UNREACHABLE when VMX goes away X-Git-Tag: 2012.03.13-651368~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5df706c8e1ffd060ff819357265a66d9a1aaf0bd;p=thirdparty%2Fopen-vm-tools.git VMCI: report VMCI_ERROR_DST_UNREACHABLE when VMX goes away When a VMCI driver with host side only attempts to route to an unknown context ID, it reports VMCI_ERROR_DEVICE_NOT_FOUND. Change that to VMCI_ERROR_DST_UNREACHABLE, since that is more descriptive. Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/modules/linux/vmci/common/vmciRoute.c b/open-vm-tools/modules/linux/vmci/common/vmciRoute.c index 2905a8127..1ca425638 100644 --- a/open-vm-tools/modules/linux/vmci/common/vmciRoute.c +++ b/open-vm-tools/modules/linux/vmci/common/vmciRoute.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011 VMware, Inc. All rights reserved. + * Copyright (C) 2011-2012 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -214,6 +214,13 @@ VMCI_Route(VMCIHandle *src, // IN/OUT /* Pass it up to the guest. */ *route = VMCI_ROUTE_AS_HOST; return VMCI_SUCCESS; + } else if (!hasGuestDevice) { + /* + * The host is attempting to reach a CID without an active context, and + * we can't send it down, since we have no guest device. + */ + + return VMCI_ERROR_DST_UNREACHABLE; } } @@ -225,6 +232,14 @@ VMCI_Route(VMCIHandle *src, // IN/OUT */ if (!hasGuestDevice) { + /* + * Ending up here means we have neither guest nor host device. That + * shouldn't happen, since any VMCI client in the kernel should have done + * a successful VMCI_DeviceGet. + */ + + ASSERT(FALSE); + return VMCI_ERROR_DEVICE_NOT_FOUND; } diff --git a/open-vm-tools/modules/linux/vmci/linux/vmci_version.h b/open-vm-tools/modules/linux/vmci/linux/vmci_version.h index 9e51d2ca3..26c90eef2 100644 --- a/open-vm-tools/modules/linux/vmci/linux/vmci_version.h +++ b/open-vm-tools/modules/linux/vmci/linux/vmci_version.h @@ -25,8 +25,8 @@ #ifndef _VMCI_VERSION_H_ #define _VMCI_VERSION_H_ -#define VMCI_DRIVER_VERSION 9.4.0.0 -#define VMCI_DRIVER_VERSION_COMMAS 9,4,0,0 -#define VMCI_DRIVER_VERSION_STRING "9.4.0.0" +#define VMCI_DRIVER_VERSION 9.4.1.0 +#define VMCI_DRIVER_VERSION_COMMAS 9,4,1,0 +#define VMCI_DRIVER_VERSION_STRING "9.4.1.0" #endif /* _VMCI_VERSION_H_ */