int ret = -1;
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
- char *drive;
-
- if (virAsprintf(&drive, "%s%s", QEMU_DRIVE_HOST_PREFIX, alias) < 0)
- return -1;
cmd = qemuMonitorJSONMakeCommand("block_passwd",
- "s:device", drive,
+ "s:device", alias,
"s:password", passphrase,
NULL);
- VIR_FREE(drive);
if (!cmd)
return -1;
if (!safe_str)
return -1;
- if (virAsprintf(&cmd, "block_passwd %s%s \"%s\"",
- QEMU_DRIVE_HOST_PREFIX, alias, safe_str) < 0)
+ if (virAsprintf(&cmd, "block_passwd %s \"%s\"", alias, safe_str) < 0)
goto cleanup;
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
goto cleanup;
VIR_FREE(alias);
- if (VIR_STRDUP(alias, vm->def->disks[i]->info.alias) < 0)
+ if (!(alias = qemuAliasFromDisk(vm->def->disks[i])))
goto cleanup;
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
goto cleanup;
GEN_TEST_FUNC(qemuMonitorJSONRemoveNetdev, "net0")
GEN_TEST_FUNC(qemuMonitorJSONDelDevice, "ide0")
GEN_TEST_FUNC(qemuMonitorJSONAddDevice, "some_dummy_devicestr")
-GEN_TEST_FUNC(qemuMonitorJSONSetDrivePassphrase, "vda", "secret_passhprase")
+GEN_TEST_FUNC(qemuMonitorJSONSetDrivePassphrase, "drive-vda", "secret_passhprase")
GEN_TEST_FUNC(qemuMonitorJSONDriveMirror, "vdb", "/foo/bar", NULL, 1024, 0, 0,
VIR_DOMAIN_BLOCK_REBASE_SHALLOW | VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT)
GEN_TEST_FUNC(qemuMonitorJSONBlockCommit, "vdb", "/foo/bar1", "/foo/bar2", NULL, 1024)