hmp-cmds.c (6b7fbf61fbd4bcbcd20efffdc3fcc92820f6b07d) hmp-cmds.c (fce2b91fdfe2a187750742e2b511f6da84dbde40)
1/*
2 * Human Monitor Interface commands
3 *
4 * Copyright IBM, Corp. 2011
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 1328 unchanged lines hidden (view full) ---

1337 const char *device = qdict_get_str(qdict, "device");
1338 int64_t size = qdict_get_int(qdict, "size");
1339 Error *err = NULL;
1340
1341 qmp_block_resize(true, device, false, NULL, size, &err);
1342 hmp_handle_error(mon, err);
1343}
1344
1/*
2 * Human Monitor Interface commands
3 *
4 * Copyright IBM, Corp. 2011
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 1328 unchanged lines hidden (view full) ---

1337 const char *device = qdict_get_str(qdict, "device");
1338 int64_t size = qdict_get_int(qdict, "size");
1339 Error *err = NULL;
1340
1341 qmp_block_resize(true, device, false, NULL, size, &err);
1342 hmp_handle_error(mon, err);
1343}
1344
1345void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict)
1346{
1347 const char *device = qdict_get_str(qdict, "device");
1348 const char *filename = qdict_get_try_str(qdict, "snapshot-file");
1349 const char *format = qdict_get_try_str(qdict, "format");
1350 bool reuse = qdict_get_try_bool(qdict, "reuse", false);
1351 enum NewImageMode mode;
1352 Error *err = NULL;
1353
1354 if (!filename) {
1355 /* In the future, if 'snapshot-file' is not specified, the snapshot
1356 will be taken internally. Today it's actually required. */
1357 error_setg(&err, QERR_MISSING_PARAMETER, "snapshot-file");
1358 hmp_handle_error(mon, err);
1359 return;
1360 }
1361
1362 mode = reuse ? NEW_IMAGE_MODE_EXISTING : NEW_IMAGE_MODE_ABSOLUTE_PATHS;
1363 qmp_blockdev_snapshot_sync(true, device, false, NULL,
1364 filename, false, NULL,
1365 !!format, format,
1366 true, mode, &err);
1367 hmp_handle_error(mon, err);
1368}
1369
1370void hmp_snapshot_blkdev_internal(Monitor *mon, const QDict *qdict)
1371{
1372 const char *device = qdict_get_str(qdict, "device");
1373 const char *name = qdict_get_str(qdict, "name");
1374 Error *err = NULL;
1375
1376 qmp_blockdev_snapshot_internal_sync(device, name, &err);
1377 hmp_handle_error(mon, err);
1378}
1379
1380void hmp_snapshot_delete_blkdev_internal(Monitor *mon, const QDict *qdict)
1381{
1382 const char *device = qdict_get_str(qdict, "device");
1383 const char *name = qdict_get_str(qdict, "name");
1384 const char *id = qdict_get_try_str(qdict, "id");
1385 Error *err = NULL;
1386
1387 qmp_blockdev_snapshot_delete_internal_sync(device, !!id, id,
1388 true, name, &err);
1389 hmp_handle_error(mon, err);
1390}
1391
1392void hmp_loadvm(Monitor *mon, const QDict *qdict)
1393{
1394 int saved_vm_running = runstate_is_running();
1395 const char *name = qdict_get_str(qdict, "name");
1396 Error *err = NULL;
1397
1398 vm_stop(RUN_STATE_RESTORE_VM);
1399

--- 1464 unchanged lines hidden ---
1345void hmp_loadvm(Monitor *mon, const QDict *qdict)
1346{
1347 int saved_vm_running = runstate_is_running();
1348 const char *name = qdict_get_str(qdict, "name");
1349 Error *err = NULL;
1350
1351 vm_stop(RUN_STATE_RESTORE_VM);
1352

--- 1464 unchanged lines hidden ---