qemu_monitor_text.h 2.9 KB
Newer Older
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
/*
 * qemu_monitor_text.h: interaction with QEMU monitor console
 *
 * Copyright (C) 2006-2009 Red Hat, Inc.
 * Copyright (C) 2006 Daniel P. Berrange
 *
 * 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
 *
 * Author: Daniel P. Berrange <berrange@redhat.com>
 */


#ifndef QEMU_MONITOR_TEXT_H
#define QEMU_MONITOR_TEXT_H

#include "internal.h"

#include "domain_conf.h"

/* XXX remove these two from public header */
#define QEMU_CMD_PROMPT "\n(qemu) "
#define QEMU_PASSWD_PROMPT "Password: "

/* Return -1 for error, 0 for success */
typedef int qemudMonitorExtraPromptHandler(const virDomainObjPtr vm,
                                           const char *buf,
                                           const char *prompt,
                                           void *data);

/* These first 4 APIs are generic monitor interaction. They will
 * go away eventually
 */
int qemudMonitorCommand(const virDomainObjPtr vm,
                        const char *cmd,
                        char **reply);
int qemudMonitorCommandWithFd(const virDomainObjPtr vm,
                              const char *cmd,
                              int scm_fd,
                              char **reply);
int qemudMonitorCommandWithHandler(const virDomainObjPtr vm,
                                   const char *cmd,
                                   const char *extraPrompt,
                                   qemudMonitorExtraPromptHandler extraHandler,
                                   void *handlerData,
                                   int scm_fd,
                                   char **reply);
int qemudMonitorCommandExtra(const virDomainObjPtr vm,
                             const char *cmd,
                             const char *extra,
                             const char *extraPrompt,
                             int scm_fd,
                             char **reply);

/* Formal APIs for each required monitor command */

68
int qemuMonitorStartCPUs(virConnectPtr conn,
69
                         const virDomainObjPtr vm);
70
int qemuMonitorStopCPUs(const virDomainObjPtr vm);
71

72 73
int qemuMonitorGetCPUInfo(const virDomainObjPtr vm,
                          int **pids);
74

75 76 77
int qemuMonitorSetVNCPassword(const virDomainObjPtr vm,
                              const char *password);

78
#endif /* QEMU_MONITOR_TEXT_H */