1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153
|
/*********************************************************
* Copyright (C) 2004-2008 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation version 2.1 and no later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
*********************************************************/
/*
* This is the C interface to the VIX API.
* This is platform-independent.
*/
#ifndef _VIX_H_
#define _VIX_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
*-----------------------------------------------------------------------------
*
* Basic Types --
*
*-----------------------------------------------------------------------------
*/
#include "vm_basic_types.h"
typedef int VixHandle;
enum {
VIX_INVALID_HANDLE = 0,
};
/*
* These are the types of handles.
*/
typedef int VixHandleType;
enum {
VIX_HANDLETYPE_NONE = 0,
VIX_HANDLETYPE_HOST = 2,
VIX_HANDLETYPE_VM = 3,
VIX_HANDLETYPE_NETWORK = 5,
VIX_HANDLETYPE_JOB = 6,
VIX_HANDLETYPE_SNAPSHOT = 7,
VIX_HANDLETYPE_PROPERTY_LIST = 9,
VIX_HANDLETYPE_METADATA_CONTAINER = 11
};
/*
* The "//{{ Begin VIX_ERROR }}" and "//{{ End VIX_ERROR }}" lines are
* to bracket the error code definitions that will be copied over
* to vixDiskLib.h during build time. If you modify these two lines, please
* make sure you also change bora/lib/distribute/vixDiskLib.h and
* bora/support/scripts/replaceVixErrors.py
*/
// {{ Begin VIX_ERROR }}
/*
* An error is a 64-bit value. If there is no error, then the value is
* set to VIX_OK. If there is an error, then the least significant bits
* will be set to one of the integer error codes defined below. The more
* significant bits may or may not be set to various values, depending on
* the errors.
*/
typedef uint64 VixError;
#define VIX_ERROR_CODE(err) ((err) & 0xFFFF)
#define VIX_SUCCEEDED(err) (VIX_OK == (err))
#define VIX_FAILED(err) (VIX_OK != (err))
/*
* The error codes are returned by all public VIX routines.
*/
enum {
VIX_OK = 0,
/* General errors */
VIX_E_FAIL = 1,
VIX_E_OUT_OF_MEMORY = 2,
VIX_E_INVALID_ARG = 3,
VIX_E_FILE_NOT_FOUND = 4,
VIX_E_OBJECT_IS_BUSY = 5,
VIX_E_NOT_SUPPORTED = 6,
VIX_E_FILE_ERROR = 7,
VIX_E_DISK_FULL = 8,
VIX_E_INCORRECT_FILE_TYPE = 9,
VIX_E_CANCELLED = 10,
VIX_E_FILE_READ_ONLY = 11,
VIX_E_FILE_ALREADY_EXISTS = 12,
VIX_E_FILE_ACCESS_ERROR = 13,
VIX_E_REQUIRES_LARGE_FILES = 14,
VIX_E_FILE_ALREADY_LOCKED = 15,
VIX_E_VMDB = 16,
VIX_E_NOT_SUPPORTED_ON_REMOTE_OBJECT = 20,
VIX_E_FILE_TOO_BIG = 21,
VIX_E_FILE_NAME_INVALID = 22,
VIX_E_ALREADY_EXISTS = 23,
VIX_E_BUFFER_TOOSMALL = 24,
VIX_E_OBJECT_NOT_FOUND = 25,
VIX_E_HOST_NOT_CONNECTED = 26,
VIX_E_INVALID_UTF8_STRING = 27,
VIX_E_OPERATION_ALREADY_IN_PROGRESS = 31,
VIX_E_UNFINISHED_JOB = 29,
VIX_E_NEED_KEY = 30,
VIX_E_LICENSE = 32,
VIX_E_VM_HOST_DISCONNECTED = 34,
VIX_E_AUTHENTICATION_FAIL = 35,
/* Handle Errors */
VIX_E_INVALID_HANDLE = 1000,
VIX_E_NOT_SUPPORTED_ON_HANDLE_TYPE = 1001,
VIX_E_TOO_MANY_HANDLES = 1002,
/* XML errors */
VIX_E_NOT_FOUND = 2000,
VIX_E_TYPE_MISMATCH = 2001,
VIX_E_INVALID_XML = 2002,
/* VM Control Errors */
VIX_E_TIMEOUT_WAITING_FOR_TOOLS = 3000,
VIX_E_UNRECOGNIZED_COMMAND = 3001,
VIX_E_OP_NOT_SUPPORTED_ON_GUEST = 3003,
VIX_E_PROGRAM_NOT_STARTED = 3004,
VIX_E_CANNOT_START_READ_ONLY_VM = 3005,
VIX_E_VM_NOT_RUNNING = 3006,
VIX_E_VM_IS_RUNNING = 3007,
VIX_E_CANNOT_CONNECT_TO_VM = 3008,
VIX_E_POWEROP_SCRIPTS_NOT_AVAILABLE = 3009,
VIX_E_NO_GUEST_OS_INSTALLED = 3010,
VIX_E_VM_INSUFFICIENT_HOST_MEMORY = 3011,
VIX_E_SUSPEND_ERROR = 3012,
VIX_E_VM_NOT_ENOUGH_CPUS = 3013,
VIX_E_HOST_USER_PERMISSIONS = 3014,
VIX_E_GUEST_USER_PERMISSIONS = 3015,
VIX_E_TOOLS_NOT_RUNNING = 3016,
VIX_E_GUEST_OPERATIONS_PROHIBITED = 3017,
VIX_E_ANON_GUEST_OPERATIONS_PROHIBITED = 3018,
VIX_E_ROOT_GUEST_OPERATIONS_PROHIBITED = 3019,
VIX_E_MISSING_ANON_GUEST_ACCOUNT = 3023,
VIX_E_CANNOT_AUTHENTICATE_WITH_GUEST = 3024,
VIX_E_UNRECOGNIZED_COMMAND_IN_GUEST = 3025,
VIX_E_CONSOLE_GUEST_OPERATIONS_PROHIBITED = 3026,
VIX_E_MUST_BE_CONSOLE_USER = 3027,
VIX_E_VMX_MSG_DIALOG_AND_NO_UI = 3028,
VIX_E_NOT_ALLOWED_DURING_VM_RECORDING = 3029,
VIX_E_NOT_ALLOWED_DURING_VM_REPLAY = 3030,
VIX_E_OPERATION_NOT_ALLOWED_FOR_LOGIN_TYPE = 3031,
VIX_E_LOGIN_TYPE_NOT_SUPPORTED = 3032,
VIX_E_EMPTY_PASSWORD_NOT_ALLOWED_IN_GUEST = 3033,
VIX_E_INTERACTIVE_SESSION_NOT_PRESENT = 3034,
VIX_E_INTERACTIVE_SESSION_USER_MISMATCH = 3035,
VIX_E_UNABLE_TO_REPLAY_VM = 3039,
VIX_E_CANNOT_POWER_ON_VM = 3041,
VIX_E_NO_DISPLAY_SERVER = 3043,
VIX_E_VM_NOT_RECORDING = 3044,
VIX_E_VM_NOT_REPLAYING = 3045,
/* VM Errors */
VIX_E_VM_NOT_FOUND = 4000,
VIX_E_NOT_SUPPORTED_FOR_VM_VERSION = 4001,
VIX_E_CANNOT_READ_VM_CONFIG = 4002,
VIX_E_TEMPLATE_VM = 4003,
VIX_E_VM_ALREADY_LOADED = 4004,
VIX_E_VM_ALREADY_UP_TO_DATE = 4006,
/* Property Errors */
VIX_E_UNRECOGNIZED_PROPERTY = 6000,
VIX_E_INVALID_PROPERTY_VALUE = 6001,
VIX_E_READ_ONLY_PROPERTY = 6002,
VIX_E_MISSING_REQUIRED_PROPERTY = 6003,
VIX_E_INVALID_SERIALIZED_DATA = 6004,
VIX_E_PROPERTY_TYPE_MISMATCH = 6005,
/* Completion Errors */
VIX_E_BAD_VM_INDEX = 8000,
/* Message errors */
VIX_E_INVALID_MESSAGE_HEADER = 10000,
VIX_E_INVALID_MESSAGE_BODY = 10001,
/* Snapshot errors */
VIX_E_SNAPSHOT_INVAL = 13000,
VIX_E_SNAPSHOT_DUMPER = 13001,
VIX_E_SNAPSHOT_DISKLIB = 13002,
VIX_E_SNAPSHOT_NOTFOUND = 13003,
VIX_E_SNAPSHOT_EXISTS = 13004,
VIX_E_SNAPSHOT_VERSION = 13005,
VIX_E_SNAPSHOT_NOPERM = 13006,
VIX_E_SNAPSHOT_CONFIG = 13007,
VIX_E_SNAPSHOT_NOCHANGE = 13008,
VIX_E_SNAPSHOT_CHECKPOINT = 13009,
VIX_E_SNAPSHOT_LOCKED = 13010,
VIX_E_SNAPSHOT_INCONSISTENT = 13011,
VIX_E_SNAPSHOT_NAMETOOLONG = 13012,
VIX_E_SNAPSHOT_VIXFILE = 13013,
VIX_E_SNAPSHOT_DISKLOCKED = 13014,
VIX_E_SNAPSHOT_DUPLICATEDDISK = 13015,
VIX_E_SNAPSHOT_INDEPENDENTDISK = 13016,
VIX_E_SNAPSHOT_NONUNIQUE_NAME = 13017,
VIX_E_SNAPSHOT_MEMORY_ON_INDEPENDENT_DISK = 13018,
VIX_E_SNAPSHOT_MAXSNAPSHOTS = 13019,
VIX_E_SNAPSHOT_MIN_FREE_SPACE = 13020,
VIX_E_SNAPSHOT_RRSUSPEND = 13021,
/* Host Errors */
VIX_E_HOST_DISK_INVALID_VALUE = 14003,
VIX_E_HOST_DISK_SECTORSIZE = 14004,
VIX_E_HOST_FILE_ERROR_EOF = 14005,
VIX_E_HOST_NETBLKDEV_HANDSHAKE = 14006,
VIX_E_HOST_SOCKET_CREATION_ERROR = 14007,
VIX_E_HOST_SERVER_NOT_FOUND = 14008,
VIX_E_HOST_NETWORK_CONN_REFUSED = 14009,
VIX_E_HOST_TCP_SOCKET_ERROR = 14010,
VIX_E_HOST_TCP_CONN_LOST = 14011,
VIX_E_HOST_NBD_HASHFILE_VOLUME = 14012,
VIX_E_HOST_NBD_HASHFILE_INIT = 14013,
/* Disklib errors */
VIX_E_DISK_INVAL = 16000,
VIX_E_DISK_NOINIT = 16001,
VIX_E_DISK_NOIO = 16002,
VIX_E_DISK_PARTIALCHAIN = 16003,
VIX_E_DISK_NEEDSREPAIR = 16006,
VIX_E_DISK_OUTOFRANGE = 16007,
VIX_E_DISK_CID_MISMATCH = 16008,
VIX_E_DISK_CANTSHRINK = 16009,
VIX_E_DISK_PARTMISMATCH = 16010,
VIX_E_DISK_UNSUPPORTEDDISKVERSION = 16011,
VIX_E_DISK_OPENPARENT = 16012,
VIX_E_DISK_NOTSUPPORTED = 16013,
VIX_E_DISK_NEEDKEY = 16014,
VIX_E_DISK_NOKEYOVERRIDE = 16015,
VIX_E_DISK_NOTENCRYPTED = 16016,
VIX_E_DISK_NOKEY = 16017,
VIX_E_DISK_INVALIDPARTITIONTABLE = 16018,
VIX_E_DISK_NOTNORMAL = 16019,
VIX_E_DISK_NOTENCDESC = 16020,
VIX_E_DISK_NEEDVMFS = 16022,
VIX_E_DISK_RAWTOOBIG = 16024,
VIX_E_DISK_TOOMANYOPENFILES = 16027,
VIX_E_DISK_TOOMANYREDO = 16028,
VIX_E_DISK_RAWTOOSMALL = 16029,
VIX_E_DISK_INVALIDCHAIN = 16030,
VIX_E_DISK_KEY_NOTFOUND = 16052, // metadata key is not found
VIX_E_DISK_SUBSYSTEM_INIT_FAIL = 16053,
VIX_E_DISK_INVALID_CONNECTION = 16054,
VIX_E_DISK_ENCODING = 16061,
VIX_E_DISK_CANTREPAIR = 16062,
VIX_E_DISK_INVALIDDISK = 16063,
VIX_E_DISK_NOLICENSE = 16064,
VIX_E_DISK_NODEVICE = 16065,
VIX_E_DISK_UNSUPPORTEDDEVICE = 16066,
/* Crypto Library Errors */
VIX_E_CRYPTO_UNKNOWN_ALGORITHM = 17000,
VIX_E_CRYPTO_BAD_BUFFER_SIZE = 17001,
VIX_E_CRYPTO_INVALID_OPERATION = 17002,
VIX_E_CRYPTO_RANDOM_DEVICE = 17003,
VIX_E_CRYPTO_NEED_PASSWORD = 17004,
VIX_E_CRYPTO_BAD_PASSWORD = 17005,
VIX_E_CRYPTO_NOT_IN_DICTIONARY = 17006,
VIX_E_CRYPTO_NO_CRYPTO = 17007,
VIX_E_CRYPTO_ERROR = 17008,
VIX_E_CRYPTO_BAD_FORMAT = 17009,
VIX_E_CRYPTO_LOCKED = 17010,
VIX_E_CRYPTO_EMPTY = 17011,
VIX_E_CRYPTO_KEYSAFE_LOCATOR = 17012,
/* Remoting Errors. */
VIX_E_CANNOT_CONNECT_TO_HOST = 18000,
VIX_E_NOT_FOR_REMOTE_HOST = 18001,
VIX_E_INVALID_HOSTNAME_SPECIFICATION = 18002,
/* Screen Capture Errors. */
VIX_E_SCREEN_CAPTURE_ERROR = 19000,
VIX_E_SCREEN_CAPTURE_BAD_FORMAT = 19001,
VIX_E_SCREEN_CAPTURE_COMPRESSION_FAIL = 19002,
VIX_E_SCREEN_CAPTURE_LARGE_DATA = 19003,
/* Guest Errors */
VIX_E_GUEST_VOLUMES_NOT_FROZEN = 20000,
VIX_E_NOT_A_FILE = 20001,
VIX_E_NOT_A_DIRECTORY = 20002,
VIX_E_NO_SUCH_PROCESS = 20003,
VIX_E_FILE_NAME_TOO_LONG = 20004,
/* Tools install errors */
VIX_E_TOOLS_INSTALL_NO_IMAGE = 21000,
VIX_E_TOOLS_INSTALL_IMAGE_INACCESIBLE = 21001,
VIX_E_TOOLS_INSTALL_NO_DEVICE = 21002,
VIX_E_TOOLS_INSTALL_DEVICE_NOT_CONNECTED = 21003,
VIX_E_TOOLS_INSTALL_CANCELLED = 21004,
VIX_E_TOOLS_INSTALL_INIT_FAILED = 21005,
VIX_E_TOOLS_INSTALL_AUTO_NOT_SUPPORTED = 21006,
VIX_E_TOOLS_INSTALL_GUEST_NOT_READY = 21007,
VIX_E_TOOLS_INSTALL_SIG_CHECK_FAILED = 21008,
VIX_E_TOOLS_INSTALL_ERROR = 21009,
VIX_E_TOOLS_INSTALL_ALREADY_UP_TO_DATE = 21010,
VIX_E_TOOLS_INSTALL_IN_PROGRESS = 21011,
/* Wrapper Errors */
VIX_E_WRAPPER_WORKSTATION_NOT_INSTALLED = 22001,
VIX_E_WRAPPER_VERSION_NOT_FOUND = 22002,
VIX_E_WRAPPER_SERVICEPROVIDER_NOT_FOUND = 22003,
VIX_E_WRAPPER_PLAYER_NOT_INSTALLED = 22004,
};
// {{ End VIX_ERROR }}
const char *Vix_GetErrorText(VixError err, const char *locale);
/*
*-----------------------------------------------------------------------------
*
* VIX Handles --
*
* These are common functions that apply to handles of several types.
*-----------------------------------------------------------------------------
*/
/*
* VIX Property Type
*/
typedef int VixPropertyType;
enum {
VIX_PROPERTYTYPE_ANY = 0,
VIX_PROPERTYTYPE_INTEGER = 1,
VIX_PROPERTYTYPE_STRING = 2,
VIX_PROPERTYTYPE_BOOL = 3,
VIX_PROPERTYTYPE_HANDLE = 4,
VIX_PROPERTYTYPE_INT64 = 5,
VIX_PROPERTYTYPE_BLOB = 6
};
/*
* VIX Property ID's
*/
typedef int VixPropertyID;
enum {
VIX_PROPERTY_NONE = 0,
/* Properties used by several handle types. */
VIX_PROPERTY_META_DATA_CONTAINER = 2,
/* VIX_HANDLETYPE_HOST properties */
VIX_PROPERTY_HOST_HOSTTYPE = 50,
VIX_PROPERTY_HOST_API_VERSION = 51,
/* VIX_HANDLETYPE_VM properties */
VIX_PROPERTY_VM_NUM_VCPUS = 101,
VIX_PROPERTY_VM_VMX_PATHNAME = 103,
VIX_PROPERTY_VM_VMTEAM_PATHNAME = 105,
VIX_PROPERTY_VM_MEMORY_SIZE = 106,
VIX_PROPERTY_VM_READ_ONLY = 107,
VIX_PROPERTY_VM_IN_VMTEAM = 128,
VIX_PROPERTY_VM_POWER_STATE = 129,
VIX_PROPERTY_VM_TOOLS_STATE = 152,
VIX_PROPERTY_VM_IS_RUNNING = 196,
VIX_PROPERTY_VM_SUPPORTED_FEATURES = 197,
VIX_PROPERTY_VM_IS_RECORDING = 236,
VIX_PROPERTY_VM_IS_REPLAYING = 237,
/* Result properties; these are returned by various procedures */
VIX_PROPERTY_JOB_RESULT_ERROR_CODE = 3000,
VIX_PROPERTY_JOB_RESULT_VM_IN_GROUP = 3001,
VIX_PROPERTY_JOB_RESULT_USER_MESSAGE = 3002,
VIX_PROPERTY_JOB_RESULT_EXIT_CODE = 3004,
VIX_PROPERTY_JOB_RESULT_COMMAND_OUTPUT = 3005,
VIX_PROPERTY_JOB_RESULT_HANDLE = 3010,
VIX_PROPERTY_JOB_RESULT_GUEST_OBJECT_EXISTS = 3011,
VIX_PROPERTY_JOB_RESULT_GUEST_PROGRAM_ELAPSED_TIME = 3017,
VIX_PROPERTY_JOB_RESULT_GUEST_PROGRAM_EXIT_CODE = 3018,
VIX_PROPERTY_JOB_RESULT_ITEM_NAME = 3035,
VIX_PROPERTY_JOB_RESULT_FOUND_ITEM_DESCRIPTION = 3036,
VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_COUNT = 3046,
VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_HOST = 3048,
VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_FLAGS = 3049,
VIX_PROPERTY_JOB_RESULT_PROCESS_ID = 3051,
VIX_PROPERTY_JOB_RESULT_PROCESS_OWNER = 3052,
VIX_PROPERTY_JOB_RESULT_PROCESS_COMMAND = 3053,
VIX_PROPERTY_JOB_RESULT_FILE_FLAGS = 3054,
VIX_PROPERTY_JOB_RESULT_PROCESS_START_TIME = 3055,
VIX_PROPERTY_JOB_RESULT_VM_VARIABLE_STRING = 3056,
VIX_PROPERTY_JOB_RESULT_PROCESS_BEING_DEBUGGED = 3057,
VIX_PROPERTY_JOB_RESULT_SCREEN_IMAGE_SIZE = 3058,
VIX_PROPERTY_JOB_RESULT_SCREEN_IMAGE_DATA = 3059,
VIX_PROPERTY_JOB_RESULT_FILE_SIZE = 3061,
VIX_PROPERTY_JOB_RESULT_FILE_MOD_TIME = 3062,
/* Event properties; these are sent in the moreEventInfo for some events. */
VIX_PROPERTY_FOUND_ITEM_LOCATION = 4010,
/* VIX_HANDLETYPE_SNAPSHOT properties */
VIX_PROPERTY_SNAPSHOT_DISPLAYNAME = 4200,
VIX_PROPERTY_SNAPSHOT_DESCRIPTION = 4201,
VIX_PROPERTY_SNAPSHOT_POWERSTATE = 4205,
VIX_PROPERTY_SNAPSHOT_IS_REPLAYABLE = 4207,
VIX_PROPERTY_GUEST_SHAREDFOLDERS_SHARES_PATH = 4525,
/* Virtual machine encryption properties */
VIX_PROPERTY_VM_ENCRYPTION_PASSWORD = 7001,
};
/*
* These are events that may be signalled by calling a procedure
* of type VixEventProc.
*/
typedef int VixEventType;
enum {
VIX_EVENTTYPE_JOB_COMPLETED = 2,
VIX_EVENTTYPE_JOB_PROGRESS = 3,
VIX_EVENTTYPE_FIND_ITEM = 8,
VIX_EVENTTYPE_CALLBACK_SIGNALLED = 2, // Deprecated - Use VIX_EVENTTYPE_JOB_COMPLETED instead.
};
/*
* These are the property flags for each file.
*/
enum {
VIX_FILE_ATTRIBUTES_DIRECTORY = 0x0001,
VIX_FILE_ATTRIBUTES_SYMLINK = 0x0002,
};
/*
* Procedures of this type are called when an event happens on a handle.
*/
typedef void VixEventProc(VixHandle handle,
VixEventType eventType,
VixHandle moreEventInfo,
void *clientData);
/*
* Handle Property functions
*/
void Vix_ReleaseHandle(VixHandle handle);
void Vix_AddRefHandle(VixHandle handle);
VixHandleType Vix_GetHandleType(VixHandle handle);
VixError Vix_GetProperties(VixHandle handle,
VixPropertyID firstPropertyID, ...);
VixError Vix_GetPropertyType(VixHandle handle, VixPropertyID propertyID,
VixPropertyType *propertyType);
void Vix_FreeBuffer(void *p);
/*
*-----------------------------------------------------------------------------
*
* VIX Host --
*
*-----------------------------------------------------------------------------
*/
typedef int VixHostOptions;
enum {
VIX_HOSTOPTION_USE_EVENT_PUMP = 0x0008,
};
typedef int VixServiceProvider;
enum {
VIX_SERVICEPROVIDER_DEFAULT = 1,
VIX_SERVICEPROVIDER_VMWARE_SERVER = 2,
VIX_SERVICEPROVIDER_VMWARE_WORKSTATION = 3,
VIX_SERVICEPROVIDER_VMWARE_PLAYER = 4,
VIX_SERVICEPROVIDER_VMWARE_VI_SERVER = 10,
};
/*
* VIX_API_VERSION tells VixHost_Connect to use the latest API version
* that is available for the product specified in the VixServiceProvider
* parameter.
*/
enum {
VIX_API_VERSION = -1
};
VixHandle VixHost_Connect(int apiVersion,
VixServiceProvider hostType,
const char *hostName,
int hostPort,
const char *userName,
const char *password,
VixHostOptions options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
void VixHost_Disconnect(VixHandle hostHandle);
/*
* VM Registration
*/
VixHandle VixHost_RegisterVM(VixHandle hostHandle,
const char *vmxFilePath,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixHost_UnregisterVM(VixHandle hostHandle,
const char *vmxFilePath,
VixEventProc *callbackProc,
void *clientData);
/*
* VM Search
*/
typedef int VixFindItemType;
enum {
VIX_FIND_RUNNING_VMS = 1,
VIX_FIND_REGISTERED_VMS = 4,
};
VixHandle VixHost_FindItems(VixHandle hostHandle,
VixFindItemType searchType,
VixHandle searchCriteria,
int32 timeout,
VixEventProc *callbackProc,
void *clientData);
/*
* VixHost_OpenVM() supercedes VixVM_Open() since it allows for
* the passing of option flags and extra data in the form of a
* property list.
* It is recommended to use VixHost_OpenVM() instead of VixVM_Open().
*/
typedef int VixVMOpenOptions;
enum {
VIX_VMOPEN_NORMAL = 0x0,
};
VixHandle VixHost_OpenVM(VixHandle hostHandle,
const char *vmxFilePathName,
VixVMOpenOptions options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
/*
* Event pump
*/
typedef int VixPumpEventsOptions;
enum {
VIX_PUMPEVENTOPTION_NONE = 0,
};
void Vix_PumpEvents(VixHandle hostHandle, VixPumpEventsOptions options);
/*
*-----------------------------------------------------------------------------
*
* PropertyList --
*
*-----------------------------------------------------------------------------
*/
#ifndef VIX_HIDE_FROM_JAVA
VixError VixPropertyList_AllocPropertyList(VixHandle hostHandle,
VixHandle *resultHandle,
int firstPropertyID,
...);
#endif
/*
*-----------------------------------------------------------------------------
*
* VIX VM --
*
* This describes the persistent configuration state of a single VM. The
* VM may or may not be running.
*
*-----------------------------------------------------------------------------
*/
VixHandle VixVM_Open(VixHandle hostHandle,
const char *vmxFilePathName,
VixEventProc *callbackProc,
void *clientData);
typedef int VixVMPowerOpOptions;
enum {
VIX_VMPOWEROP_NORMAL = 0,
VIX_VMPOWEROP_FROM_GUEST = 0x0004,
VIX_VMPOWEROP_SUPPRESS_SNAPSHOT_POWERON = 0x0080,
VIX_VMPOWEROP_LAUNCH_GUI = 0x0200,
VIX_VMPOWEROP_START_VM_PAUSED = 0x1000,
};
/*
* Power operations
*/
VixHandle VixVM_PowerOn(VixHandle vmHandle,
VixVMPowerOpOptions powerOnOptions,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_PowerOff(VixHandle vmHandle,
VixVMPowerOpOptions powerOffOptions,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_Reset(VixHandle vmHandle,
VixVMPowerOpOptions resetOptions,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_Suspend(VixHandle vmHandle,
VixVMPowerOpOptions suspendOptions,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_Pause(VixHandle vmHandle,
int options,
VixHandle propertyList,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_Unpause(VixHandle vmHandle,
int options,
VixHandle propertyList,
VixEventProc *callbackProc,
void *clientData);
typedef int VixVMDeleteOptions;
enum {
VIX_VMDELETE_DISK_FILES = 0x0002,
};
VixHandle VixVM_Delete(VixHandle vmHandle,
VixVMDeleteOptions deleteOptions,
VixEventProc *callbackProc,
void *clientData);
/*
* This is the state of an individual VM. These values are bitwise flags.
* The actual value returned for may be a bitwise OR of one more of these
* flags, along with other reserved values not documented here.
*/
typedef int VixPowerState;
enum {
VIX_POWERSTATE_POWERING_OFF = 0x0001,
VIX_POWERSTATE_POWERED_OFF = 0x0002,
VIX_POWERSTATE_POWERING_ON = 0x0004,
VIX_POWERSTATE_POWERED_ON = 0x0008,
VIX_POWERSTATE_SUSPENDING = 0x0010,
VIX_POWERSTATE_SUSPENDED = 0x0020,
VIX_POWERSTATE_TOOLS_RUNNING = 0x0040,
VIX_POWERSTATE_RESETTING = 0x0080,
VIX_POWERSTATE_BLOCKED_ON_MSG = 0x0100,
VIX_POWERSTATE_PAUSED = 0x0200,
VIX_POWERSTATE_RESUMING = 0x0800,
};
typedef int VixToolsState;
enum {
VIX_TOOLSSTATE_UNKNOWN = 0x0001,
VIX_TOOLSSTATE_RUNNING = 0x0002,
VIX_TOOLSSTATE_NOT_INSTALLED = 0x0004,
};
/*
* These flags describe optional functions supported by different
* types of VM.
*/
enum {
VIX_VM_SUPPORT_SHARED_FOLDERS = 0x0001,
VIX_VM_SUPPORT_MULTIPLE_SNAPSHOTS = 0x0002,
VIX_VM_SUPPORT_TOOLS_INSTALL = 0x0004,
VIX_VM_SUPPORT_HARDWARE_UPGRADE = 0x0008,
};
/*
* VIX_ADMINISTRATOR_USER_NAME and VIX_CONSOLE_USER_NAME are no longer
* supported. If your code includes references to these constants please
* update your code to use a valid guest username and password when calling
* VixVM_LoginInGuest().
*/
//#define VIX_ADMINISTRATOR_USER_NAME "__VMware_Vix_Guest_User_Admin__"
//#define VIX_CONSOLE_USER_NAME "__VMware_Vix_Guest_Console_User__"
/*
* Record/replay operations
*/
VixHandle VixVM_BeginRecording(VixHandle vmHandle,
const char *displayName,
const char *description,
int options,
VixHandle propertyList,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_EndRecording(VixHandle vmHandle,
int options,
VixHandle propertyList,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_BeginReplay(VixHandle vmHandle,
VixHandle snapshotHandle,
int options,
VixHandle propertyList,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_EndReplay(VixHandle vmHandle,
int options,
VixHandle propertyList,
VixEventProc *callbackProc,
void *clientData);
/*
* Guest operations
*/
VixHandle VixVM_WaitForToolsInGuest(VixHandle vmHandle,
int timeoutInSeconds,
VixEventProc *callbackProc,
void *clientData);
/*
* VixVM_LoginInGuest option flags.
*/
enum {
VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT = 0x08,
};
VixHandle VixVM_LoginInGuest(VixHandle vmHandle,
const char *userName,
const char *password,
int options,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_LogoutFromGuest(VixHandle vmHandle,
VixEventProc *callbackProc,
void *clientData);
/*
* Guest Process functions
*/
typedef int VixRunProgramOptions;
enum {
VIX_RUNPROGRAM_RETURN_IMMEDIATELY = 0x0001,
VIX_RUNPROGRAM_ACTIVATE_WINDOW = 0x0002,
};
VixHandle VixVM_RunProgramInGuest(VixHandle vmHandle,
const char *guestProgramName,
const char *commandLineArgs,
VixRunProgramOptions options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_ListProcessesInGuest(VixHandle vmHandle,
int options,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_KillProcessInGuest(VixHandle vmHandle,
uint64 pid,
int options,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_RunScriptInGuest(VixHandle vmHandle,
const char *interpreter,
const char *scriptText,
VixRunProgramOptions options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_OpenUrlInGuest(VixHandle vmHandle,
const char *url,
int windowState,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
/*
* Guest File functions
*/
VixHandle VixVM_CopyFileFromHostToGuest(VixHandle vmHandle,
const char *hostPathName,
const char *guestPathName,
int options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_CopyFileFromGuestToHost(VixHandle vmHandle,
const char *guestPathName,
const char *hostPathName,
int options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_DeleteFileInGuest(VixHandle vmHandle,
const char *guestPathName,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_FileExistsInGuest(VixHandle vmHandle,
const char *guestPathName,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_RenameFileInGuest(VixHandle vmHandle,
const char *oldName,
const char *newName,
int options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_CreateTempFileInGuest(VixHandle vmHandle,
int options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_GetFileInfoInGuest(VixHandle vmHandle,
const char *pathName,
VixEventProc *callbackProc,
void *clientData);
/*
* Guest Directory functions
*/
VixHandle VixVM_ListDirectoryInGuest(VixHandle vmHandle,
const char *pathName,
int options,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_CreateDirectoryInGuest(VixHandle vmHandle,
const char *pathName,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_DeleteDirectoryInGuest(VixHandle vmHandle,
const char *pathName,
int options,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_DirectoryExistsInGuest(VixHandle vmHandle,
const char *pathName,
VixEventProc *callbackProc,
void *clientData);
/*
* Guest Variable Functions
*/
enum {
VIX_VM_GUEST_VARIABLE = 1,
VIX_VM_CONFIG_RUNTIME_ONLY = 2,
VIX_GUEST_ENVIRONMENT_VARIABLE = 3,
};
VixHandle VixVM_ReadVariable(VixHandle vmHandle,
int variableType,
const char *name,
int options,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_WriteVariable(VixHandle vmHandle,
int variableType,
const char *valueName,
const char *value,
int options,
VixEventProc *callbackProc,
void *clientData);
/*
* Snapshot functions that operate on a VM
*/
VixError VixVM_GetNumRootSnapshots(VixHandle vmHandle,
int *result);
VixError VixVM_GetRootSnapshot(VixHandle vmHandle,
int index,
VixHandle *snapshotHandle);
VixError VixVM_GetCurrentSnapshot(VixHandle vmHandle,
VixHandle *snapshotHandle);
VixError VixVM_GetNamedSnapshot(VixHandle vmHandle,
const char *name,
VixHandle *snapshotHandle);
typedef int VixRemoveSnapshotOptions;
enum {
VIX_SNAPSHOT_REMOVE_CHILDREN = 0x0001,
};
VixHandle VixVM_RemoveSnapshot(VixHandle vmHandle,
VixHandle snapshotHandle,
VixRemoveSnapshotOptions options,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_RevertToSnapshot(VixHandle vmHandle,
VixHandle snapshotHandle,
VixVMPowerOpOptions options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
typedef int VixCreateSnapshotOptions;
enum {
VIX_SNAPSHOT_INCLUDE_MEMORY = 0x0002,
};
VixHandle VixVM_CreateSnapshot(VixHandle vmHandle,
const char *name,
const char *description,
VixCreateSnapshotOptions options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
/*
* Shared Folders Functions
*/
/*
* These are the flags describing each shared folder.
*/
typedef int VixMsgSharedFolderOptions;
enum {
VIX_SHAREDFOLDER_WRITE_ACCESS = 0x04,
};
VixHandle VixVM_EnableSharedFolders(VixHandle vmHandle,
Bool enabled,
int options,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_GetNumSharedFolders(VixHandle vmHandle,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_GetSharedFolderState(VixHandle vmHandle,
int index,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_SetSharedFolderState(VixHandle vmHandle,
const char *shareName,
const char *hostPathName,
VixMsgSharedFolderOptions flags,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_AddSharedFolder(VixHandle vmHandle,
const char *shareName,
const char *hostPathName,
VixMsgSharedFolderOptions flags,
VixEventProc *callbackProc,
void *clientData);
VixHandle VixVM_RemoveSharedFolder(VixHandle vmHandle,
const char *shareName,
int flags,
VixEventProc *callbackProc,
void *clientData);
/*
* Screen Capture
*/
#ifndef VIX_HIDE_FROM_JAVA
enum {
VIX_CAPTURESCREENFORMAT_PNG = 0x01,
VIX_CAPTURESCREENFORMAT_PNG_NOCOMPRESS = 0x02,
};
VixHandle VixVM_CaptureScreenImage(VixHandle vmHandle,
int captureType,
VixHandle additionalProperties,
VixEventProc *callbackProc,
void *clientdata);
#endif // VIX_HIDE_FROM_JAVA
/*
* VM Cloning --
*/
typedef int VixCloneType;
enum {
VIX_CLONETYPE_FULL = 0,
VIX_CLONETYPE_LINKED = 1,
};
VixHandle VixVM_Clone(VixHandle vmHandle,
VixHandle snapshotHandle,
VixCloneType cloneType,
const char *destConfigPathName,
int options,
VixHandle propertyListHandle,
VixEventProc *callbackProc,
void *clientData);
/*
* Misc Functions
*/
VixHandle VixVM_UpgradeVirtualHardware(VixHandle vmHandle,
int options,
VixEventProc *callbackProc,
void *clientData);
enum {
VIX_INSTALLTOOLS_MOUNT_TOOLS_INSTALLER = 0x00,
VIX_INSTALLTOOLS_AUTO_UPGRADE = 0x01,
VIX_INSTALLTOOLS_RETURN_IMMEDIATELY = 0x02
};
VixHandle VixVM_InstallTools(VixHandle vmHandle,
int options,
const char *commandLineArgs,
VixEventProc *callbackProc,
void *clientData);
/*
*-----------------------------------------------------------------------------
*
* VIX Job --
*
*-----------------------------------------------------------------------------
*/
/*
* Synchronization functions
* (used to detect when an asynch operation completes).
*/
VixError VixJob_Wait(VixHandle jobHandle,
VixPropertyID firstPropertyID,
...);
VixError VixJob_CheckCompletion(VixHandle jobHandle,
Bool *complete);
/*
* Accessor functions
* (used to get results of a completed asynch operation).
*/
VixError VixJob_GetError(VixHandle jobHandle);
int VixJob_GetNumProperties(VixHandle jobHandle,
int resultPropertyID);
VixError VixJob_GetNthProperties(VixHandle jobHandle,
int index,
int propertyID,
...);
/*
*-----------------------------------------------------------------------------
*
* VIX Snapshot --
*
*-----------------------------------------------------------------------------
*/
VixError VixSnapshot_GetNumChildren(VixHandle parentSnapshotHandle,
int *numChildSnapshots);
VixError VixSnapshot_GetChild(VixHandle parentSnapshotHandle,
int index,
VixHandle *childSnapshotHandle);
VixError VixSnapshot_GetParent(VixHandle snapshotHandle,
VixHandle *parentSnapshotHandle);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _VIX_H_ */
|