)]}'
{"nova/virt/libvirt/driver.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6f3c6858e5a2346199caaa590d2b247c937b4745","unresolved":true,"context_lines":[{"line_number":571,"context_line":"        # See also nova.virt.libvirt.cpu.api.API.core()."},{"line_number":572,"context_line":"        self.cpu_api \u003d libvirt_cpu.API()"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    @property"},{"line_number":575,"context_line":"    def use_legacy_imagebackend(self):"},{"line_number":576,"context_line":"        return isinstance(self.image_backend, imagebackend_legacy.Backend)"},{"line_number":577,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bb87e0d1_3ac450b3","line":574,"updated":"2024-08-07 01:55:06.000000000","message":"i dont really object to the property but i am not a fan of the sprinkling of if condiotns across the code this is intoducing.\n\ni feel like we need to consider what the image backend api should looklike and refactor the api to remove alluse of callback funioction or functs as function arguments.","commit_id":"f79c1ffdf7a2b3a58c1467a8e9ff23ed4ddb6188"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a5339513863e60659ea9683ffb246cc12a233de0","unresolved":true,"context_lines":[{"line_number":571,"context_line":"        # See also nova.virt.libvirt.cpu.api.API.core()."},{"line_number":572,"context_line":"        self.cpu_api \u003d libvirt_cpu.API()"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    @property"},{"line_number":575,"context_line":"    def use_legacy_imagebackend(self):"},{"line_number":576,"context_line":"        return isinstance(self.image_backend, imagebackend_legacy.Backend)"},{"line_number":577,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"eb0acb81_2e5cf295","line":574,"in_reply_to":"bb87e0d1_3ac450b3","updated":"2024-08-07 07:06:42.000000000","message":"Yeah, I followed the pattern John used for unified limits to make it configurable and make the legacy code path a no-op when the new code path is configured. Doesn\u0027t have to be this way obviously but I just wanted to throw something together.","commit_id":"f79c1ffdf7a2b3a58c1467a8e9ff23ed4ddb6188"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6f3c6858e5a2346199caaa590d2b247c937b4745","unresolved":true,"context_lines":[{"line_number":5097,"context_line":"                                image_id\u003ddisk_images[\u0027kernel_id\u0027])"},{"line_number":5098,"context_line":"            if not self.use_legacy_imagebackend:"},{"line_number":5099,"context_line":"                raw(\u0027kernel\u0027).create_root("},{"line_number":5100,"context_line":"                    context, fname, None, disk_images[\u0027kernel_id\u0027])"},{"line_number":5101,"context_line":""},{"line_number":5102,"context_line":"            if disk_images[\u0027ramdisk_id\u0027]:"},{"line_number":5103,"context_line":"                fname \u003d imagecache.get_cache_fname(disk_images[\u0027ramdisk_id\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"27813bba_1ed38cd4","line":5100,"updated":"2024-08-07 01:55:06.000000000","message":"i know this is just a poc but im honestly not sold on this as an approch to replacing the existing backend.\n\ni dont think we should be trying to maintin the exisitng api and passing a function arguments like fetch_func  to the cache call.\n\npassing the file name as fname is possible ok but that perhaps sould be caluated by the backend  instead of the driver code.\n\ncall this function creat_root instead of create_disk or create_backend_volume also does not help with clarity in this case.\n\ncreate_root implies its only for a specific usecase but in reality its a generic fucntion we are reusing form mutiple cases.","commit_id":"f79c1ffdf7a2b3a58c1467a8e9ff23ed4ddb6188"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a5339513863e60659ea9683ffb246cc12a233de0","unresolved":true,"context_lines":[{"line_number":5097,"context_line":"                                image_id\u003ddisk_images[\u0027kernel_id\u0027])"},{"line_number":5098,"context_line":"            if not self.use_legacy_imagebackend:"},{"line_number":5099,"context_line":"                raw(\u0027kernel\u0027).create_root("},{"line_number":5100,"context_line":"                    context, fname, None, disk_images[\u0027kernel_id\u0027])"},{"line_number":5101,"context_line":""},{"line_number":5102,"context_line":"            if disk_images[\u0027ramdisk_id\u0027]:"},{"line_number":5103,"context_line":"                fname \u003d imagecache.get_cache_fname(disk_images[\u0027ramdisk_id\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"f52ae5b5_18f9d94b","line":5100,"in_reply_to":"27813bba_1ed38cd4","updated":"2024-08-07 07:06:42.000000000","message":"The new code path in this experiment does not use any fetch_func function objects passing around or callback functions. That\u0027s just the old code still there \"side by side\".\n\nAnd create_root is really for only creating root disks. There is create_ephemeral and create_swap for ephemeral and swap. For me it makes it a lot clearer.","commit_id":"f79c1ffdf7a2b3a58c1467a8e9ff23ed4ddb6188"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6f3c6858e5a2346199caaa590d2b247c937b4745","unresolved":true,"context_lines":[{"line_number":5146,"context_line":"                disk_image.create_ephemeral("},{"line_number":5147,"context_line":"                    context, fname, ephemeral_gb, \u0027ephemeral0\u0027,"},{"line_number":5148,"context_line":"                    instance.os_type, vm_mode\u003dvm_mode)"},{"line_number":5149,"context_line":""},{"line_number":5150,"context_line":"        for idx, eph in enumerate(driver.block_device_info_get_ephemerals("},{"line_number":5151,"context_line":"                block_device_info)):"},{"line_number":5152,"context_line":"            disk_name \u003d blockinfo.get_eph_disk(idx)"}],"source_content_type":"text/x-python","patch_set":6,"id":"0625553d_cab77e18","line":5149,"updated":"2024-08-07 01:55:06.000000000","message":"does this need to be a diffent function from create_root or create swap really?\n\ni feel like there should be a lot of comonality in the initall create of the file or lvm/rbd volumen\n\nfollowed by an optinal format step to an ephmeral format or swap.\n\nso in thinking about a new image backend api we should consider fi we should have seperate create_ephmeral and crate_swap calls or if this should just be a generic create a of volume followed by a format of the volume\n\ni would also consider if we watn to suprot a chaing api pattern so you could do something like this\n```\nswap_disk \u003d backend.create_disk(…).format_disk(format\u003dswap)\nepmeral_disk \u003d backend.create_disk(…).format_disk(format\u003d‘ext4’)\n```\nassuming we have a disk object retruned by create_disk that would allow us\nto assocate all operation we could do on the dks with that objet by storing a refernce to the backend in the disk\nto support chaining we would have to return self form each of those fucntions\n\ni.e. we can do something like this to create an encypted image\n```\ncached_disk \u003d backend.cache(glance_uuid)\nencypted_disk \u003d backend.create_disk().resize_disk().encrypt_disk()\nwith encypted_disk.mount as md:\n  md.copy_data(cached_disk) # internally this woudl use cached_disk to find/read the data\n```\n\nfor a normal iamge we can do somethign like this\n\n```\ncached_disk \u003d backend.cache(glance_uuid)\nunencypted_disk \u003d backend.create_disk().resize_disk().copy_data(cached_disk)\n```\nor\n\n\n```\ncached_disk \u003d backend.cache(glance_uuid)\nunencypted_disk \u003d backend.clone_disk(cached_disk)\n```","commit_id":"f79c1ffdf7a2b3a58c1467a8e9ff23ed4ddb6188"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a5339513863e60659ea9683ffb246cc12a233de0","unresolved":true,"context_lines":[{"line_number":5146,"context_line":"                disk_image.create_ephemeral("},{"line_number":5147,"context_line":"                    context, fname, ephemeral_gb, \u0027ephemeral0\u0027,"},{"line_number":5148,"context_line":"                    instance.os_type, vm_mode\u003dvm_mode)"},{"line_number":5149,"context_line":""},{"line_number":5150,"context_line":"        for idx, eph in enumerate(driver.block_device_info_get_ephemerals("},{"line_number":5151,"context_line":"                block_device_info)):"},{"line_number":5152,"context_line":"            disk_name \u003d blockinfo.get_eph_disk(idx)"}],"source_content_type":"text/x-python","patch_set":6,"id":"6fc4fa58_aa04f93f","line":5149,"in_reply_to":"0625553d_cab77e18","updated":"2024-08-07 07:06:42.000000000","message":"For me, keeping them separate helps with clarity. I felt like one of the main difficulties with the existing imagebackend is how it uses one function for creating any kind of disk -- that\u0027s why it was passing fetch_func\u0027s around.\n\nI\u0027m not completely opposed to trying to combine all of them somehow but my initial feeling was having them separate would make reading the code a lot easier.","commit_id":"f79c1ffdf7a2b3a58c1467a8e9ff23ed4ddb6188"}]}
