qemu_process.h 3.7 KB
Newer Older
1 2 3
/*
 * qemu_process.c: QEMU process management
 *
4
 * Copyright (C) 2006-2012 Red Hat, Inc.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 *
 * 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
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 *
 */

#ifndef __QEMU_PROCESS_H__
# define __QEMU_PROCESS_H__

# include "qemu_conf.h"
26
# include "qemu_domain.h"
27 28 29 30 31

int qemuProcessPrepareMonitorChr(struct qemud_driver *driver,
                                 virDomainChrSourceDefPtr monConfig,
                                 const char *vm);

J
Jiri Denemark 已提交
32 33 34
int qemuProcessStartCPUs(struct qemud_driver *driver,
                         virDomainObjPtr vm,
                         virConnectPtr conn,
35 36
                         virDomainRunningReason reason,
                         enum qemuDomainAsyncJob asyncJob);
J
Jiri Denemark 已提交
37 38
int qemuProcessStopCPUs(struct qemud_driver *driver,
                        virDomainObjPtr vm,
39 40
                        virDomainPausedReason reason,
                        enum qemuDomainAsyncJob asyncJob);
41 42 43 44 45 46 47 48 49 50

void qemuProcessAutostartAll(struct qemud_driver *driver);
void qemuProcessReconnectAll(virConnectPtr conn, struct qemud_driver *driver);

int qemuProcessAssignPCIAddresses(virDomainDefPtr def);

int qemuProcessStart(virConnectPtr conn,
                     struct qemud_driver *driver,
                     virDomainObjPtr vm,
                     const char *migrateFrom,
51
                     bool cold_boot,
52
                     bool start_paused,
53
                     bool autodestroy,
54 55
                     int stdin_fd,
                     const char *stdin_path,
56
                     virDomainSnapshotObjPtr snapshot,
57
                     enum virNetDevVPortProfileOp vmop);
58 59 60

void qemuProcessStop(struct qemud_driver *driver,
                     virDomainObjPtr vm,
J
Jiri Denemark 已提交
61 62
                     int migrated,
                     virDomainShutoffReason reason);
63

64 65 66
int qemuProcessAttach(virConnectPtr conn,
                      struct qemud_driver *driver,
                      virDomainObjPtr vm,
67
                      pid_t pid,
68 69 70 71
                      const char *pidfile,
                      virDomainChrSourceDefPtr monConfig,
                      bool monJSON);

72 73 74
typedef enum {
   VIR_QEMU_PROCESS_KILL_FORCE  = 1 << 0,
   VIR_QEMU_PROCESS_KILL_NOWAIT = 1 << 1,
75
   VIR_QEMU_PROCESS_KILL_NOCHECK = 1 << 2, /* bypass the running vm check */
76 77
} virQemuProcessKillMode;

78 79
int qemuProcessKill(struct qemud_driver *driver,
                    virDomainObjPtr vm, unsigned int flags);
80

81 82 83 84 85 86 87 88 89
int qemuProcessAutoDestroyInit(struct qemud_driver *driver);
void qemuProcessAutoDestroyRun(struct qemud_driver *driver,
                               virConnectPtr conn);
void qemuProcessAutoDestroyShutdown(struct qemud_driver *driver);
int qemuProcessAutoDestroyAdd(struct qemud_driver *driver,
                              virDomainObjPtr vm,
                              virConnectPtr conn);
int qemuProcessAutoDestroyRemove(struct qemud_driver *driver,
                                 virDomainObjPtr vm);
90 91
bool qemuProcessAutoDestroyActive(struct qemud_driver *driver,
                                  virDomainObjPtr vm);
92

93
#endif /* __QEMU_PROCESS_H__ */