qemu_monitor_json.h 28.8 KB
Newer Older
D
Daniel P. Berrange 已提交
1 2 3
/*
 * qemu_monitor_json.h: interaction with QEMU monitor console
 *
4
 * Copyright (C) 2006-2009, 2011-2015 Red Hat, Inc.
D
Daniel P. Berrange 已提交
5 6 7 8 9 10 11 12 13 14 15 16 17
 * 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
18
 * License along with this library.  If not, see
O
Osier Yang 已提交
19
 * <http://www.gnu.org/licenses/>.
D
Daniel P. Berrange 已提交
20 21
 */

22
#pragma once
D
Daniel P. Berrange 已提交
23

24
#include "internal.h"
D
Daniel P. Berrange 已提交
25

26 27 28 29
#include "qemu_monitor.h"
#include "virbitmap.h"
#include "cpu/cpu.h"
#include "util/virgic.h"
D
Daniel P. Berrange 已提交
30

31 32 33 34
int qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
                                 const char *line,
                                 qemuMonitorMessagePtr msg);

D
Daniel P. Berrange 已提交
35 36 37 38 39
int qemuMonitorJSONIOProcess(qemuMonitorPtr mon,
                             const char *data,
                             size_t len,
                             qemuMonitorMessagePtr msg);

40 41 42
int qemuMonitorJSONHumanCommand(qemuMonitorPtr mon,
                                const char *cmd,
                                char **reply);
43

44 45
int qemuMonitorJSONSetCapabilities(qemuMonitorPtr mon);

46
int qemuMonitorJSONStartCPUs(qemuMonitorPtr mon);
D
Daniel P. Berrange 已提交
47
int qemuMonitorJSONStopCPUs(qemuMonitorPtr mon);
48 49 50
int qemuMonitorJSONGetStatus(qemuMonitorPtr mon,
                             bool *running,
                             virDomainPausedReason *reason);
D
Daniel P. Berrange 已提交
51 52

int qemuMonitorJSONSystemPowerdown(qemuMonitorPtr mon);
53
int qemuMonitorJSONSystemReset(qemuMonitorPtr mon);
D
Daniel P. Berrange 已提交
54

55
int qemuMonitorJSONQueryCPUs(qemuMonitorPtr mon,
56
                             struct qemuMonitorQueryCpusEntry **entries,
57
                             size_t *nentries,
58 59
                             bool force,
                             bool fast);
60
int qemuMonitorJSONGetVirtType(qemuMonitorPtr mon,
61
                               virDomainVirtType *virtType);
62 63 64
int qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon,
                                         virDomainVideoDefPtr video,
                                         char *path);
65 66 67
int qemuMonitorJSONUpdateVideoVram64Size(qemuMonitorPtr mon,
                                         virDomainVideoDefPtr video,
                                         char *path);
D
Daniel P. Berrange 已提交
68
int qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon,
69
                                  unsigned long long *currmem);
70
int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
71
                                  char *balloonpath,
72 73
                                  virDomainMemoryStatPtr stats,
                                  unsigned int nr_stats);
74 75 76
int qemuMonitorJSONSetMemoryStatsPeriod(qemuMonitorPtr mon,
                                        char *balloonpath,
                                        int period);
77
int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon,
78
                                virHashTablePtr table);
79

80
virJSONValuePtr qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon);
81
int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
82
                                        virHashTablePtr hash,
83
                                        bool backingChain);
84
int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon,
85 86
                                            virHashTablePtr stats,
                                            bool backingChain);
87 88 89
int qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon,
                                                    virHashTablePtr stats);

90 91 92
virHashTablePtr
qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes);

93
virHashTablePtr
94 95
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon,
                                     bool supports_flat);
96

97
int qemuMonitorJSONBlockResize(qemuMonitorPtr mon,
98 99
                               const char *device,
                               const char *nodename,
100
                               unsigned long long size);
D
Daniel P. Berrange 已提交
101

102 103 104 105 106 107 108
int qemuMonitorJSONSetPassword(qemuMonitorPtr mon,
                               const char *protocol,
                               const char *password,
                               const char *action_if_connected);
int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon,
                                  const char *protocol,
                                  const char *expire_time);
D
Daniel P. Berrange 已提交
109
int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
110
                              unsigned long long newmem);
111
int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, int cpu, bool online);
D
Daniel P. Berrange 已提交
112 113

int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,
114
                              const char *dev_name,
115
                              bool force);
D
Daniel P. Berrange 已提交
116
int qemuMonitorJSONChangeMedia(qemuMonitorPtr mon,
117
                               const char *dev_name,
D
Daniel P. Berrange 已提交
118 119 120 121 122 123
                               const char *newmedia,
                               const char *format);


int qemuMonitorJSONSaveVirtualMemory(qemuMonitorPtr mon,
                                     unsigned long long offset,
124
                                     unsigned long long length,
D
Daniel P. Berrange 已提交
125 126 127
                                     const char *path);
int qemuMonitorJSONSavePhysicalMemory(qemuMonitorPtr mon,
                                      unsigned long long offset,
128
                                      unsigned long long length,
D
Daniel P. Berrange 已提交
129 130 131 132 133
                                      const char *path);

int qemuMonitorJSONSetMigrationSpeed(qemuMonitorPtr mon,
                                     unsigned long bandwidth);

134 135 136
int qemuMonitorJSONSetMigrationDowntime(qemuMonitorPtr mon,
                                        unsigned long long downtime);

137 138 139 140 141
int qemuMonitorJSONGetMigrationCacheSize(qemuMonitorPtr mon,
                                         unsigned long long *cacheSize);
int qemuMonitorJSONSetMigrationCacheSize(qemuMonitorPtr mon,
                                         unsigned long long cacheSize);

142
int qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon,
143
                                      virJSONValuePtr *params);
144
int qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon,
145
                                      virJSONValuePtr params);
146

147
int qemuMonitorJSONGetMigrationStats(qemuMonitorPtr mon,
148 149
                                     qemuMonitorMigrationStatsPtr stats,
                                     char **error);
D
Daniel P. Berrange 已提交
150

151 152
int qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon,
                                            char ***capabilities);
153
int qemuMonitorJSONSetMigrationCapabilities(qemuMonitorPtr mon,
154
                                            virJSONValuePtr caps);
155

A
Andrea Bolognani 已提交
156 157 158
int qemuMonitorJSONGetGICCapabilities(qemuMonitorPtr mon,
                                      virGICCapability **capabilities);

159 160 161
int qemuMonitorJSONGetSEVCapabilities(qemuMonitorPtr mon,
                                      virSEVCapability **capabilities);

162 163 164
int qemuMonitorJSONMigrate(qemuMonitorPtr mon,
                           unsigned int flags,
                           const char *uri);
165 166 167
int qemuMonitorJSONGetSpiceMigrationStatus(qemuMonitorPtr mon,
                                           bool *spice_migrated);

D
Daniel P. Berrange 已提交
168 169 170

int qemuMonitorJSONMigrateCancel(qemuMonitorPtr mon);

171 172 173
int qemuMonitorJSONQueryDump(qemuMonitorPtr mon,
                             qemuMonitorDumpStatsPtr stats);

174 175 176
int qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitorPtr mon,
                                                const char *capability);

177
int qemuMonitorJSONDump(qemuMonitorPtr mon,
178
                        const char *protocol,
179 180
                        const char *dumpformat,
                        bool detach);
181

182 183 184 185 186 187 188
int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon,
                                    int type,
                                    const char *hostname,
                                    int port,
                                    int tlsPort,
                                    const char *tlsSubject);

D
Daniel P. Berrange 已提交
189
int qemuMonitorJSONAddPCIHostDevice(qemuMonitorPtr mon,
190 191
                                    virPCIDeviceAddress *hostAddr,
                                    virPCIDeviceAddress *guestAddr);
D
Daniel P. Berrange 已提交
192 193 194 195

int qemuMonitorJSONAddPCIDisk(qemuMonitorPtr mon,
                              const char *path,
                              const char *bus,
196
                              virPCIDeviceAddress *guestAddr);
D
Daniel P. Berrange 已提交
197 198 199

int qemuMonitorJSONAddPCINetwork(qemuMonitorPtr mon,
                                 const char *nicstr,
200
                                 virPCIDeviceAddress *guestAddr);
D
Daniel P. Berrange 已提交
201 202

int qemuMonitorJSONRemovePCIDevice(qemuMonitorPtr mon,
203
                                   virPCIDeviceAddress *guestAddr);
D
Daniel P. Berrange 已提交
204 205 206 207 208 209 210 211

int qemuMonitorJSONSendFileHandle(qemuMonitorPtr mon,
                                  const char *fdname,
                                  int fd);

int qemuMonitorJSONCloseFileHandle(qemuMonitorPtr mon,
                                   const char *fdname);

212 213 214 215 216 217
int qemuMonitorJSONAddNetdev(qemuMonitorPtr mon,
                             const char *netdevstr);

int qemuMonitorJSONRemoveNetdev(qemuMonitorPtr mon,
                                const char *alias);

218 219 220
int qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias,
                                 virNetDevRxFilterPtr *filter);

221 222
int qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon,
                                  virHashTablePtr info);
223

224 225
int qemuMonitorJSONAttachPCIDiskController(qemuMonitorPtr mon,
                                           const char *bus,
226
                                           virPCIDeviceAddress *guestAddr);
227

228 229
int qemuMonitorJSONAddDeviceArgs(qemuMonitorPtr mon,
                                 virJSONValuePtr args);
230 231 232
int qemuMonitorJSONAddDevice(qemuMonitorPtr mon,
                             const char *devicestr);

233
int qemuMonitorJSONDelDevice(qemuMonitorPtr mon,
234
                             const char *devalias);
235

236 237 238 239
int qemuMonitorJSONAddObject(qemuMonitorPtr mon,
                             virJSONValuePtr props);

int qemuMonitorJSONDelObject(qemuMonitorPtr mon,
240 241
                             const char *objalias,
                             bool report_error);
242

243
int qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions)
244 245 246 247 248 249
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuMonitorJSONDriveMirror(qemuMonitorPtr mon,
                               const char *device,
                               const char *file,
                               const char *format,
                               unsigned long long speed,
250 251
                               unsigned int granularity,
                               unsigned long long buf_size,
252 253
                               bool shallow,
                               bool reuse)
254
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
255 256
int qemuMonitorJSONBlockdevMirror(qemuMonitorPtr mon,
                                  const char *jobname,
257
                                  bool persistjob,
258 259 260 261 262
                                  const char *device,
                                  const char *target,
                                  unsigned long long speed,
                                  unsigned int granularity,
                                  unsigned long long buf_size,
263
                                  bool shallow)
264
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
265
int qemuMonitorJSONDrivePivot(qemuMonitorPtr mon,
266
                              const char *jobname)
267
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
268

269 270 271
bool qemuMonitorJSONSupportsActiveCommit(qemuMonitorPtr mon)
    ATTRIBUTE_NONNULL(1);

272 273
int qemuMonitorJSONBlockCommit(qemuMonitorPtr mon,
                               const char *device,
274 275
                               const char *jobname,
                               bool persistjob,
276
                               const char *top,
277
                               const char *topNode,
278
                               const char *base,
279
                               const char *baseNode,
280
                               const char *backingName,
281
                               unsigned long long bandwidth)
282
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
283

284 285 286 287 288 289 290
char *qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon,
                                    const char *device,
                                    virStorageSourcePtr top,
                                    virStorageSourcePtr target)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
    ATTRIBUTE_NONNULL(4);

291 292
int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon,
                                    const char *cmd_str,
293
                                    char **reply_str);
294

295
int qemuMonitorJSONInjectNMI(qemuMonitorPtr mon);
296

297 298 299 300 301
int qemuMonitorJSONSendKey(qemuMonitorPtr mon,
                           unsigned int holdtime,
                           unsigned int *keycodes,
                           unsigned int nkeycodes);

302
int qemuMonitorJSONScreendump(qemuMonitorPtr mon,
303 304
                              const char *device,
                              unsigned int head,
305 306
                              const char *file);

307 308
int qemuMonitorJSONBlockStream(qemuMonitorPtr mon,
                               const char *device,
309 310
                               const char *jobname,
                               bool persistjob,
311
                               const char *base,
312
                               const char *baseNode,
313
                               const char *backingName,
314
                               unsigned long long speed)
315
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
316

317
int qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon,
318
                                  const char *jobname)
319 320
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

321 322 323 324 325 326
int
qemuMonitorJSONGetJobInfo(qemuMonitorPtr mon,
                          qemuMonitorJobInfoPtr **jobs,
                          size_t *njobs);


327
int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
328
                                    const char *jobname,
329
                                    unsigned long long speed)
330 331
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

332 333
virHashTablePtr qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon,
                                                  bool rawjobname)
334
    ATTRIBUTE_NONNULL(1);
335

336 337 338 339
int qemuMonitorJSONJobDismiss(qemuMonitorPtr mon,
                              const char *jobname)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

340 341 342 343 344
int qemuMonitorJSONJobCancel(qemuMonitorPtr mon,
                             const char *jobname,
                             bool quiet)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

345 346 347 348
int qemuMonitorJSONJobComplete(qemuMonitorPtr mon,
                               const char *jobname)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

349 350
int qemuMonitorJSONSetLink(qemuMonitorPtr mon,
                           const char *name,
351
                           virDomainNetInterfaceLinkState state);
352

353 354 355 356 357
int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon,
                                const char *protocol,
                                const char *fdname,
                                bool skipauth);

358
int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon,
359 360
                                      const char *drivealias,
                                      const char *qomid,
361
                                      virDomainBlockIoTuneInfoPtr info,
362
                                      bool supportMaxOptions,
363
                                      bool supportGroupNameOption,
364
                                      bool supportMaxLengthOptions);
365 366

int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon,
367 368
                                      const char *drivealias,
                                      const char *qdevid,
369
                                      virDomainBlockIoTuneInfoPtr reply);
370

371 372
int qemuMonitorJSONSystemWakeup(qemuMonitorPtr mon);

373 374
char *qemuMonitorJSONGetSEVMeasurement(qemuMonitorPtr mon);

375 376 377 378 379 380 381
int qemuMonitorJSONGetVersion(qemuMonitorPtr mon,
                              int *major,
                              int *minor,
                              int *micro,
                              char **package)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);

382 383 384 385
int qemuMonitorJSONGetMachines(qemuMonitorPtr mon,
                               qemuMonitorMachineInfoPtr **machines)
    ATTRIBUTE_NONNULL(2);

386
int qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
387
                                     qemuMonitorCPUDefsPtr *cpuDefs)
388 389
    ATTRIBUTE_NONNULL(2);

390
int qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon,
391
                                        qemuMonitorCPUModelExpansionType type,
392
                                        virCPUDefPtr cpu,
393
                                        bool migratable,
394
                                        bool fail_no_props,
395
                                        qemuMonitorCPUModelInfoPtr *model_info)
396
    ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(6);
397

398 399 400 401 402 403
int qemuMonitorJSONGetCPUModelBaseline(qemuMonitorPtr mon,
                                       virCPUDefPtr cpu_a,
                                       virCPUDefPtr cpu_b,
                                       qemuMonitorCPUModelInfoPtr *baseline)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);

404 405 406 407 408 409
int qemuMonitorJSONGetCPUModelComparison(qemuMonitorPtr mon,
                                         virCPUDefPtr cpu_a,
                                         virCPUDefPtr cpu_b,
                                         char **result)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);

410 411 412
int qemuMonitorJSONGetCommands(qemuMonitorPtr mon,
                               char ***commands)
    ATTRIBUTE_NONNULL(2);
413 414 415
int qemuMonitorJSONGetEvents(qemuMonitorPtr mon,
                             char ***events)
    ATTRIBUTE_NONNULL(2);
416 417
int qemuMonitorJSONGetCommandLineOptionParameters(qemuMonitorPtr mon,
                                                  const char *option,
418 419
                                                  char ***params,
                                                  bool *found)
420
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
421

422 423 424 425 426
int qemuMonitorJSONGetKVMState(qemuMonitorPtr mon,
                               bool *enabled,
                               bool *present)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);

427 428 429
int qemuMonitorJSONGetObjectTypes(qemuMonitorPtr mon,
                                  char ***types)
    ATTRIBUTE_NONNULL(2);
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446

/* ListPath structures and API's are public only for qemumonitorjsontest */
typedef struct _qemuMonitorJSONListPath qemuMonitorJSONListPath;
typedef qemuMonitorJSONListPath *qemuMonitorJSONListPathPtr;

struct _qemuMonitorJSONListPath {
    char *name;
    char *type;
};

int qemuMonitorJSONGetObjectListPaths(qemuMonitorPtr mon,
                                      const char *path,
                                      qemuMonitorJSONListPathPtr **paths)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);

void qemuMonitorJSONListPathFree(qemuMonitorJSONListPathPtr paths);

447 448 449
/* ObjectProperty structures and Get/Set API's are public only
 * for qemumonitorjsontest
 */
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
/* Flags for the 'type' field in _qemuMonitorJSONObjectProperty */
typedef enum {
    QEMU_MONITOR_OBJECT_PROPERTY_BOOLEAN=1,
    QEMU_MONITOR_OBJECT_PROPERTY_INT,
    QEMU_MONITOR_OBJECT_PROPERTY_LONG,
    QEMU_MONITOR_OBJECT_PROPERTY_UINT,
    QEMU_MONITOR_OBJECT_PROPERTY_ULONG,
    QEMU_MONITOR_OBJECT_PROPERTY_DOUBLE,
    QEMU_MONITOR_OBJECT_PROPERTY_STRING,

    QEMU_MONITOR_OBJECT_PROPERTY_LAST
} qemuMonitorJSONObjectPropertyType;

typedef struct _qemuMonitorJSONObjectProperty qemuMonitorJSONObjectProperty;
typedef qemuMonitorJSONObjectProperty *qemuMonitorJSONObjectPropertyPtr;
struct _qemuMonitorJSONObjectProperty {
    int type;    /* qemuMonitorJSONObjectPropertyType */
    union {
        bool b;
        int iv;
        long long l;
        unsigned int ui;
        unsigned long long ul;
        double d;
        char *str;
    } val;
};

int qemuMonitorJSONGetObjectProperty(qemuMonitorPtr mon,
                                     const char *path,
                                     const char *property,
                                     qemuMonitorJSONObjectPropertyPtr prop)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);

484 485 486 487 488 489
int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon,
                                     const char *path,
                                     const char *property,
                                     qemuMonitorJSONObjectPropertyPtr prop)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);

490 491
int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon,
                                  const char *device,
492 493
                                  char ***props)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
494 495 496 497
int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon,
                                  const char *object,
                                  char ***props)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
498
char *qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon);
499

500
int qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon,
501
                                  const virStorageNetHostDef *server,
502
                                  const char *tls_alias);
503 504
int qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon,
                                const char *deviceID,
505 506 507
                                const char *export,
                                bool writable,
                                const char *bitmap);
508
int qemuMonitorJSONNBDServerStop(qemuMonitorPtr mon);
S
Stefan Berger 已提交
509 510 511 512 513 514 515 516
int qemuMonitorJSONGetTPMModels(qemuMonitorPtr mon,
                                char ***tpmmodels)
    ATTRIBUTE_NONNULL(2);

int qemuMonitorJSONGetTPMTypes(qemuMonitorPtr mon,
                               char ***tpmtypes)
    ATTRIBUTE_NONNULL(2);

517 518 519
int qemuMonitorJSONAttachCharDev(qemuMonitorPtr mon,
                                 const char *chrID,
                                 virDomainChrSourceDefPtr chr);
520 521
int qemuMonitorJSONDetachCharDev(qemuMonitorPtr mon,
                                 const char *chrID);
522 523 524 525

int qemuMonitorJSONGetDeviceAliases(qemuMonitorPtr mon,
                                    char ***aliases);

526 527 528 529
int qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon,
                                 const char *property,
                                 virCPUDataPtr *cpudata);

530 531 532
int qemuMonitorJSONGetGuestCPUx86(qemuMonitorPtr mon,
                                  virCPUDataPtr *data,
                                  virCPUDataPtr *disabled);
533

534 535 536 537 538 539 540
int qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon,
                               virArch arch,
                               qemuMonitorCPUFeatureTranslationCallback translate,
                               void *opaque,
                               virCPUDataPtr *enabled,
                               virCPUDataPtr *disabled);

541
int qemuMonitorJSONRTCResetReinjection(qemuMonitorPtr mon);
542 543

int qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon,
544
                                qemuMonitorIOThreadInfoPtr **iothreads)
545
    ATTRIBUTE_NONNULL(2);
546

547 548 549 550
int qemuMonitorJSONSetIOThread(qemuMonitorPtr mon,
                               qemuMonitorIOThreadInfoPtr iothreadInfo)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

551 552 553 554
int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
                                       virHashTablePtr info)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

555 556
int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
                                const char *name,
557
                                const char *alias,
558
                                char **path)
559
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
560 561 562 563 564

int qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon,
                                   const char *uri)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

565 566
int qemuMonitorJSONMigrateStartPostCopy(qemuMonitorPtr mon)
    ATTRIBUTE_NONNULL(1);
567 568 569 570

int qemuMonitorJSONMigrateContinue(qemuMonitorPtr mon,
                                   qemuMonitorMigrationStatus status)
    ATTRIBUTE_NONNULL(1);
571

572 573 574
int qemuMonitorJSONGetRTCTime(qemuMonitorPtr mon,
                              struct tm *tm)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
575 576 577 578 579

int qemuMonitorJSONGetHotpluggableCPUs(qemuMonitorPtr mon,
                                       struct qemuMonitorQueryHotpluggableCpusEntry **entries,
                                       size_t *nentries)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
580

581
virJSONValuePtr qemuMonitorJSONQueryQMPSchema(qemuMonitorPtr mon)
582
    ATTRIBUTE_NONNULL(1);
583 584 585 586 587 588

int qemuMonitorJSONSetBlockThreshold(qemuMonitorPtr mon,
                                     const char *nodename,
                                     unsigned long long threshold)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

589 590
virJSONValuePtr qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon,
                                                    bool flat)
591 592
    ATTRIBUTE_NONNULL(1);

M
Michal Privoznik 已提交
593 594 595
int qemuMonitorJSONSetWatchdogAction(qemuMonitorPtr mon,
                                     const char *action)
    ATTRIBUTE_NONNULL(1);
596

597 598 599 600 601
int qemuMonitorJSONBlockdevCreate(qemuMonitorPtr mon,
                                  const char *jobname,
                                  virJSONValuePtr props)
    ATTRIBUTE_NONNULL(1);

602
int qemuMonitorJSONBlockdevAdd(qemuMonitorPtr mon,
603
                               virJSONValuePtr *props)
604 605
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

606 607 608 609
int qemuMonitorJSONBlockdevReopen(qemuMonitorPtr mon,
                                  virJSONValuePtr *props)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

610 611 612 613
int qemuMonitorJSONBlockdevDel(qemuMonitorPtr mon,
                               const char *nodename)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631
int qemuMonitorJSONBlockdevTrayOpen(qemuMonitorPtr mon,
                                    const char *id,
                                    bool force)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

int qemuMonitorJSONBlockdevTrayClose(qemuMonitorPtr mon,
                                     const char *id)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

int qemuMonitorJSONBlockdevMediumRemove(qemuMonitorPtr mon,
                                        const char *id)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

int qemuMonitorJSONBlockdevMediumInsert(qemuMonitorPtr mon,
                                        const char *id,
                                        const char *nodename)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);

632 633 634 635
int qemuMonitorJSONGetPRManagerInfo(qemuMonitorPtr mon,
                                    virHashTablePtr info)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

636 637 638 639
int
qemuMonitorJSONGetCurrentMachineInfo(qemuMonitorPtr mon,
                                     qemuMonitorCurrentMachineInfoPtr info)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
640 641 642 643 644 645

int
qemuMonitorJSONTransactionBitmapAdd(virJSONValuePtr actions,
                                    const char *node,
                                    const char *name,
                                    bool persistent,
646 647
                                    bool disabled,
                                    unsigned long long granularity);
648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664
int
qemuMonitorJSONTransactionBitmapRemove(virJSONValuePtr actions,
                                       const char *node,
                                       const char *name);
int
qemuMonitorJSONTransactionBitmapEnable(virJSONValuePtr actions,
                                       const char *node,
                                       const char *name);
int
qemuMonitorJSONTransactionBitmapDisable(virJSONValuePtr actions,
                                        const char *node,
                                        const char *name);
int
qemuMonitorJSONTransactionBitmapMerge(virJSONValuePtr actions,
                                      const char *node,
                                      const char *target,
                                      virJSONValuePtr *sources);
665

666 667 668 669 670
int
qemuMonitorJSONTransactionBitmapMergeSourceAddBitmap(virJSONValuePtr sources,
                                                     const char *sourcenode,
                                                     const char *sourcebitmap);

671 672 673 674 675 676 677 678 679 680
int
qemuMonitorJSONTransactionSnapshotLegacy(virJSONValuePtr actions,
                                         const char *device,
                                         const char *path,
                                         const char *format,
                                         bool existing);
int
qemuMonitorJSONTransactionSnapshotBlockdev(virJSONValuePtr actions,
                                           const char *node,
                                           const char *overlay);
681 682 683 684 685 686 687 688

int
qemuMonitorJSONTransactionBackup(virJSONValuePtr actions,
                                 const char *device,
                                 const char *jobname,
                                 const char *target,
                                 const char *bitmap,
                                 qemuMonitorTransactionBackupSyncMode syncmode);