~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to modules/linux/vmci/common/vmciRoute.c

  • Committer: Package Import Robot
  • Author(s): Nate Muench
  • Date: 2012-06-20 15:59:51 UTC
  • mfrom: (1.4.8)
  • Revision ID: package-import@ubuntu.com-20120620155951-6rupmpb0f70b52zr
Tags: 2012.05.21-724730-0ubuntu1
* Merging upstream version 2012.05.21-724730.
  - Fixes building against the current Quantal kernel. (LP: #1000344)
  - Fixes Quantal installation issues. (LP: #1019031)

* Sync with Debian
  - Updating to debhelper version 9.
  - Updating to standards version 3.9.3.
  - Updating copyright file machine-readable format version 1.0.
  - Building without multiarch paths for now

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*********************************************************
2
 
 * Copyright (C) 2011 VMware, Inc. All rights reserved.
 
2
 * Copyright (C) 2011-2012 VMware, Inc. All rights reserved.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify it
5
5
 * under the terms of the GNU General Public License as published by the
114
114
         return VMCI_ERROR_INVALID_ARGS;
115
115
      }
116
116
 
 
117
      /*
 
118
       * If the client passed the ANON source handle then respect it (both
 
119
       * context and resource are invalid).  However, if they passed only
 
120
       * an invalid context, then they probably mean ANY, in which case we
 
121
       * should set the real context here before passing it down.
 
122
       */
 
123
 
 
124
      if (VMCI_INVALID_ID == src->context && VMCI_INVALID_ID != src->resource) {
 
125
         src->context = VMCI_GetContextID();
 
126
      }
 
127
 
117
128
      /* Send from local client down to the hypervisor. */
118
129
      *route = VMCI_ROUTE_AS_GUEST;
119
130
      return VMCI_SUCCESS;
214
225
         /* Pass it up to the guest. */
215
226
         *route = VMCI_ROUTE_AS_HOST;
216
227
         return VMCI_SUCCESS;
 
228
      } else if (!hasGuestDevice) {
 
229
         /*
 
230
          * The host is attempting to reach a CID without an active context, and
 
231
          * we can't send it down, since we have no guest device.
 
232
          */
 
233
 
 
234
         return VMCI_ERROR_DST_UNREACHABLE;
217
235
      }
218
236
   }
219
237
 
225
243
    */
226
244
 
227
245
   if (!hasGuestDevice) {
 
246
      /*
 
247
       * Ending up here means we have neither guest nor host device. That
 
248
       * shouldn't happen, since any VMCI client in the kernel should have done
 
249
       * a successful VMCI_DeviceGet.
 
250
       */
 
251
 
 
252
      ASSERT(FALSE);
 
253
 
228
254
      return VMCI_ERROR_DEVICE_NOT_FOUND;
229
255
   }
230
256