~n-muench/ubuntu/precise/open-vm-tools/open-vm-tools-precise.sid-merge1

« back to all changes in this revision

Viewing changes to libguestlib/guestlibV3.x

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********************************************************
 
2
 * Copyright (C) 2008 VMware, Inc. All rights reserved.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify it
 
5
 * under the terms of the GNU Lesser General Public License as published
 
6
 * by the Free Software Foundation version 2.1 and no later version.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
10
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the Lesser GNU General Public
 
11
 * License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 
15
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
 
16
 *
 
17
 *********************************************************/
 
18
 
 
19
 
 
20
/*
 
21
 * guestlibV3.x --
 
22
 *
 
23
 *    Data structures that encode the information sent from VMX to Guest upon a
 
24
 *    Guestlib protocol v3 request.
 
25
 */
 
26
 
 
27
struct GuestLibV3StatUint32 {
 
28
   Bool valid;
 
29
   uint32 value;
 
30
};
 
31
 
 
32
struct GuestLibV3StatUint64 {
 
33
   Bool valid;
 
34
   uint64 value;
 
35
};
 
36
 
 
37
const GUESTLIBV3_STRING_SIZE = 512;
 
38
 
 
39
struct GuestLibV3String {
 
40
   Bool valid;
 
41
   string value<GUESTLIBV3_STRING_SIZE>;
 
42
};
 
43
 
 
44
struct GuestLibV3ByteArray {
 
45
   Bool valid;
 
46
   opaque value<>;
 
47
};
 
48
 
 
49
typedef uint32 GuestLibV3StatCount;
 
50
 
 
51
enum GuestLibV3TypeIds {
 
52
   /* V2 statistics */
 
53
   GUESTLIB_TYPE_RESERVED           = 0,
 
54
   GUESTLIB_CPU_RESERVATION_MHZ     = 1,
 
55
   GUESTLIB_CPU_LIMIT_MHZ           = 2,
 
56
   GUESTLIB_CPU_SHARES              = 3,
 
57
   GUESTLIB_CPU_USED_MS             = 4,
 
58
 
 
59
   GUESTLIB_HOST_MHZ                = 5,
 
60
 
 
61
   GUESTLIB_MEM_RESERVATION_MB      = 6,
 
62
   GUESTLIB_MEM_LIMIT_MB            = 7,
 
63
   GUESTLIB_MEM_SHARES              = 8,
 
64
   GUESTLIB_MEM_MAPPED_MB           = 9,
 
65
   GUESTLIB_MEM_ACTIVE_MB           = 10,
 
66
   GUESTLIB_MEM_OVERHEAD_MB         = 11,
 
67
   GUESTLIB_MEM_BALLOONED_MB        = 12,
 
68
   GUESTLIB_MEM_SWAPPED_MB          = 13,
 
69
   GUESTLIB_MEM_SHARED_MB           = 14,
 
70
   GUESTLIB_MEM_SHARED_SAVED_MB     = 15,
 
71
   GUESTLIB_MEM_USED_MB             = 16,
 
72
 
 
73
   GUESTLIB_ELAPSED_MS              = 17,
 
74
   GUESTLIB_RESOURCE_POOL_PATH      = 18,
 
75
 
 
76
   GUESTLIB_CPU_STOLEN_MS           = 19,
 
77
   GUESTLIB_MEM_TARGET_SIZE_MB      = 20,
 
78
 
 
79
   /* Host specific counters. */
 
80
   GUESTLIB_HOST_CPU_NUM_CORES      = 21,
 
81
   GUESTLIB_HOST_CPU_USED_MS        = 22,
 
82
   GUESTLIB_HOST_MEM_SWAPPED_MB     = 23,
 
83
   GUESTLIB_HOST_MEM_SHARED_MB      = 24,
 
84
   GUESTLIB_HOST_MEM_USED_MB        = 25,
 
85
   GUESTLIB_HOST_MEM_PHYS_MB        = 26,
 
86
   GUESTLIB_HOST_MEM_PHYS_FREE_MB   = 27,
 
87
   GUESTLIB_HOST_MEM_KERN_OVHD_MB   = 28,
 
88
   GUESTLIB_HOST_MEM_MAPPED_MB      = 29,
 
89
   GUESTLIB_HOST_MEM_UNMAPPED_MB    = 30,
 
90
 
 
91
   /* Counters added in ESX5.0 */
 
92
   GUESTLIB_MEM_ZIPPED_MB           = 31,
 
93
   GUESTLIB_MEM_ZIPSAVED_MB         = 32,
 
94
   GUESTLIB_MEM_LLSWAPPED_MB        = 33,
 
95
   GUESTLIB_MEM_SWAP_TARGET_MB      = 34,
 
96
   GUESTLIB_MEM_BALLOON_TARGET_MB   = 35,
 
97
   GUESTLIB_MEM_BALLOON_MAX_MB      = 36,
 
98
   GUESTLIB_RESOURCE_POOL_PATH_LONG = 37,
 
99
   /*------ Add any new statistics above this line. ------- */
 
100
 
 
101
   /*------ Bump this when adding to this list. -------*/
 
102
   GUESTLIB_MAX_STATISTIC_ID        = 38
 
103
};
 
104
 
 
105
union GuestLibV3Stat switch (GuestLibV3TypeIds d) {
 
106
   case GUESTLIB_CPU_RESERVATION_MHZ:
 
107
      struct GuestLibV3StatUint32 cpuReservationMHz;
 
108
   case GUESTLIB_CPU_LIMIT_MHZ:
 
109
      struct GuestLibV3StatUint32 cpuLimitMHz;
 
110
   case GUESTLIB_CPU_SHARES:
 
111
      struct GuestLibV3StatUint32 cpuShares;
 
112
   case GUESTLIB_CPU_USED_MS:
 
113
      struct GuestLibV3StatUint64 cpuUsedMs;
 
114
 
 
115
   case GUESTLIB_HOST_MHZ:
 
116
      struct GuestLibV3StatUint32 hostMHz;
 
117
 
 
118
   case GUESTLIB_MEM_RESERVATION_MB:
 
119
      struct GuestLibV3StatUint32 memReservationMB;
 
120
   case GUESTLIB_MEM_LIMIT_MB:
 
121
      struct GuestLibV3StatUint32 memLimitMB;
 
122
   case GUESTLIB_MEM_SHARES:
 
123
      struct GuestLibV3StatUint32 memShares;
 
124
   case GUESTLIB_MEM_MAPPED_MB:
 
125
      struct GuestLibV3StatUint32 memMappedMB;
 
126
   case GUESTLIB_MEM_ACTIVE_MB:
 
127
      struct GuestLibV3StatUint32 memActiveMB;
 
128
   case GUESTLIB_MEM_OVERHEAD_MB:
 
129
      struct GuestLibV3StatUint32 memOverheadMB;
 
130
   case GUESTLIB_MEM_BALLOONED_MB:
 
131
      struct GuestLibV3StatUint32 memBalloonedMB;
 
132
   case GUESTLIB_MEM_SWAPPED_MB:
 
133
      struct GuestLibV3StatUint32 memSwappedMB;
 
134
   case GUESTLIB_MEM_SHARED_MB:
 
135
      struct GuestLibV3StatUint32 memSharedMB;
 
136
   case GUESTLIB_MEM_SHARED_SAVED_MB:
 
137
      struct GuestLibV3StatUint32 memSharedSavedMB;
 
138
   case GUESTLIB_MEM_USED_MB:
 
139
      struct GuestLibV3StatUint32 memUsedMB;
 
140
 
 
141
   case GUESTLIB_ELAPSED_MS:
 
142
      struct GuestLibV3StatUint64 elapsedMs;
 
143
 
 
144
   case GUESTLIB_RESOURCE_POOL_PATH:
 
145
      struct GuestLibV3String resourcePoolPath;
 
146
 
 
147
   case GUESTLIB_CPU_STOLEN_MS:
 
148
      struct GuestLibV3StatUint64 cpuStolenMs;
 
149
   case GUESTLIB_MEM_TARGET_SIZE_MB:
 
150
      struct GuestLibV3StatUint64 memTargetSizeMB;
 
151
 
 
152
   case GUESTLIB_HOST_CPU_NUM_CORES:
 
153
      struct GuestLibV3StatUint32 hostCpuNumCores;
 
154
   case GUESTLIB_HOST_CPU_USED_MS:
 
155
      struct GuestLibV3StatUint64 hostCpuUsedMs;
 
156
   case GUESTLIB_HOST_MEM_SWAPPED_MB:
 
157
      struct GuestLibV3StatUint64 hostMemSwappedMB;
 
158
   case GUESTLIB_HOST_MEM_SHARED_MB:
 
159
      struct GuestLibV3StatUint64 hostMemSharedMB;
 
160
   case GUESTLIB_HOST_MEM_USED_MB:
 
161
      struct GuestLibV3StatUint64 hostMemUsedMB;
 
162
   case GUESTLIB_HOST_MEM_PHYS_MB:
 
163
      struct GuestLibV3StatUint64 hostMemPhysMB;
 
164
   case GUESTLIB_HOST_MEM_PHYS_FREE_MB:
 
165
      struct GuestLibV3StatUint64 hostMemPhysFreeMB;
 
166
   case GUESTLIB_HOST_MEM_KERN_OVHD_MB:
 
167
      struct GuestLibV3StatUint64 hostMemKernOvhdMB;
 
168
   case GUESTLIB_HOST_MEM_MAPPED_MB:
 
169
      struct GuestLibV3StatUint64 hostMemMappedMB;
 
170
   case GUESTLIB_HOST_MEM_UNMAPPED_MB:
 
171
      struct GuestLibV3StatUint64 hostMemUnmappedMB;
 
172
   case GUESTLIB_MEM_ZIPPED_MB:
 
173
      struct GuestLibV3StatUint32 memZippedMB;
 
174
   case GUESTLIB_MEM_ZIPSAVED_MB:
 
175
      struct GuestLibV3StatUint32 memZipSavedMB;
 
176
   case GUESTLIB_MEM_LLSWAPPED_MB:
 
177
      struct GuestLibV3StatUint32 memLLSwappedMB;
 
178
   case GUESTLIB_MEM_SWAP_TARGET_MB:
 
179
      struct GuestLibV3StatUint32 memSwapTargetMB;
 
180
   case GUESTLIB_MEM_BALLOON_TARGET_MB:
 
181
      struct GuestLibV3StatUint32 memBalloonTargetMB;
 
182
   case GUESTLIB_MEM_BALLOON_MAX_MB:
 
183
      struct GuestLibV3StatUint32 memBalloonMaxMB;
 
184
   case GUESTLIB_RESOURCE_POOL_PATH_LONG:
 
185
      struct GuestLibV3ByteArray resourcePoolPathLong;
 
186
};
 
187