vmware_conf.h 2.5 KB
Newer Older
E
Eric Blake 已提交
1 2 3
/*
 * Copyright (C) 2014 Red Hat, Inc.
 * Copyright 2010, diateam (www.diateam.net)
4
 * Copyright (c) 2013, Doug Goldstein (cardoe@cardoe.com)
5 6 7 8 9 10 11 12 13 14 15 16
 *
 * This library 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; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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 GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with this library.  If not, see
O
Osier Yang 已提交
18
 * <http://www.gnu.org/licenses/>.
19 20
 */

21 22
#ifndef LIBVIRT_VMWARE_CONF_H
# define LIBVIRT_VMWARE_CONF_H
23 24 25 26

# define NOGUI "nogui"

# include "internal.h"
27
# include "virdomainobjlist.h"
28
# include "virthread.h"
29 30

# define VIR_FROM_THIS VIR_FROM_VMWARE
E
Eric Blake 已提交
31
# define PROGRAM_SENTINEL ((char *)0x1)
32

33 34 35
enum vmwareDriverType {
    VMWARE_DRIVER_PLAYER      = 0, /* VMware Player */
    VMWARE_DRIVER_WORKSTATION = 1, /* VMware Workstation */
36
    VMWARE_DRIVER_FUSION      = 2, /* VMware Fusion */
37 38 39 40 41

    VMWARE_DRIVER_LAST,            /* required last item */
};

VIR_ENUM_DECL(vmwareDriver)
42 43 44 45

struct vmware_driver {
    virMutex lock;
    virCapsPtr caps;
46
    virDomainXMLOptionPtr xmlopt;
47

48
    virDomainObjListPtr domains;
49
    unsigned long version;
50
    int type;
51
    char *vmrun;
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
};

typedef struct _vmwareDomain {
    char *vmxPath;
    bool gui;

} vmwareDomain, *vmwareDomainPtr;

void vmwareFreeDriver(struct vmware_driver *driver);

virCapsPtr vmwareCapsInit(void);

int vmwareLoadDomains(struct vmware_driver *driver);

void vmwareSetSentinal(const char **prog, const char *key);

int vmwareExtractVersion(struct vmware_driver *driver);

70 71
int vmwareParseVersionStr(int type, const char *buf, unsigned long *version);

72 73 74 75 76 77 78 79 80 81 82 83 84 85
int vmwareDomainConfigDisplay(vmwareDomainPtr domain, virDomainDefPtr vmdef);

int vmwareConstructVmxPath(char *directoryName, char *name,
                           char **vmxPath);

int vmwareVmxPath(virDomainDefPtr vmdef, char **vmxPath);

int vmwareMoveFile(char *srcFile, char *dstFile);

int vmwareMakePath(char *srcDir, char *srcName, char *srcExt,
                   char **outpath);

int vmwareExtractPid(const char * vmxPath);

86
char *vmwareCopyVMXFileName(const char *datastorePath, void *opaque);
87

88
#endif /* LIBVIRT_VMWARE_CONF_H */