qemu_monitor_json.h 27.4 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 qemuMonitorJSONTransactionAdd(virJSONValuePtr actions,
                                  const char *cmdname,
                                  ...);

35 36 37 38
int qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
                                 const char *line,
                                 qemuMonitorMessagePtr msg);

D
Daniel P. Berrange 已提交
39 40 41 42 43
int qemuMonitorJSONIOProcess(qemuMonitorPtr mon,
                             const char *data,
                             size_t len,
                             qemuMonitorMessagePtr msg);

44 45 46
int qemuMonitorJSONHumanCommand(qemuMonitorPtr mon,
                                const char *cmd,
                                char **reply);
47

48 49
int qemuMonitorJSONSetCapabilities(qemuMonitorPtr mon);

50
int qemuMonitorJSONStartCPUs(qemuMonitorPtr mon);
D
Daniel P. Berrange 已提交
51
int qemuMonitorJSONStopCPUs(qemuMonitorPtr mon);
52 53 54
int qemuMonitorJSONGetStatus(qemuMonitorPtr mon,
                             bool *running,
                             virDomainPausedReason *reason);
D
Daniel P. Berrange 已提交
55 56

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

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

84
virJSONValuePtr qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon);
85
int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
86
                                        virHashTablePtr hash,
87
                                        bool backingChain);
88
int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon,
89 90
                                            virHashTablePtr stats,
                                            bool backingChain);
91 92 93
int qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon,
                                                    virHashTablePtr stats);

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

99 100 101 102 103 104 105
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 已提交
106
int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
107
                              unsigned long long newmem);
108
int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, int cpu, bool online);
D
Daniel P. Berrange 已提交
109 110

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


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

int qemuMonitorJSONSetMigrationSpeed(qemuMonitorPtr mon,
                                     unsigned long bandwidth);

131 132 133
int qemuMonitorJSONSetMigrationDowntime(qemuMonitorPtr mon,
                                        unsigned long long downtime);

134 135 136 137 138
int qemuMonitorJSONGetMigrationCacheSize(qemuMonitorPtr mon,
                                         unsigned long long *cacheSize);
int qemuMonitorJSONSetMigrationCacheSize(qemuMonitorPtr mon,
                                         unsigned long long cacheSize);

139
int qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon,
140
                                      virJSONValuePtr *params);
141
int qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon,
142
                                      virJSONValuePtr params);
143

144
int qemuMonitorJSONGetMigrationStats(qemuMonitorPtr mon,
145 146
                                     qemuMonitorMigrationStatsPtr stats,
                                     char **error);
D
Daniel P. Berrange 已提交
147

148 149
int qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon,
                                            char ***capabilities);
150
int qemuMonitorJSONSetMigrationCapabilities(qemuMonitorPtr mon,
151
                                            virJSONValuePtr caps);
152

A
Andrea Bolognani 已提交
153 154 155
int qemuMonitorJSONGetGICCapabilities(qemuMonitorPtr mon,
                                      virGICCapability **capabilities);

156 157 158
int qemuMonitorJSONGetSEVCapabilities(qemuMonitorPtr mon,
                                      virSEVCapability **capabilities);

159 160 161
int qemuMonitorJSONMigrate(qemuMonitorPtr mon,
                           unsigned int flags,
                           const char *uri);
162 163 164
int qemuMonitorJSONGetSpiceMigrationStatus(qemuMonitorPtr mon,
                                           bool *spice_migrated);

D
Daniel P. Berrange 已提交
165 166 167

int qemuMonitorJSONMigrateCancel(qemuMonitorPtr mon);

168 169 170
int qemuMonitorJSONQueryDump(qemuMonitorPtr mon,
                             qemuMonitorDumpStatsPtr stats);

171 172 173
int qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitorPtr mon,
                                                const char *capability);

174
int qemuMonitorJSONDump(qemuMonitorPtr mon,
175
                        const char *protocol,
176 177
                        const char *dumpformat,
                        bool detach);
178

179 180 181 182 183 184 185
int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon,
                                    int type,
                                    const char *hostname,
                                    int port,
                                    int tlsPort,
                                    const char *tlsSubject);

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

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

int qemuMonitorJSONAddPCINetwork(qemuMonitorPtr mon,
                                 const char *nicstr,
197
                                 virPCIDeviceAddress *guestAddr);
D
Daniel P. Berrange 已提交
198 199

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

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

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

209 210 211 212 213 214
int qemuMonitorJSONAddNetdev(qemuMonitorPtr mon,
                             const char *netdevstr);

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

215 216 217
int qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias,
                                 virNetDevRxFilterPtr *filter);

218 219
int qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon,
                                  virHashTablePtr info);
220

221 222
int qemuMonitorJSONAttachPCIDiskController(qemuMonitorPtr mon,
                                           const char *bus,
223
                                           virPCIDeviceAddress *guestAddr);
224

225 226
int qemuMonitorJSONAddDeviceArgs(qemuMonitorPtr mon,
                                 virJSONValuePtr args);
227 228 229
int qemuMonitorJSONAddDevice(qemuMonitorPtr mon,
                             const char *devicestr);

230
int qemuMonitorJSONDelDevice(qemuMonitorPtr mon,
231
                             const char *devalias);
232

233 234 235 236 237 238
int qemuMonitorJSONAddObject(qemuMonitorPtr mon,
                             virJSONValuePtr props);

int qemuMonitorJSONDelObject(qemuMonitorPtr mon,
                             const char *objalias);

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

265 266 267
bool qemuMonitorJSONSupportsActiveCommit(qemuMonitorPtr mon)
    ATTRIBUTE_NONNULL(1);

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

280 281 282 283 284 285 286
char *qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon,
                                    const char *device,
                                    virStorageSourcePtr top,
                                    virStorageSourcePtr target)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
    ATTRIBUTE_NONNULL(4);

287 288
int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon,
                                    const char *cmd_str,
289
                                    char **reply_str);
290

291
int qemuMonitorJSONInjectNMI(qemuMonitorPtr mon);
292

293 294 295 296 297
int qemuMonitorJSONSendKey(qemuMonitorPtr mon,
                           unsigned int holdtime,
                           unsigned int *keycodes,
                           unsigned int nkeycodes);

298
int qemuMonitorJSONScreendump(qemuMonitorPtr mon,
299 300
                              const char *device,
                              unsigned int head,
301 302
                              const char *file);

303 304
int qemuMonitorJSONBlockStream(qemuMonitorPtr mon,
                               const char *device,
305 306
                               const char *jobname,
                               bool persistjob,
307
                               const char *base,
308
                               const char *baseNode,
309
                               const char *backingName,
310
                               unsigned long long speed)
311
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
312

313
int qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon,
314
                                  const char *jobname)
315 316
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

317 318 319 320 321 322
int
qemuMonitorJSONGetJobInfo(qemuMonitorPtr mon,
                          qemuMonitorJobInfoPtr **jobs,
                          size_t *njobs);


323
int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
324
                                    const char *jobname,
325
                                    unsigned long long speed)
326 327
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

328 329
virHashTablePtr qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon,
                                                  bool rawjobname)
330
    ATTRIBUTE_NONNULL(1);
331

332 333 334 335
int qemuMonitorJSONJobDismiss(qemuMonitorPtr mon,
                              const char *jobname)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

336 337 338 339 340
int qemuMonitorJSONJobCancel(qemuMonitorPtr mon,
                             const char *jobname,
                             bool quiet)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

341 342 343 344
int qemuMonitorJSONJobComplete(qemuMonitorPtr mon,
                               const char *jobname)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

345 346
int qemuMonitorJSONSetLink(qemuMonitorPtr mon,
                           const char *name,
347
                           virDomainNetInterfaceLinkState state);
348

349 350 351 352 353
int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon,
                                const char *protocol,
                                const char *fdname,
                                bool skipauth);

354
int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon,
355 356
                                      const char *drivealias,
                                      const char *qomid,
357
                                      virDomainBlockIoTuneInfoPtr info,
358
                                      bool supportMaxOptions,
359
                                      bool supportGroupNameOption,
360
                                      bool supportMaxLengthOptions);
361 362

int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon,
363 364
                                      const char *drivealias,
                                      const char *qdevid,
365
                                      virDomainBlockIoTuneInfoPtr reply);
366

367 368
int qemuMonitorJSONSystemWakeup(qemuMonitorPtr mon);

369 370
char *qemuMonitorJSONGetSEVMeasurement(qemuMonitorPtr mon);

371 372 373 374 375 376 377
int qemuMonitorJSONGetVersion(qemuMonitorPtr mon,
                              int *major,
                              int *minor,
                              int *micro,
                              char **package)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);

378 379 380 381
int qemuMonitorJSONGetMachines(qemuMonitorPtr mon,
                               qemuMonitorMachineInfoPtr **machines)
    ATTRIBUTE_NONNULL(2);

382
int qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
383
                                     qemuMonitorCPUDefInfoPtr **cpus)
384 385
    ATTRIBUTE_NONNULL(2);

386
int qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon,
387
                                        qemuMonitorCPUModelExpansionType type,
388
                                        const char *model_name,
389
                                        bool migratable,
390
                                        qemuMonitorCPUModelInfoPtr *model_info)
391
    ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(5);
392

393 394 395
int qemuMonitorJSONGetCommands(qemuMonitorPtr mon,
                               char ***commands)
    ATTRIBUTE_NONNULL(2);
396 397 398
int qemuMonitorJSONGetEvents(qemuMonitorPtr mon,
                             char ***events)
    ATTRIBUTE_NONNULL(2);
399 400
int qemuMonitorJSONGetCommandLineOptionParameters(qemuMonitorPtr mon,
                                                  const char *option,
401 402
                                                  char ***params,
                                                  bool *found)
403
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
404

405 406 407 408 409
int qemuMonitorJSONGetKVMState(qemuMonitorPtr mon,
                               bool *enabled,
                               bool *present)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);

410 411 412
int qemuMonitorJSONGetObjectTypes(qemuMonitorPtr mon,
                                  char ***types)
    ATTRIBUTE_NONNULL(2);
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429

/* 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);

430 431 432
/* ObjectProperty structures and Get/Set API's are public only
 * for qemumonitorjsontest
 */
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466
/* 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);

467 468 469 470 471 472
int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon,
                                     const char *path,
                                     const char *property,
                                     qemuMonitorJSONObjectPropertyPtr prop)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);

473 474
int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon,
                                  const char *device,
475 476
                                  char ***props)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
477 478 479 480
int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon,
                                  const char *object,
                                  char ***props)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
481
char *qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon);
482

483
int qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon,
484
                                  const virStorageNetHostDef *server,
485
                                  const char *tls_alias);
486 487
int qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon,
                                const char *deviceID,
488 489 490
                                const char *export,
                                bool writable,
                                const char *bitmap);
491
int qemuMonitorJSONNBDServerStop(qemuMonitorPtr mon);
S
Stefan Berger 已提交
492 493 494 495 496 497 498 499
int qemuMonitorJSONGetTPMModels(qemuMonitorPtr mon,
                                char ***tpmmodels)
    ATTRIBUTE_NONNULL(2);

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

500 501 502
int qemuMonitorJSONAttachCharDev(qemuMonitorPtr mon,
                                 const char *chrID,
                                 virDomainChrSourceDefPtr chr);
503 504
int qemuMonitorJSONDetachCharDev(qemuMonitorPtr mon,
                                 const char *chrID);
505 506 507 508

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

509 510 511 512
int qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon,
                                 const char *property,
                                 virCPUDataPtr *cpudata);

513 514 515
int qemuMonitorJSONGetGuestCPUx86(qemuMonitorPtr mon,
                                  virCPUDataPtr *data,
                                  virCPUDataPtr *disabled);
516

517 518 519 520 521 522 523
int qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon,
                               virArch arch,
                               qemuMonitorCPUFeatureTranslationCallback translate,
                               void *opaque,
                               virCPUDataPtr *enabled,
                               virCPUDataPtr *disabled);

524
int qemuMonitorJSONRTCResetReinjection(qemuMonitorPtr mon);
525 526

int qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon,
527
                                qemuMonitorIOThreadInfoPtr **iothreads)
528
    ATTRIBUTE_NONNULL(2);
529

530 531 532 533
int qemuMonitorJSONSetIOThread(qemuMonitorPtr mon,
                               qemuMonitorIOThreadInfoPtr iothreadInfo)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

534 535 536 537
int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
                                       virHashTablePtr info)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

538 539
int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
                                const char *name,
540
                                const char *alias,
541
                                char **path)
542
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
543 544 545 546 547

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

548 549
int qemuMonitorJSONMigrateStartPostCopy(qemuMonitorPtr mon)
    ATTRIBUTE_NONNULL(1);
550 551 552 553

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

555 556 557
int qemuMonitorJSONGetRTCTime(qemuMonitorPtr mon,
                              struct tm *tm)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
558 559 560 561 562

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

564
virJSONValuePtr qemuMonitorJSONQueryQMPSchema(qemuMonitorPtr mon)
565
    ATTRIBUTE_NONNULL(1);
566 567 568 569 570 571

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

572 573 574
virJSONValuePtr qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon)
    ATTRIBUTE_NONNULL(1);

M
Michal Privoznik 已提交
575 576 577
int qemuMonitorJSONSetWatchdogAction(qemuMonitorPtr mon,
                                     const char *action)
    ATTRIBUTE_NONNULL(1);
578

579 580 581 582 583
int qemuMonitorJSONBlockdevCreate(qemuMonitorPtr mon,
                                  const char *jobname,
                                  virJSONValuePtr props)
    ATTRIBUTE_NONNULL(1);

584 585 586 587 588 589 590 591
int qemuMonitorJSONBlockdevAdd(qemuMonitorPtr mon,
                               virJSONValuePtr props)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

int qemuMonitorJSONBlockdevDel(qemuMonitorPtr mon,
                               const char *nodename)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609
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);

610 611 612 613
int qemuMonitorJSONGetPRManagerInfo(qemuMonitorPtr mon,
                                    virHashTablePtr info)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

614 615 616 617
int
qemuMonitorJSONGetCurrentMachineInfo(qemuMonitorPtr mon,
                                     qemuMonitorCurrentMachineInfoPtr info)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
E
Eric Blake 已提交
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634
int qemuMonitorJSONAddBitmap(qemuMonitorPtr mon,
                             const char *node,
                             const char *bitmap,
                             bool persistent);

int qemuMonitorJSONEnableBitmap(qemuMonitorPtr mon,
                                const char *node,
                                const char *bitmap);

int qemuMonitorJSONMergeBitmaps(qemuMonitorPtr mon,
                                const char *node,
                                const char *dst,
                                virJSONValuePtr *src);

int qemuMonitorJSONDeleteBitmap(qemuMonitorPtr mon,
                                const char *node,
                                const char *bitmap);
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658

int
qemuMonitorJSONTransactionBitmapAdd(virJSONValuePtr actions,
                                    const char *node,
                                    const char *name,
                                    bool persistent,
                                    bool disabled);
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);