def METHOD_NAME(self, on_cbw_error):
    result = self.vm.qmp('object-add', {
        'qom-type': 'throttle-group',
        'id': 'group0',
        'limits': {'bps-write': 300 * 1024}
    })
    self.assert_qmp(result, 'return', {})
    result = self.vm.qmp('blockdev-add', {
        'node-name': 'cbw',
        'driver': 'copy-before-write',
        'on-cbw-error': on_cbw_error,
        'cbw-timeout': 1,
        'file': {
            'driver': iotests.imgfmt,
            'file': {
                'driver': 'file',
                'filename': source_img,
            }
        },
        'target': {
            'driver': 'throttle',
            'throttle-group': 'group0',
            'file': {
                'driver': 'qcow2',
                'file': {
                    'driver': 'file',
                    'filename': temp_img
                }
            }
        }
    })
    self.assert_qmp(result, 'return', {})
    result = self.vm.qmp('blockdev-add', {
        'node-name': 'access',
        'driver': 'snapshot-access',
        'file': 'cbw'
    })
    self.assert_qmp(result, 'return', {})
    result = self.vm.qmp('human-monitor-command',
                         command_line='qemu-io cbw "write 0 512K"')
    self.assert_qmp(result, 'return', '')
    # We need second write to trigger throttling
    result = self.vm.qmp('human-monitor-command',
                         command_line='qemu-io cbw "write 512K 512K"')
    self.assert_qmp(result, 'return', '')
    result = self.vm.qmp('human-monitor-command',
                         command_line='qemu-io access "read 0 1M"')
    self.assert_qmp(result, 'return', '')
    self.vm.shutdown()
    log = self.vm.get_log()
    log = re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', log)
    log = re.sub(r'\[I \+\d+\.\d+\] CLOSED\n?$', '', log)
    log = iotests.filter_qemu_io(log)
    return log