2009-09-22 17:48:40 +00:00
|
|
|
/*
|
|
|
|
* 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 */
|
|
|
|
|
2009-09-23 11:10:58 +00:00
|
|
|
int qemuMonitorStartCPUs(virConnectPtr conn,
|
2009-09-22 17:48:40 +00:00
|
|
|
const virDomainObjPtr vm);
|
2009-09-23 11:14:53 +00:00
|
|
|
int qemuMonitorStopCPUs(const virDomainObjPtr vm);
|
2009-09-22 17:48:40 +00:00
|
|
|
|
2009-09-23 11:21:00 +00:00
|
|
|
int qemuMonitorSystemPowerdown(const virDomainObjPtr vm);
|
|
|
|
|
2009-09-23 10:49:14 +00:00
|
|
|
int qemuMonitorGetCPUInfo(const virDomainObjPtr vm,
|
|
|
|
int **pids);
|
2009-09-23 11:29:39 +00:00
|
|
|
int qemuMonitorGetBalloonInfo(const virDomainObjPtr vm,
|
|
|
|
unsigned long *currmem);
|
2009-09-23 12:51:05 +00:00
|
|
|
int qemuMonitorGetBlockStatsInfo(const virDomainObjPtr vm,
|
|
|
|
const char *devname,
|
|
|
|
long long *rd_req,
|
|
|
|
long long *rd_bytes,
|
|
|
|
long long *wr_req,
|
|
|
|
long long *wr_bytes,
|
|
|
|
long long *errs);
|
|
|
|
|
2009-09-22 17:48:40 +00:00
|
|
|
|
2009-09-23 11:06:57 +00:00
|
|
|
int qemuMonitorSetVNCPassword(const virDomainObjPtr vm,
|
|
|
|
const char *password);
|
2009-09-23 11:35:10 +00:00
|
|
|
int qemuMonitorSetBalloon(const virDomainObjPtr vm,
|
|
|
|
unsigned long newmem);
|
2009-09-23 11:06:57 +00:00
|
|
|
|
2009-09-23 11:51:59 +00:00
|
|
|
/* XXX should we pass the virDomainDiskDefPtr instead
|
|
|
|
* and hide devname details inside monitor. Reconsider
|
|
|
|
* this when doing the QMP implementation
|
|
|
|
*/
|
|
|
|
int qemuMonitorEjectMedia(const virDomainObjPtr vm,
|
|
|
|
const char *devname);
|
|
|
|
int qemuMonitorChangeMedia(const virDomainObjPtr vm,
|
|
|
|
const char *devname,
|
|
|
|
const char *newmedia);
|
|
|
|
|
2009-09-23 12:33:45 +00:00
|
|
|
|
|
|
|
int qemuMonitorSaveVirtualMemory(const virDomainObjPtr vm,
|
|
|
|
unsigned long long offset,
|
|
|
|
size_t length,
|
|
|
|
const char *path);
|
|
|
|
int qemuMonitorSavePhysicalMemory(const virDomainObjPtr vm,
|
|
|
|
unsigned long long offset,
|
|
|
|
size_t length,
|
|
|
|
const char *path);
|
|
|
|
|
2009-09-23 12:57:56 +00:00
|
|
|
int qemuMonitorSetMigrationSpeed(const virDomainObjPtr vm,
|
|
|
|
unsigned long bandwidth);
|
|
|
|
|
2009-09-23 13:27:12 +00:00
|
|
|
enum {
|
|
|
|
QEMU_MONITOR_MIGRATION_STATUS_INACTIVE,
|
|
|
|
QEMU_MONITOR_MIGRATION_STATUS_ACTIVE,
|
|
|
|
QEMU_MONITOR_MIGRATION_STATUS_COMPLETED,
|
|
|
|
QEMU_MONITOR_MIGRATION_STATUS_ERROR,
|
|
|
|
QEMU_MONITOR_MIGRATION_STATUS_CANCELLED,
|
|
|
|
|
|
|
|
QEMU_MONITOR_MIGRATION_STATUS_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
int qemuMonitorGetMigrationStatus(const virDomainObjPtr vm,
|
|
|
|
int *status,
|
|
|
|
unsigned long long *transferred,
|
|
|
|
unsigned long long *remaining,
|
|
|
|
unsigned long long *total);
|
|
|
|
|
2009-09-23 13:48:49 +00:00
|
|
|
int qemuMonitorMigrateToHost(const virDomainObjPtr vm,
|
|
|
|
const char *hostname,
|
|
|
|
int port);
|
|
|
|
|
2009-09-23 14:23:47 +00:00
|
|
|
int qemuMonitorMigrateToCommand(const virDomainObjPtr vm,
|
|
|
|
const char * const *argv,
|
|
|
|
const char *target);
|
|
|
|
|
2009-09-23 14:38:43 +00:00
|
|
|
|
2009-09-23 15:38:44 +00:00
|
|
|
/* XXX disk driver type eg, qcow/etc.
|
|
|
|
* XXX cache mode
|
|
|
|
*/
|
2009-09-23 14:38:43 +00:00
|
|
|
int qemuMonitorAddUSBDisk(const virDomainObjPtr vm,
|
|
|
|
const char *path);
|
|
|
|
|
2009-09-23 15:04:55 +00:00
|
|
|
int qemuMonitorAddUSBDeviceExact(const virDomainObjPtr vm,
|
|
|
|
int bus,
|
|
|
|
int dev);
|
|
|
|
int qemuMonitorAddUSBDeviceMatch(const virDomainObjPtr vm,
|
|
|
|
int vendor,
|
|
|
|
int product);
|
|
|
|
|
2009-09-23 15:15:51 +00:00
|
|
|
|
|
|
|
int qemuMonitorAddPCIHostDevice(const virDomainObjPtr vm,
|
|
|
|
unsigned hostDomain,
|
|
|
|
unsigned hostBus,
|
|
|
|
unsigned hostSlot,
|
|
|
|
unsigned hostFunction,
|
|
|
|
unsigned *guestDomain,
|
|
|
|
unsigned *guestBus,
|
|
|
|
unsigned *guestSlot);
|
|
|
|
|
2009-09-23 15:38:44 +00:00
|
|
|
/* XXX disk driver type eg, qcow/etc.
|
|
|
|
* XXX cache mode
|
|
|
|
*/
|
|
|
|
int qemuMonitorAddPCIDisk(const virDomainObjPtr vm,
|
|
|
|
const char *path,
|
|
|
|
const char *bus,
|
|
|
|
unsigned *guestDomain,
|
|
|
|
unsigned *guestBus,
|
|
|
|
unsigned *guestSlot);
|
|
|
|
|
2009-09-23 16:01:39 +00:00
|
|
|
/* XXX do we really want to hardcode 'nicstr' as the
|
|
|
|
* sendable item here
|
|
|
|
*/
|
|
|
|
int qemuMonitorAddPCINetwork(const virDomainObjPtr vm,
|
|
|
|
const char *nicstr,
|
|
|
|
unsigned *guestDomain,
|
|
|
|
unsigned *guestBus,
|
|
|
|
unsigned *guestSlot);
|
|
|
|
|
2009-09-23 15:25:05 +00:00
|
|
|
int qemuMonitorRemovePCIDevice(const virDomainObjPtr vm,
|
|
|
|
unsigned guestDomain,
|
|
|
|
unsigned guestBus,
|
|
|
|
unsigned guestSlot);
|
|
|
|
|
|
|
|
|
2009-09-23 15:51:10 +00:00
|
|
|
int qemuMonitorSendFileHandle(const virDomainObjPtr vm,
|
|
|
|
const char *fdname,
|
|
|
|
int fd);
|
|
|
|
|
|
|
|
int qemuMonitorCloseFileHandle(const virDomainObjPtr vm,
|
|
|
|
const char *fdname);
|
2009-09-23 15:15:51 +00:00
|
|
|
|
2009-09-23 10:49:14 +00:00
|
|
|
#endif /* QEMU_MONITOR_TEXT_H */
|