qemu_monitor_json.h 25.0 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 23
#ifndef LIBVIRT_QEMU_MONITOR_JSON_H
# define LIBVIRT_QEMU_MONITOR_JSON_H
D
Daniel P. Berrange 已提交
24

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

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

32 33 34 35
int qemuMonitorJSONTransactionAdd(virJSONValuePtr actions,
                                  const char *cmdname,
                                  ...);

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

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

45 46 47 48 49
int qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon,
                                      const char *cmd,
                                      int scm_fd,
                                      char **reply);

50 51
int qemuMonitorJSONSetCapabilities(qemuMonitorPtr mon);

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

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

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

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

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

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

int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,
113
                              const char *dev_name,
114
                              bool force);
D
Daniel P. Berrange 已提交
115
int qemuMonitorJSONChangeMedia(qemuMonitorPtr mon,
116
                               const char *dev_name,
D
Daniel P. Berrange 已提交
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
                               const char *newmedia,
                               const char *format);


int qemuMonitorJSONSaveVirtualMemory(qemuMonitorPtr mon,
                                     unsigned long long offset,
                                     size_t length,
                                     const char *path);
int qemuMonitorJSONSavePhysicalMemory(qemuMonitorPtr mon,
                                      unsigned long long offset,
                                      size_t length,
                                      const char *path);

int qemuMonitorJSONSetMigrationSpeed(qemuMonitorPtr mon,
                                     unsigned long bandwidth);

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

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

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

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

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

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

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

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

D
Daniel P. Berrange 已提交
167 168 169

int qemuMonitorJSONMigrateCancel(qemuMonitorPtr mon);

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

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

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

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

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

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

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

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

int qemuMonitorJSONSendFileHandle(qemuMonitorPtr mon,
                                  const char *fdname,
                                  int fd);
207 208
int qemuMonitorJSONAddFd(qemuMonitorPtr mon, int fdset, int fd,
                         const char *name);
D
Daniel P. Berrange 已提交
209 210 211

int qemuMonitorJSONCloseFileHandle(qemuMonitorPtr mon,
                                   const char *fdname);
212
int qemuMonitorJSONRemoveFd(qemuMonitorPtr mon, int fdset, int fd);
D
Daniel P. Berrange 已提交
213

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

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

220 221 222
int qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias,
                                 virNetDevRxFilterPtr *filter);

223 224
int qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon,
                                  virHashTablePtr info);
225

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

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

235
int qemuMonitorJSONDelDevice(qemuMonitorPtr mon,
236
                             const char *devalias);
237

238 239 240 241 242 243
int qemuMonitorJSONAddObject(qemuMonitorPtr mon,
                             virJSONValuePtr props);

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

244
int qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions)
245 246 247 248 249 250
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuMonitorJSONDriveMirror(qemuMonitorPtr mon,
                               const char *device,
                               const char *file,
                               const char *format,
                               unsigned long long speed,
251 252
                               unsigned int granularity,
                               unsigned long long buf_size,
253 254
                               bool shallow,
                               bool reuse)
255
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
256 257 258 259 260 261 262
int qemuMonitorJSONBlockdevMirror(qemuMonitorPtr mon,
                                  const char *jobname,
                                  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(3) ATTRIBUTE_NONNULL(4);
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 274 275
int qemuMonitorJSONBlockCommit(qemuMonitorPtr mon,
                               const char *device,
                               const char *top,
                               const char *base,
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 290
                                    char **reply_str,
                                    bool hmp);
291

292
int qemuMonitorJSONInjectNMI(qemuMonitorPtr mon);
293

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

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

304 305 306 307
int qemuMonitorJSONBlockStream(qemuMonitorPtr mon,
                               const char *device,
                               const char *base,
                               const char *backingName,
308
                               unsigned long long speed)
309
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
310

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

315
int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
316
                                    const char *jobname,
317
                                    unsigned long long speed)
318 319
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

320 321
virHashTablePtr qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon)
    ATTRIBUTE_NONNULL(1);
322

323 324
int qemuMonitorJSONSetLink(qemuMonitorPtr mon,
                           const char *name,
325
                           virDomainNetInterfaceLinkState state);
326

327 328 329 330 331
int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon,
                                const char *protocol,
                                const char *fdname,
                                bool skipauth);

332
int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon,
333 334
                                      const char *drivealias,
                                      const char *qomid,
335
                                      virDomainBlockIoTuneInfoPtr info,
336
                                      bool supportMaxOptions,
337
                                      bool supportGroupNameOption,
338
                                      bool supportMaxLengthOptions);
339 340

int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon,
341 342
                                      const char *drivealias,
                                      const char *qdevid,
343
                                      virDomainBlockIoTuneInfoPtr reply);
344

345 346
int qemuMonitorJSONSystemWakeup(qemuMonitorPtr mon);

347 348
char *qemuMonitorJSONGetSEVMeasurement(qemuMonitorPtr mon);

349 350 351 352 353 354 355
int qemuMonitorJSONGetVersion(qemuMonitorPtr mon,
                              int *major,
                              int *minor,
                              int *micro,
                              char **package)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);

356 357 358 359
int qemuMonitorJSONGetMachines(qemuMonitorPtr mon,
                               qemuMonitorMachineInfoPtr **machines)
    ATTRIBUTE_NONNULL(2);

360
int qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
361
                                     qemuMonitorCPUDefInfoPtr **cpus)
362 363
    ATTRIBUTE_NONNULL(2);

364
int qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon,
365
                                        qemuMonitorCPUModelExpansionType type,
366
                                        const char *model_name,
367
                                        bool migratable,
368
                                        qemuMonitorCPUModelInfoPtr *model_info)
369
    ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(5);
370

371 372 373
int qemuMonitorJSONGetCommands(qemuMonitorPtr mon,
                               char ***commands)
    ATTRIBUTE_NONNULL(2);
374 375 376
int qemuMonitorJSONGetEvents(qemuMonitorPtr mon,
                             char ***events)
    ATTRIBUTE_NONNULL(2);
377 378
int qemuMonitorJSONGetCommandLineOptionParameters(qemuMonitorPtr mon,
                                                  const char *option,
379 380
                                                  char ***params,
                                                  bool *found)
381
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
382

383 384 385 386 387
int qemuMonitorJSONGetKVMState(qemuMonitorPtr mon,
                               bool *enabled,
                               bool *present)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);

388 389 390
int qemuMonitorJSONGetObjectTypes(qemuMonitorPtr mon,
                                  char ***types)
    ATTRIBUTE_NONNULL(2);
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407

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

408 409 410
/* ObjectProperty structures and Get/Set API's are public only
 * for qemumonitorjsontest
 */
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444
/* 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);

445 446 447 448 449 450
int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon,
                                     const char *path,
                                     const char *property,
                                     qemuMonitorJSONObjectPropertyPtr prop)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);

451 452
int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon,
                                  const char *device,
453 454
                                  char ***props)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
455 456 457 458
int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon,
                                  const char *object,
                                  char ***props)
    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
459
char *qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon);
460

461
int qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon,
462
                                  const virStorageNetHostDef *server,
463
                                  const char *tls_alias);
464 465 466
int qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon,
                                const char *deviceID,
                                bool writable);
467
int qemuMonitorJSONNBDServerStop(qemuMonitorPtr mon);
S
Stefan Berger 已提交
468 469 470 471 472 473 474 475
int qemuMonitorJSONGetTPMModels(qemuMonitorPtr mon,
                                char ***tpmmodels)
    ATTRIBUTE_NONNULL(2);

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

476 477 478
int qemuMonitorJSONAttachCharDev(qemuMonitorPtr mon,
                                 const char *chrID,
                                 virDomainChrSourceDefPtr chr);
479 480
int qemuMonitorJSONDetachCharDev(qemuMonitorPtr mon,
                                 const char *chrID);
481 482 483 484

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

485 486 487 488
int qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon,
                                 const char *property,
                                 virCPUDataPtr *cpudata);

489 490
int qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon,
                               virArch arch,
491 492
                               virCPUDataPtr *data,
                               virCPUDataPtr *disabled);
493 494

int qemuMonitorJSONRTCResetReinjection(qemuMonitorPtr mon);
495 496

int qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon,
497
                                qemuMonitorIOThreadInfoPtr **iothreads)
498
    ATTRIBUTE_NONNULL(2);
499

500 501 502 503
int qemuMonitorJSONSetIOThread(qemuMonitorPtr mon,
                               qemuMonitorIOThreadInfoPtr iothreadInfo)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

504 505 506 507
int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
                                       virHashTablePtr info)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

508 509
int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
                                const char *name,
510
                                const char *alias,
511
                                char **path)
512
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
513 514 515 516 517

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

518 519
int qemuMonitorJSONMigrateStartPostCopy(qemuMonitorPtr mon)
    ATTRIBUTE_NONNULL(1);
520 521 522 523

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

525 526 527
int qemuMonitorJSONGetRTCTime(qemuMonitorPtr mon,
                              struct tm *tm)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
528 529 530 531 532

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

534
virJSONValuePtr qemuMonitorJSONQueryQMPSchema(qemuMonitorPtr mon)
535
    ATTRIBUTE_NONNULL(1);
536 537 538 539 540 541

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

542 543 544
virJSONValuePtr qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon)
    ATTRIBUTE_NONNULL(1);

M
Michal Privoznik 已提交
545 546 547
int qemuMonitorJSONSetWatchdogAction(qemuMonitorPtr mon,
                                     const char *action)
    ATTRIBUTE_NONNULL(1);
548 549 550 551 552 553 554 555 556

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

557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
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);

575 576 577 578
int qemuMonitorJSONGetPRManagerInfo(qemuMonitorPtr mon,
                                    virHashTablePtr info)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

579 580 581 582
int
qemuMonitorJSONGetCurrentMachineInfo(qemuMonitorPtr mon,
                                     qemuMonitorCurrentMachineInfoPtr info)
    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
E
Eric Blake 已提交
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599
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);
600

601
#endif /* LIBVIRT_QEMU_MONITOR_JSON_H */