<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_qemu_info(path, backing_chain=False, fail_on_error=True):
 """ Get info on a given qemu disk Args: path(str):
 Path to the required disk backing_chain(boo):
 if true, include also info about the image predecessors. Return: object: if backing_chain == True then a list of dicts else a dict """


    cmd = ['qemu-img', 'info', '--output=json', path]

    if backing_chain:
        cmd.insert(-1, '--backing-chain')

    result = run_command_with_validation(
        cmd, fail_on_error, msg='Failed to get info for {}'.format(path)
    )

    return json.loads(result.out)