)]}'
{"nova/virt/xenapi/fake.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"aae2af8696ec2f0932ef05df9ae6540895ed9cfe","unresolved":false,"context_lines":[{"line_number":448,"context_line":""},{"line_number":449,"context_line":"    def VDI_remove_from_other_config(self, _1, vdi_ref, key):"},{"line_number":450,"context_line":"        db_ref \u003d _db_content[\u0027VDI\u0027][vdi_ref]"},{"line_number":451,"context_line":"        if not \u0027other_config\u0027 in db_ref:"},{"line_number":452,"context_line":"            return"},{"line_number":453,"context_line":"        db_ref[\u0027other_config\u0027][key] \u003d None"},{"line_number":454,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAEn%2F%2F9as%3D","line":451,"updated":"2012-02-08 15:26:53.000000000","message":"Would it make sense to change these to be a bit cleaner:\n\nif \u0027other_config\u0027 in db_ref:\n    db_ref[\u0027other_config\u0027][key] \u003d None\n\nThen I believe you can omit the if/return altogether.","commit_id":"42f963b490ddc1d2d08209c31c73e3b301b0e33a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0e98cb3f3be0008a0424b3df238e568a02988639","unresolved":false,"context_lines":[{"line_number":457,"context_line":"        if not \u0027other_config\u0027 in db_ref:"},{"line_number":458,"context_line":"            db_ref[\u0027other_config\u0027] \u003d {}"},{"line_number":459,"context_line":"        db_ref[\u0027other_config\u0027][key] \u003d value"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"    def VDI_copy(self, _1, vdi_to_copy_ref, sr_ref):"},{"line_number":462,"context_line":"        db_ref \u003d _db_content[\u0027VDI\u0027][vdi_to_copy_ref]"},{"line_number":463,"context_line":"        name_label \u003d db_ref[\u0027name_label\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAEn%2F%2F9RI%3D","line":460,"updated":"2012-02-08 18:55:45.000000000","message":"VDI_copy and VDI_clone are doing substantially the same thing. Maybe a helper method will avoid code duplication.","commit_id":"42f963b490ddc1d2d08209c31c73e3b301b0e33a"}],"nova/virt/xenapi/vm_utils.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"c8f90971c7ede67727c1050200f2dec669fc8c45","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        parent_uuid \u003d _wait_for_vhd_coalesce("},{"line_number":337,"context_line":"            session, instance, sr_ref, vm_vdi_ref, original_parent_uuid)"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"        #TODO(sirp): we need to assert only one parent, not parents two deep"},{"line_number":340,"context_line":"        template_vdi_uuids \u003d {\u0027image\u0027: parent_uuid,"},{"line_number":341,"context_line":"                              \u0027snap\u0027: template_vdi_uuid}"},{"line_number":342,"context_line":"        return template_vm_ref, template_vdi_uuids"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEH%2F%2F9HA%3D","side":"PARENT","line":339,"updated":"2012-01-30 02:39:59.000000000","message":"Is this comment still valid?","commit_id":"99daaea663ade3839142f538427faa85d0e64c8f"},{"author":{"_account_id":2093,"name":"Devdeep Singh","email":"devdeep.singh@citrix.com","username":"devdeep-singh"},"change_message_id":"6e3398ae9309b1889e3ef65d22a8d28ecc4c2fca","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        parent_uuid \u003d _wait_for_vhd_coalesce("},{"line_number":337,"context_line":"            session, instance, sr_ref, vm_vdi_ref, original_parent_uuid)"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"        #TODO(sirp): we need to assert only one parent, not parents two deep"},{"line_number":340,"context_line":"        template_vdi_uuids \u003d {\u0027image\u0027: parent_uuid,"},{"line_number":341,"context_line":"                              \u0027snap\u0027: template_vdi_uuid}"},{"line_number":342,"context_line":"        return template_vm_ref, template_vdi_uuids"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEH%2F%2F9Fk%3D","side":"PARENT","line":339,"in_reply_to":"AAAAEH%2F%2F9HA%3D","updated":"2012-01-30 12:42:13.000000000","message":"I\u0027ll remove this comment.","commit_id":"99daaea663ade3839142f538427faa85d0e64c8f"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"2f82f21e0d9ed0feab78080a4364934828888d69","unresolved":false,"context_lines":[{"line_number":371,"context_line":"        return os.path.join(FLAGS.xenapi_sr_base_path, sr_uuid)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    @classmethod"},{"line_number":374,"context_line":"    def find_cached_image(cls, session, image_id):"},{"line_number":375,"context_line":"        \"\"\"Returns the vdi-ref of the cached image.\"\"\""},{"line_number":376,"context_line":"        vdi_refs \u003d session.call_xenapi(\u0027VDI.get_all\u0027)"},{"line_number":377,"context_line":"        for vdi_ref in vdi_refs:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEH%2F%2F8mg%3D","line":374,"updated":"2012-01-31 21:59:09.000000000","message":"To my reading of this, cached images are stored in the same location as images which are in use for instances. Is that correct? libvirt puts the cached images in a _base subdirectory of the normal storage location, which makes it clear to operators that they\u0027re part of the cache and not in use by an instance directly. It would be nice to have something similar here if possible.","commit_id":"51590b72acab4ee121390441b41bf79e2d61e056"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"c8f90971c7ede67727c1050200f2dec669fc8c45","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        \"\"\"Returns the vdi-ref of the cached image.\"\"\""},{"line_number":376,"context_line":"        vdi_refs \u003d session.call_xenapi(\u0027VDI.get_all\u0027)"},{"line_number":377,"context_line":"        for vdi_ref in vdi_refs:"},{"line_number":378,"context_line":"            vdi_rec \u003d session.call_xenapi(\u0027VDI.get_record\u0027, vdi_ref)"},{"line_number":379,"context_line":"            if (\u0027image-id\u0027 in vdi_rec[\u0027other_config\u0027] and"},{"line_number":380,"context_line":"                vdi_rec[\u0027other_config\u0027][\u0027image-id\u0027] \u003d\u003d image_id):"},{"line_number":381,"context_line":"                    return vdi_ref"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEH%2F%2F9HI%3D","line":378,"updated":"2012-01-30 02:39:59.000000000","message":"I think you might want to catch a XenAPI exception here.  There\u0027s a race condition here in that a VDI could have been removed between the VDI.get_all and then trying to load the VDI record.  You\u0027d want to ignore a VDI if it disappeared instead of failing this whole process.  You wouldn\u0027t want a randomly removed VDI to affect finding a cached VDI that wasn\u0027t removed.","commit_id":"51590b72acab4ee121390441b41bf79e2d61e056"},{"author":{"_account_id":2093,"name":"Devdeep Singh","email":"devdeep.singh@citrix.com","username":"devdeep-singh"},"change_message_id":"6e3398ae9309b1889e3ef65d22a8d28ecc4c2fca","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        \"\"\"Returns the vdi-ref of the cached image.\"\"\""},{"line_number":376,"context_line":"        vdi_refs \u003d session.call_xenapi(\u0027VDI.get_all\u0027)"},{"line_number":377,"context_line":"        for vdi_ref in vdi_refs:"},{"line_number":378,"context_line":"            vdi_rec \u003d session.call_xenapi(\u0027VDI.get_record\u0027, vdi_ref)"},{"line_number":379,"context_line":"            if (\u0027image-id\u0027 in vdi_rec[\u0027other_config\u0027] and"},{"line_number":380,"context_line":"                vdi_rec[\u0027other_config\u0027][\u0027image-id\u0027] \u003d\u003d image_id):"},{"line_number":381,"context_line":"                    return vdi_ref"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEH%2F%2F9Fw%3D","line":378,"in_reply_to":"AAAAEH%2F%2F9HI%3D","updated":"2012-01-30 12:42:13.000000000","message":"I\u0027ll add the code to catch the exception and ignore it, instead of failing the whole process.","commit_id":"51590b72acab4ee121390441b41bf79e2d61e056"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"c8f90971c7ede67727c1050200f2dec669fc8c45","unresolved":false,"context_lines":[{"line_number":1287,"context_line":""},{"line_number":1288,"context_line":"    def _get_all_vdis_in_sr():"},{"line_number":1289,"context_line":"        for ref in session.call_xenapi(\u0027SR.get_VDIs\u0027, sr_ref):"},{"line_number":1290,"context_line":"            rec \u003d session.call_xenapi(\u0027VDI.get_record\u0027, ref)"},{"line_number":1291,"context_line":"            # Check to make sure the record still exists."},{"line_number":1292,"context_line":"            if rec:"},{"line_number":1293,"context_line":"                yield rec"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEH%2F%2F9G8%3D","line":1290,"updated":"2012-01-30 02:39:59.000000000","message":"Similar thing in another spot.  I think this should ignore an exception thrown where the VDI might have been deleted... and continue through the loop.  Since this loop is used in a couple spots, maybe this method should be promoted.","commit_id":"51590b72acab4ee121390441b41bf79e2d61e056"},{"author":{"_account_id":2093,"name":"Devdeep Singh","email":"devdeep.singh@citrix.com","username":"devdeep-singh"},"change_message_id":"6e3398ae9309b1889e3ef65d22a8d28ecc4c2fca","unresolved":false,"context_lines":[{"line_number":1287,"context_line":""},{"line_number":1288,"context_line":"    def _get_all_vdis_in_sr():"},{"line_number":1289,"context_line":"        for ref in session.call_xenapi(\u0027SR.get_VDIs\u0027, sr_ref):"},{"line_number":1290,"context_line":"            rec \u003d session.call_xenapi(\u0027VDI.get_record\u0027, ref)"},{"line_number":1291,"context_line":"            # Check to make sure the record still exists."},{"line_number":1292,"context_line":"            if rec:"},{"line_number":1293,"context_line":"                yield rec"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEH%2F%2F9Fs%3D","line":1290,"in_reply_to":"AAAAEH%2F%2F9G8%3D","updated":"2012-01-30 12:42:13.000000000","message":"I\u0027ll add a similar exception block here and promote this method so that it can be used at both the places.","commit_id":"51590b72acab4ee121390441b41bf79e2d61e056"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0e98cb3f3be0008a0424b3df238e568a02988639","unresolved":false,"context_lines":[{"line_number":387,"context_line":"        sr_uuid \u003d sr_rec[\"uuid\"]"},{"line_number":388,"context_line":"        return os.path.join(FLAGS.xenapi_sr_base_path, sr_uuid)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    @classmethod"},{"line_number":391,"context_line":"    def find_cached_image(cls, session, image_id, sr_ref):"},{"line_number":392,"context_line":"        \"\"\"Returns the vdi-ref of the cached image.\"\"\""},{"line_number":393,"context_line":"        for vdi_ref, vdi_rec in _get_all_vdis_in_sr(session, sr_ref):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAEn%2F%2F9Q8%3D","line":390,"updated":"2012-02-08 18:55:45.000000000","message":"I wonder if this could be actually improved with some filter on other-config and image-id (so making xapi do the heavy-lifting). With the growth of the number of VDIs this loop may take a while.","commit_id":"42f963b490ddc1d2d08209c31c73e3b301b0e33a"},{"author":{"_account_id":2093,"name":"Devdeep Singh","email":"devdeep.singh@citrix.com","username":"devdeep-singh"},"change_message_id":"5328c46500cbbd4b1fc876f09547606c2d5484d9","unresolved":false,"context_lines":[{"line_number":387,"context_line":"        sr_uuid \u003d sr_rec[\"uuid\"]"},{"line_number":388,"context_line":"        return os.path.join(FLAGS.xenapi_sr_base_path, sr_uuid)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    @classmethod"},{"line_number":391,"context_line":"    def find_cached_image(cls, session, image_id, sr_ref):"},{"line_number":392,"context_line":"        \"\"\"Returns the vdi-ref of the cached image.\"\"\""},{"line_number":393,"context_line":"        for vdi_ref, vdi_rec in _get_all_vdis_in_sr(session, sr_ref):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAEn%2F%2F81g%3D","line":390,"in_reply_to":"AAAAEn%2F%2F9Q8%3D","updated":"2012-02-09 07:20:42.000000000","message":"I had looked at filtering VDI based on other-config and image-id. However, right now I don\u0027t know of a way to do it using xapi. I haven\u0027t the implementation to search for cached images only in the SR we are interested in.","commit_id":"42f963b490ddc1d2d08209c31c73e3b301b0e33a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0e98cb3f3be0008a0424b3df238e568a02988639","unresolved":false,"context_lines":[{"line_number":601,"context_line":"        Returns: A list of dictionaries that describe VDIs"},{"line_number":602,"context_line":"        \"\"\""},{"line_number":603,"context_line":"        if FLAGS.cache_images \u003d\u003d False or image_type \u003d\u003d ImageType.DISK_ISO:"},{"line_number":604,"context_line":"            # If caching is disabled, we do not have to keep a copy of the"},{"line_number":605,"context_line":"            # image. Fetch the image from glance."},{"line_number":606,"context_line":"            return cls.fetch_image(context, session,"},{"line_number":607,"context_line":"                instance, instance.image_ref,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAEn%2F%2F9Qs%3D","line":604,"updated":"2012-02-08 18:55:45.000000000","message":"I\u0027d suggest update this comment to reflect the fact that you don\u0027t keep the copy of the image even in the ISO case. However the bool condition is pretty clear.","commit_id":"42f963b490ddc1d2d08209c31c73e3b301b0e33a"}],"nova/virt/xenapi/vmops.py":[{"author":{"_account_id":706,"name":"Brian Lamar","email":"brian.lamar@rackspace.com","username":"blamar"},"change_message_id":"88697704f74078b1f2fa210b5c28636cfb158cb4","unresolved":false,"context_lines":[{"line_number":42,"context_line":"from nova.virt.xenapi import volume_utils"},{"line_number":43,"context_line":"from nova.virt.xenapi import network_utils"},{"line_number":44,"context_line":"from nova.virt.xenapi import vm_utils"},{"line_number":45,"context_line":"from nova.virt.xenapi.vm_utils import ImageType"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"VolumeHelper \u003d volume_utils.VolumeHelper"},{"line_number":48,"context_line":"NetworkHelper \u003d network_utils.NetworkHelper"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAEH%2F%2F%2BXE%3D","line":45,"updated":"2012-01-25 05:17:37.000000000","message":"As a rule, please import only modules and not classes. This line shouldn\u0027t be needed, as the preceding import does the work already.","commit_id":"fb8c32b6496fd2ac5d5100f0a32d1059f6016a8c"},{"author":{"_account_id":706,"name":"Brian Lamar","email":"brian.lamar@rackspace.com","username":"blamar"},"change_message_id":"88697704f74078b1f2fa210b5c28636cfb158cb4","unresolved":false,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def _create_disks(self, context, instance, image_meta):"},{"line_number":176,"context_line":"        disk_image_type \u003d VMHelper.determine_disk_image_type(image_meta)"},{"line_number":177,"context_line":"        if disk_image_type \u003d\u003d ImageType.DISK_ISO:"},{"line_number":178,"context_line":"            vdis \u003d VMHelper.fetch_image(context, self._session,"},{"line_number":179,"context_line":"                instance, instance.image_ref,"},{"line_number":180,"context_line":"                instance.user_id, instance.project_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAEH%2F%2F%2BXA%3D","line":177,"updated":"2012-01-25 05:17:37.000000000","message":"Update to \u0027vm_utils.ImageType.DISK_ISO\u0027","commit_id":"fb8c32b6496fd2ac5d5100f0a32d1059f6016a8c"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"06815fee071823aad20df643caa2dca753b1852c","unresolved":false,"context_lines":[{"line_number":188,"context_line":"                instance.user_id, instance.project_id,"},{"line_number":189,"context_line":"                disk_image_type, cow\u003dFLAGS.use_cow_images)"},{"line_number":190,"context_line":"        else:"},{"line_number":191,"context_line":"            vdis \u003d VMHelper.fetch_image(context, self._session,"},{"line_number":192,"context_line":"                instance, instance.image_ref,"},{"line_number":193,"context_line":"                instance.user_id, instance.project_id,"},{"line_number":194,"context_line":"                disk_image_type)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F99o%3D","line":191,"updated":"2012-02-07 19:31:43.000000000","message":"You could probably move this \u0027if\u0027 into VMHelper.create_image() and only call that here.  Since VMHelper.create_image() already has a fallback to fetch_image(), it seems like you might be able to consolidate some things and get rid of the \u0027if\u0027 here.  I only mention this because of my other comment below.  You could do the same thing there.  Not a huge concern, though...  My bigger issue is that it appears kernel/ramdisks are always cached despite FLAGS.cache_images possibly being False.","commit_id":"19cdf481005c8a91a5a2b73941681e1de29e24b0"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"06815fee071823aad20df643caa2dca753b1852c","unresolved":false,"context_lines":[{"line_number":273,"context_line":"        ramdisk \u003d None"},{"line_number":274,"context_line":"        try:"},{"line_number":275,"context_line":"            if instance.kernel_id:"},{"line_number":276,"context_line":"                kernel \u003d VMHelper.create_kernel_image(context, self._session,"},{"line_number":277,"context_line":"                        instance, instance.kernel_id, instance.user_id,"},{"line_number":278,"context_line":"                        instance.project_id, vm_utils.ImageType.KERNEL)[0]"},{"line_number":279,"context_line":"            if instance.ramdisk_id:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F99w%3D","line":276,"updated":"2012-02-07 19:31:43.000000000","message":"Seems like these need to check FLAGS.cache_images as well?   Or... the check could be added in create_kernel_image() itself.","commit_id":"19cdf481005c8a91a5a2b73941681e1de29e24b0"}],"plugins/xenserver/xenapi/etc/xapi.d/plugins/glance":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"c8f90971c7ede67727c1050200f2dec669fc8c45","unresolved":false,"context_lines":[{"line_number":314,"context_line":"    (\u0027snap\u0027 or \u0027image.vhd\u0027)"},{"line_number":315,"context_line":"    \"\"\""},{"line_number":316,"context_line":"    for name, uuid in vdi_uuids.items():"},{"line_number":317,"context_line":"        if uuid:"},{"line_number":318,"context_line":"            source \u003d os.path.join(sr_path, \"%s.vhd\" % uuid)"},{"line_number":319,"context_line":"            link_name \u003d os.path.join(staging_path, \"%s.vhd\" % name)"},{"line_number":320,"context_line":"            os.link(source, link_name)"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAAEH%2F%2F9HE%3D","line":317,"updated":"2012-01-30 02:39:59.000000000","message":"What\u0027s the reason for this addition?","commit_id":"51590b72acab4ee121390441b41bf79e2d61e056"},{"author":{"_account_id":2093,"name":"Devdeep Singh","email":"devdeep.singh@citrix.com","username":"devdeep-singh"},"change_message_id":"6e3398ae9309b1889e3ef65d22a8d28ecc4c2fca","unresolved":false,"context_lines":[{"line_number":314,"context_line":"    (\u0027snap\u0027 or \u0027image.vhd\u0027)"},{"line_number":315,"context_line":"    \"\"\""},{"line_number":316,"context_line":"    for name, uuid in vdi_uuids.items():"},{"line_number":317,"context_line":"        if uuid:"},{"line_number":318,"context_line":"            source \u003d os.path.join(sr_path, \"%s.vhd\" % uuid)"},{"line_number":319,"context_line":"            link_name \u003d os.path.join(staging_path, \"%s.vhd\" % name)"},{"line_number":320,"context_line":"            os.link(source, link_name)"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAAEH%2F%2F9Fo%3D","line":317,"in_reply_to":"AAAAEH%2F%2F9HE%3D","updated":"2012-01-30 12:42:13.000000000","message":"If the cow flag is turned off (false), there is no base disk available (only image and snap are available). This check is to guard against a failure when \u0027base\u0027 is passed as \u0027None\u0027.","commit_id":"51590b72acab4ee121390441b41bf79e2d61e056"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"e70dd20792a6a2a7d5e17976e03cd5bdef0c0b65","unresolved":false,"context_lines":[{"line_number":321,"context_line":"    \"\"\""},{"line_number":322,"context_line":"    for name, uuid in vdi_uuids.items():"},{"line_number":323,"context_line":"        if uuid:"},{"line_number":324,"context_line":"            source \u003d os.path.join(sr_path, \"%s.vhd\" % uuid)"},{"line_number":325,"context_line":"            link_name \u003d os.path.join(staging_path, \"%s.vhd\" % name)"},{"line_number":326,"context_line":"            os.link(source, link_name)"},{"line_number":327,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":6,"id":"AAAAEn%2F%2F7JA%3D","line":324,"updated":"2012-02-14 03:51:09.000000000","message":"Just curious, about the case of Not uuid here?  Maybe you could explain to me via email for my own education?","commit_id":"6c3bc216c1f35c42604b685eebd8fa25828d0e0e"}]}
