Lines Matching +full:os +full:- +full:manifest +full:- +full:offset
4 # Test bitmap-sync backups (incremental, differential, and partials)
24 import os
34 def __init__(self, byte, offset, size=GRANULARITY): argument
36 self.offset = offset
40 lower = self.offset // granularity
41 upper = (self.offset + self.size - 1) // granularity
64 Pattern('0x76', 0x3ff0000)]), # 64M - 64K
68 Pattern('0x77', 0x00f8000), # Partial-left (1M-32K)
69 Pattern('0x72', 0x2008000), # Partial-right (32M+32K)
70 Pattern('0x69', 0x3fe0000)]), # Adjacent-left (64M - 128K)
73 Pattern('0x74', 0x0010000), # Adjacent-right
74 Pattern('0x69', 0x00e8000), # Partial-left (1M-96K)
75 Pattern('0x6e', 0x2018000), # Partial-right (32M+96K)
77 2*GRANULARITY)]), # Overwrite [(64M-128K)-64M)
80 # Carefully chosen such that nothing re-dirties the one cluster
83 3*GRANULARITY), # Overwrite and 2x Adjacent-right
84 Pattern('0xbb', 0x00d8000), # Partial-left (1M-160K)
85 Pattern('0xcc', 0x2028000), # Partial-right (32M+160K)
105 self._bits -= set(bits)
127 Print a nice human-readable message checking that a bitmap as reported
156 iotests.qemu_img_create('-f', self.fmt, self.path, str(self.size))
159 basename = os.path.basename(self.path)
163 log(vm.cmd('blockdev-create', job_id='bdc-file-job',
169 vm.run_job('bdc-file-job')
170 log(vm.cmd('blockdev-add', driver='file',
173 log(vm.cmd('blockdev-create', job_id='bdc-fmt-job',
179 vm.run_job('bdc-fmt-job')
180 log(vm.cmd('blockdev-add', driver=fmt,
190 result = vm.qmp_log('blockdev-backup',
194 filter_node_name='backup-top',
195 x_perf={'max-workers': 1},
205 log("--- Reference Backup #{:d} ---\n".format(n))
214 log("--- Test Backup #{:d} ---\n".format(n))
217 kwargs.setdefault('auto-finalize', False)
223 log("--- Write #{:d} ---\n".format(n))
225 cmd = "write -P{:s} 0x{:07x} 0x{:x}".format(
227 pattern.offset,
239 Print a nice human-readable message comparing these images.
243 qemu_img("rebase", "-u", "-b", baseimg, '-F', iotests.imgfmt, image)
258 - on-success: This is the "incremental" style mode. Bitmaps are
261 - never: This is the "differential" style mode.
263 - always: This is a "best effort" style mode.
269 - bitmap: Backups based on bitmap manifest.
270 - full: Full backups.
271 - top: Full backups of the top layer only.
274 - None: No failure. Test the normative path. Default.
275 - simulated: Cancel the job right before it completes.
277 - intermediate: This tests a job that fails mid-process and produces
293 log('--- Preparing image & VM ---\n')
296 vm.add_device("{},id=scsi0".format('virtio-scsi'))
308 'set-state': [{
317 'inject-error': [{
327 vm.qmp_log('blockdev-add',
334 # 0 - Writes and Reference Backup
337 log('--- Add Bitmap ---\n')
338 vm.qmp_log("block-dirty-bitmap-add", node=drive0.node,
343 # 1 - Writes and Reference Backup
350 # 1 - Test Backup (w/ Optional induced failure)
352 # Activate blkdebug induced failure for second-to-next read
362 bitmaps = perform_writes(drive0, 2, filter_node_name='backup-top')
374 if ((bsync_mode == 'on-success' and not failure) or
402 # 2 - Writes and Reference Backup
408 # 2 - Bitmap Backup (In failure modes, this is a recovery.)
419 log('--- Cleanup ---\n')
420 vm.qmp_log("block-dirty-bitmap-remove",
427 log('--- Verification ---\n')
450 log('--- Preparing image & VM ---\n')
453 vm.add_device("{},id=scsi0".format('virtio-scsi'))
462 vm.qmp_log('blockdev-add',
473 vm.qmp_log("block-dirty-bitmap-add", node=drive0.node,
477 log('-- Testing invalid QMP commands --\n')
481 None: ['on-success', 'always', 'never', None],
482 'bitmap404': ['on-success', 'always', 'never', None],
486 None: ['on-success', 'always', 'never', None],
487 'bitmap404': ['on-success', 'always', 'never', None],
491 None: ['on-success', 'always', 'never'],
492 'bitmap404': ['on-success', 'always', 'never', None],
496 None: ['on-success', 'always', 'never'],
497 'bitmap404': ['on-success', 'always', 'never', None],
501 None: ['on-success', 'always', 'never'],
502 'bitmap404': ['on-success', 'always', 'never', None],
503 'bitmap0': ['on-success', 'always', 'never', None],
507 # Dicts, as always, are not stably-ordered prior to 3.7, so use tuples:
509 log("-- Sync mode {:s} tests --\n".format(sync_mode))
519 for bsync_mode in ("never", "on-success", "always"):
524 for bsync_mode in ('on-success', 'always'):