{
BlockBackend *blk;
BlockBackend *local_blk = NULL;
+ AioContext *aio_context;
const char* device = qdict_get_str(qdict, "device");
const char* command = qdict_get_str(qdict, "command");
Error *err = NULL;
}
}
- if (blk) {
- AioContext *aio_context = blk_get_aio_context(blk);
- aio_context_acquire(aio_context);
+ aio_context = blk_get_aio_context(blk);
+ aio_context_acquire(aio_context);
- qemuio_command(blk, command);
+ qemuio_command(blk, command);
- aio_context_release(aio_context);
- } else {
- error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
- "Device '%s' not found", device);
- }
+ aio_context_release(aio_context);
fail:
blk_unref(local_blk);