Lines Matching full:backing
134 # This test opens one single disk image (without backing files)
137 # Open 'hd0' only (no backing files)
175 # This test opens an image with a backing file and tries to reopen
178 # Open hd1 omitting the backing options (hd0 will be opened
184 # We can't reopen the image passing the same options, 'backing' is mandatory
185 self.reopen(opts, {}, "backing is missing for 'hd1'")
187 # Everything works if we pass 'backing' using the existing node name
191 self.reopen(opts, {'backing': backing_node_name})
193 # We can't use a non-existing or empty (non-NULL) node as the backing image
194 … self.reopen(opts, {'backing': 'not-found'}, "Cannot find device=\'\' nor node-name=\'not-found\'")
195 self.reopen(opts, {'backing': ''}, "Cannot find device=\'\' nor node-name=\'\'")
197 # We can reopen the image just fine if we specify the backing options
198 opts['backing'] = {'driver': iotests.imgfmt,
204 self.reopen(opts, {'backing.node-name': 'newname'}, "Cannot change the option 'node-name'")
205 self.reopen(opts, {'backing.driver': 'raw'}, "Cannot change the option 'driver'")
206 … self.reopen(opts, {'backing.file.node-name': 'newname'}, "Cannot change the option 'node-name'")
207 … self.reopen(opts, {'backing.file.driver': 'host_device'}, "Cannot change the option 'driver'")
226 # Open the hd1 image passing all backing options
228 opts['backing'] = hd_opts(0)
294 del opts['backing']['node-name']
295 del opts['backing']['file']['node-name']
299 # Reopen setting backing = null, this removes the backing image from the chain
300 self.reopen(opts, {'backing': None})
301 self.assert_qmp_absent(self.get_node('hd1'), 'image/backing-image')
306 # Reopen the hd1 image setting 'hd0' as its backing image
307 self.reopen(opts, {'backing': 'hd0'})
308 self.assert_qmp(self.get_node('hd1'), 'image/backing-image/filename', hd_path[0])
314 # The backing file (hd0) is now a reference, we cannot change backing.* anymore
315 self.reopen(opts, {}, "Cannot change the option 'backing.driver'")
317 # We can't remove 'hd0' while it's a backing image of 'hd1'
320 … self.assert_qmp(result, 'error/desc', "Node 'hd0' is busy: node is used as backing hd of 'hd1'")
389 # 'backing' option on reopen and verifies that the guest data that
394 # Open hd0, hd1 and hd2 without any backing image
397 opts[i]['backing'] = None
406 self.reopen(opts[0], {'backing': 'hd1'})
413 self.reopen(opts[2], {'backing': 'hd1'})
420 self.reopen(opts[0], {'backing': 'hd2'})
427 self.reopen(opts[2], {'backing': None})
434 self.reopen(opts[1], {'backing': 'hd2'})
435 self.reopen(opts[0], {'backing': 'hd1'})
442 self.reopen(opts[2], {'backing': 'hd1'},
443 "Making 'hd1' a backing child of 'hd2' would create a cycle")
446 self.reopen(opts[0], {'backing': 'hd2'})
453 self.reopen(opts[2], {'backing': 'hd1'},
454 "Making 'hd1' a backing child of 'hd2' would create a cycle")
460 … self.assert_qmp(result, 'error/desc', "Node 'hd2' is busy: node is used as backing hd of 'hd0'")
462 # hd1 doesn't have a backing file now
463 self.reopen(opts[1], {'backing': None})
469 # We can't remove the 'backing' option if the image has a
470 # default backing file
471 del opts[1]['backing']
472 self.reopen(opts[1], {}, "backing is missing for 'hd1'")
485 # Open all three images without backing file
488 opts[i]['backing'] = None
492 self.reopen(opts[0], {'backing': 'hd1'})
493 self.reopen(opts[2], {'backing': 'hd1'})
496 self.reopen(opts[1], {'backing': 'hd2'},
497 "Making 'hd2' a backing child of 'hd1' would create a cycle")
500 self.reopen(opts[2], {'backing': 'hd0'})
503 self.reopen(opts[1], {'backing': 'hd2'},
504 "Making 'hd2' a backing child of 'hd1' would create a cycle")
507 self.reopen(opts[1], {'backing': 'hd1'},
508 "Making 'hd1' a backing child of 'hd1' would create a cycle")
510 # Remove all backing files
528 self.reopen(opts[0], {'backing': 'bv'},
529 "Making 'bv' a backing child of 'hd0' would create a cycle")
636 # Add hd0 and hd2 (none of them with backing files)
687 # Open all three images without backing file
688 opts['backing'] = None
701 # You can't make quorum0 a backing file of hd0:
703 self.reopen(hd_opts(0), {'backing': 'quorum0'},
704 "Making 'quorum0' a backing child of 'hd0' would create a cycle")
823 # If an image has a backing file then the 'backing' option must be
835 # hd0 has no backing file: we can omit the 'backing' option
839 self.reopen(opts, {'backing': 'hd2'})
841 # hd0 has a backing file: we must set the 'backing' option
842 self.reopen(opts, {}, "backing is missing for 'hd0'")
844 # hd2 can't be removed because it's the backing file of hd0
847 … self.assert_qmp(result, 'error/desc', "Node 'hd2' is busy: node is used as backing hd of 'hd0'")
850 self.reopen(opts, {'backing': None})
852 # Without a backing file, we can omit 'backing' again
860 # If an image has default backing file (as part of its metadata)
861 # then the 'backing' option must be passed on reopen. We don't
866 # (hd0 is hd1's default backing file)
870 # hd1 has a backing file: we can't omit the 'backing' option
871 self.reopen(opts, {}, "backing is missing for 'hd1'")
873 # Let's detach the backing file
874 self.reopen(opts, {'backing': None})
876 # No backing file attached to hd1 now, but we still can't omit the 'backing' option
877 self.reopen(opts, {}, "backing is missing for 'hd1'")
881 # Test that making 'backing' a reference to an existing child
886 opts['backing'] = hd_opts(1)
887 opts['backing']['backing'] = hd_opts(2)
890 opts['backing']['detect-zeroes'] = 'on'
891 opts['backing']['backing']['detect-zeroes'] = 'on'
895 # By making 'backing' a reference to hd1 (instead of a sub-dict)
900 'backing': 'hd1' }
913 opts['backing'] = hd_opts(1)
914 opts['backing']['backing'] = None
924 # We have backing.* options but there's no backing file anymore
925 self.reopen(opts, {}, "Cannot change the option 'backing.driver'")
927 # If we remove the 'backing' option then we can reopen hd0 just fine
928 del opts['backing']
931 # We can also reopen hd0 if we set 'backing' to null
932 self.reopen(opts, {'backing': None})
940 opts['backing'] = hd_opts(1)
941 opts['backing']['backing'] = hd_opts(2)
952 # The backing options in the dict were meant for hd1, but we cannot
953 # use them with hd2 because hd1 had a backing file while hd2 does not.
954 self.reopen(opts, {}, "Cannot change the option 'backing.driver'")
957 opts['backing'] = opts['backing']['backing']
960 # We can also reopen hd0 if we use a reference to the backing file
961 self.reopen(opts, {'backing': 'hd2'})
964 del opts['backing']
965 self.reopen(opts, {}, "backing is missing for 'hd0'")
975 opts['backing'] = hd_opts(1)
976 opts['backing']['backing'] = hd_opts(2)
985 opts['backing']['backing'] = None
989 opts['backing'] = None
990 self.reopen(opts, {}, "Cannot change frozen 'backing' link from 'hd0' to 'hd1'")
998 opts['backing'] = hd_opts(1)
999 opts['backing']['backing'] = hd_opts(2)
1010 "Cannot change the option 'backing.backing.file.node-name'")
1014 self.reopen(opts['backing'], {'read-only': True},
1018 opts['backing']['backing'] = None
1019 self.reopen(opts['backing'], {'read-only': False},
1020 "Cannot change frozen 'backing' link from 'hd1' to 'hd2'")
1023 opts['backing'] = None
1032 opts['backing'] = hd_opts(1)
1033 opts['backing']['backing'] = hd_opts(2)
1040 opts['backing']['backing'] = None
1041 self.reopen(opts, {}, "Cannot change frozen 'backing' link from 'hd1' to 'hd2'")
1044 opts['backing'] = None
1045 self.reopen(opts, {}, "Cannot change frozen 'backing' link from 'hd0' to 'hd1'")
1060 opts['backing'] = hd_opts(1)
1061 opts['backing']['backing'] = hd_opts(2)
1069 opts['backing']['backing'] = None
1070 self.reopen(opts, {}, "Cannot change the option 'backing.driver'")
1073 opts['backing'] = None
1074 self.reopen(opts, {}, "Cannot replace implicit backing child of hd0")
1109 # Attaching the backing file may or may not work
1110 self.reopen(opts, {'backing': 'hd2'}, errmsg)
1112 # But removing the backing file should always work
1113 self.reopen(opts, {'backing': None})
1117 # We don't allow setting a backing file that uses a different AioContext if