def METHOD_NAME(filepath, name, size):
    basename = os.path.basename(filepath)
    nodename = "file_{}".format(basename)
    log(vm.command('blockdev-create', job_id='job1',
                   options={
                       'driver': 'file',
                       'filename': filepath,
                       'size': 0,
                   }))
    vm.run_job('job1')
    log(vm.command('blockdev-add', driver='file',
                   node_name=nodename, filename=filepath))
    log(vm.command('blockdev-create', job_id='job2',
                   options={
                       'driver': iotests.imgfmt,
                       'file': nodename,
                       'size': size,
                   }))
    vm.run_job('job2')
    log(vm.command('blockdev-add', driver=iotests.imgfmt,
                   node_name=name,
                   file=nodename))