)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"ae5f5cf8db27fec13d4104243157e69b289790fc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":53,"id":"3c2e8363_b1230407","updated":"2021-11-13 15:47:48.000000000","message":"Should we abandon this change or is there anything we\u0027d want to improve and eventually merge ?   I\u0027m cleaning up my dashboard of merge conflicts and this one is one of them.  Should I create a RFE at best to improve this behavior ?","commit_id":"cd42c5433b38499e95714e4de0f642668955d15c"}],"cinder/image/image_utils.py":[{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"7b59d3ec6bc8150708c74e1759071d0f3f80ef8c","unresolved":false,"context_lines":[{"line_number":666,"context_line":"        if is_xenserver_format(image_meta):"},{"line_number":667,"context_line":"            replace_xenserver_image_with_coalesced_vhd(tmp)"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"        if not qemu_img:"},{"line_number":670,"context_line":"            # qemu-img is not installed but we do have a RAW image.  As a"},{"line_number":671,"context_line":"            # result we only need to copy the image to the destination and then"},{"line_number":672,"context_line":"            # return."}],"source_content_type":"text/x-python","patch_set":6,"id":"9f560f44_d387de60","line":669,"updated":"2020-07-31 12:29:29.000000000","message":"This change duplicates a similar operation to what is done here if qemu-img is not installed.","commit_id":"3bc63829f1f2925ade638d1f4ad9aac5734f713e"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"7b59d3ec6bc8150708c74e1759071d0f3f80ef8c","unresolved":false,"context_lines":[{"line_number":732,"context_line":"        else:"},{"line_number":733,"context_line":"            LOG.debug(\"%s was %s, no need to convert to %s, copying instead\","},{"line_number":734,"context_line":"                      image_id, fmt, volume_format)"},{"line_number":735,"context_line":"            volume_utils.copy_volume(tmp, dest, size, blocksize)"},{"line_number":736,"context_line":""},{"line_number":737,"context_line":""},{"line_number":738,"context_line":"def _validate_file_format(image_data, expected_format):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f560f44_b3922a9d","line":735,"updated":"2020-07-31 12:29:29.000000000","message":"This is only an improvement if dd is actually more efficient than qemu-img at moving a large amount of data, which I doubt is the case.","commit_id":"3bc63829f1f2925ade638d1f4ad9aac5734f713e"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"4f0567808ceb87ff9cfe528773a2b19979209340","unresolved":true,"context_lines":[{"line_number":631,"context_line":"    LOG.debug(\"Downloading image %s directly to %s, size: %s\", image_id,"},{"line_number":632,"context_line":"              dest, image_size_m)"},{"line_number":633,"context_line":"    start_time \u003d timeutils.utcnow()"},{"line_number":634,"context_line":"    cmd \u003d [\"openstack\", \"image\", \"save\", \"--os-token\","},{"line_number":635,"context_line":"           context.auth_token, \"--file\", dest, \"--os-endpoint\","},{"line_number":636,"context_line":"           endpoint, image_id]"},{"line_number":637,"context_line":"    if CONF.glance_ca_certificates_file:"},{"line_number":638,"context_line":"        cmd.append(\"--cacert\", CONF.glance_ca_certificates_file)"},{"line_number":639,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":40,"id":"eb7fb0f0_3d73b772","line":636,"range":{"start_line":634,"start_character":0,"end_line":636,"end_character":30},"updated":"2021-01-04 07:28:56.000000000","message":"since the start time and end time is calculated, is it being compared to the performance of previous flow of converting raw to raw volumes?\nThis surely does save us space but we shouldn\u0027t land into a worse performance than before","commit_id":"199385cc703ebec60155fc805b44ec1a7f1552ed"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"7d36a2ef8d095fe8f3a776f88356196b70896dd9","unresolved":true,"context_lines":[{"line_number":631,"context_line":"    LOG.debug(\"Downloading image %s directly to %s, size: %s\", image_id,"},{"line_number":632,"context_line":"              dest, image_size_m)"},{"line_number":633,"context_line":"    start_time \u003d timeutils.utcnow()"},{"line_number":634,"context_line":"    cmd \u003d [\"openstack\", \"image\", \"save\", \"--os-token\","},{"line_number":635,"context_line":"           context.auth_token, \"--file\", dest, \"--os-endpoint\","},{"line_number":636,"context_line":"           endpoint, image_id]"},{"line_number":637,"context_line":"    if CONF.glance_ca_certificates_file:"},{"line_number":638,"context_line":"        cmd.append(\"--cacert\", CONF.glance_ca_certificates_file)"},{"line_number":639,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":40,"id":"f97985b3_2b276872","line":636,"range":{"start_line":634,"start_character":0,"end_line":636,"end_character":30},"in_reply_to":"49586ffd_08c2dcff","updated":"2021-01-04 11:15:32.000000000","message":"Not sure if we have a method in glance API that performs the image download in a file, last i checked it is being done in the client itself[1][2] but glance team might know better. (or a better way to do this task)\n\n[1] https://github.com/openstack/python-glanceclient/blob/master/glanceclient/v1/shell.py#L167\n[2] https://github.com/openstack/python-glanceclient/blob/master/glanceclient/common/utils.py#L298-L316","commit_id":"199385cc703ebec60155fc805b44ec1a7f1552ed"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"b21e216094428efa68e4a1a707c978e6b54c4ba1","unresolved":false,"context_lines":[{"line_number":631,"context_line":"    LOG.debug(\"Downloading image %s directly to %s, size: %s\", image_id,"},{"line_number":632,"context_line":"              dest, image_size_m)"},{"line_number":633,"context_line":"    start_time \u003d timeutils.utcnow()"},{"line_number":634,"context_line":"    cmd \u003d [\"openstack\", \"image\", \"save\", \"--os-token\","},{"line_number":635,"context_line":"           context.auth_token, \"--file\", dest, \"--os-endpoint\","},{"line_number":636,"context_line":"           endpoint, image_id]"},{"line_number":637,"context_line":"    if CONF.glance_ca_certificates_file:"},{"line_number":638,"context_line":"        cmd.append(\"--cacert\", CONF.glance_ca_certificates_file)"},{"line_number":639,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":40,"id":"081a39c7_ce5dae03","line":636,"range":{"start_line":634,"start_character":0,"end_line":636,"end_character":30},"in_reply_to":"deec79af_ec0bfb02","updated":"2021-01-04 12:07:32.000000000","message":"Ack","commit_id":"199385cc703ebec60155fc805b44ec1a7f1552ed"},{"author":{"_account_id":10459,"name":"Luigi Toscano","email":"ltoscano@redhat.com","username":"ltoscano"},"change_message_id":"8e2bd8ca5e0c70702ad7ab4eb9cc8325237c3011","unresolved":true,"context_lines":[{"line_number":631,"context_line":"    LOG.debug(\"Downloading image %s directly to %s, size: %s\", image_id,"},{"line_number":632,"context_line":"              dest, image_size_m)"},{"line_number":633,"context_line":"    start_time \u003d timeutils.utcnow()"},{"line_number":634,"context_line":"    cmd \u003d [\"openstack\", \"image\", \"save\", \"--os-token\","},{"line_number":635,"context_line":"           context.auth_token, \"--file\", dest, \"--os-endpoint\","},{"line_number":636,"context_line":"           endpoint, image_id]"},{"line_number":637,"context_line":"    if CONF.glance_ca_certificates_file:"},{"line_number":638,"context_line":"        cmd.append(\"--cacert\", CONF.glance_ca_certificates_file)"},{"line_number":639,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":40,"id":"49586ffd_08c2dcff","line":636,"range":{"start_line":634,"start_character":0,"end_line":636,"end_character":30},"in_reply_to":"eb7fb0f0_3d73b772","updated":"2021-01-04 09:11:26.000000000","message":"Moreover, if you really want to call glance, you should use the API and not depend on openstackclient, which is not part of cinder core requirements.","commit_id":"199385cc703ebec60155fc805b44ec1a7f1552ed"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"7c7c7ad588ca88b263b79f4a49f7d653fa690543","unresolved":true,"context_lines":[{"line_number":631,"context_line":"    LOG.debug(\"Downloading image %s directly to %s, size: %s\", image_id,"},{"line_number":632,"context_line":"              dest, image_size_m)"},{"line_number":633,"context_line":"    start_time \u003d timeutils.utcnow()"},{"line_number":634,"context_line":"    cmd \u003d [\"openstack\", \"image\", \"save\", \"--os-token\","},{"line_number":635,"context_line":"           context.auth_token, \"--file\", dest, \"--os-endpoint\","},{"line_number":636,"context_line":"           endpoint, image_id]"},{"line_number":637,"context_line":"    if CONF.glance_ca_certificates_file:"},{"line_number":638,"context_line":"        cmd.append(\"--cacert\", CONF.glance_ca_certificates_file)"},{"line_number":639,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":40,"id":"deec79af_ec0bfb02","line":636,"range":{"start_line":634,"start_character":0,"end_line":636,"end_character":30},"in_reply_to":"f97985b3_2b276872","updated":"2021-01-04 11:58:54.000000000","message":"The thing is we need that to happen as *root* and the cinder-volume process is running as the cinder user.   If we don\u0027t use the openstack client, then we need to use the cinder client with sudo.  I tried with the API but how do we do privileges escalation in python ?   Also, I though the cinder CLI was deprecated (or will be) and the openstack cli was required to interface with cinder/glance/nova/heat/etc.   But yeah, I know we should use the APIs when it\u0027s possible but we need to write the destination files as root as they are often devices.   This is an interesting problem and this solution was the simplest to implement as the openstack/cinder CLI are already implemented.   I did add the openstack cli in the requirements.txt and such.","commit_id":"199385cc703ebec60155fc805b44ec1a7f1552ed"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"4f0567808ceb87ff9cfe528773a2b19979209340","unresolved":true,"context_lines":[{"line_number":670,"context_line":"                         \"%(container_format)s.\") % compression_param)"},{"line_number":671,"context_line":""},{"line_number":672,"context_line":"    try:"},{"line_number":673,"context_line":"        format_raw \u003d True if image_meta[\u0027disk_format\u0027] \u003d\u003d \u0027raw\u0027 else False"},{"line_number":674,"context_line":"    except TypeError:"},{"line_number":675,"context_line":"        format_raw \u003d False"},{"line_number":676,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"b5016ae8_a1d19cf8","line":673,"range":{"start_line":673,"start_character":29,"end_line":673,"end_character":54},"updated":"2021-01-04 07:28:56.000000000","message":"i assume glance determines this via qemu-img info command else we would need to determine it here","commit_id":"199385cc703ebec60155fc805b44ec1a7f1552ed"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"ed09ff614419026dc03ff92ce394672e9170c210","unresolved":true,"context_lines":[{"line_number":670,"context_line":"                         \"%(container_format)s.\") % compression_param)"},{"line_number":671,"context_line":""},{"line_number":672,"context_line":"    try:"},{"line_number":673,"context_line":"        format_raw \u003d True if image_meta[\u0027disk_format\u0027] \u003d\u003d \u0027raw\u0027 else False"},{"line_number":674,"context_line":"    except TypeError:"},{"line_number":675,"context_line":"        format_raw \u003d False"},{"line_number":676,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"3516cd78_6d635e15","line":673,"range":{"start_line":673,"start_character":29,"end_line":673,"end_character":54},"in_reply_to":"b5016ae8_a1d19cf8","updated":"2021-01-04 12:45:32.000000000","message":"I\u0027m not sure about this.    It looks like it\u0027s from the provided user input at image creation time with the glance client.   (I\u0027m not sure here).","commit_id":"199385cc703ebec60155fc805b44ec1a7f1552ed"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"4f0567808ceb87ff9cfe528773a2b19979209340","unresolved":true,"context_lines":[{"line_number":749,"context_line":""},{"line_number":750,"context_line":"        # NOTE(jdg): I\u0027m using qemu-img convert to write"},{"line_number":751,"context_line":"        # to the volume regardless if it *needs* conversion or not"},{"line_number":752,"context_line":"        # TODO(avishay): We can speed this up by checking if the image is raw"},{"line_number":753,"context_line":"        # and if so, writing directly to the device. However, we need to keep"},{"line_number":754,"context_line":"        # check via \u0027qemu-img info\u0027 that what we copied was in fact a raw"},{"line_number":755,"context_line":"        # image and not a different format with a backing file, which may be"},{"line_number":756,"context_line":"        # malicious."},{"line_number":757,"context_line":"        disk_format \u003d fixup_disk_format(image_meta[\u0027disk_format\u0027])"},{"line_number":758,"context_line":"        LOG.debug(\"%s was %s, converting to %s\", image_id, fmt,"},{"line_number":759,"context_line":"                  volume_format)"}],"source_content_type":"text/x-python","patch_set":40,"id":"a3187c17_6ce14fec","line":756,"range":{"start_line":752,"start_character":8,"end_line":756,"end_character":20},"updated":"2021-01-04 07:28:56.000000000","message":"remove this","commit_id":"199385cc703ebec60155fc805b44ec1a7f1552ed"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"ed09ff614419026dc03ff92ce394672e9170c210","unresolved":false,"context_lines":[{"line_number":749,"context_line":""},{"line_number":750,"context_line":"        # NOTE(jdg): I\u0027m using qemu-img convert to write"},{"line_number":751,"context_line":"        # to the volume regardless if it *needs* conversion or not"},{"line_number":752,"context_line":"        # TODO(avishay): We can speed this up by checking if the image is raw"},{"line_number":753,"context_line":"        # and if so, writing directly to the device. However, we need to keep"},{"line_number":754,"context_line":"        # check via \u0027qemu-img info\u0027 that what we copied was in fact a raw"},{"line_number":755,"context_line":"        # image and not a different format with a backing file, which may be"},{"line_number":756,"context_line":"        # malicious."},{"line_number":757,"context_line":"        disk_format \u003d fixup_disk_format(image_meta[\u0027disk_format\u0027])"},{"line_number":758,"context_line":"        LOG.debug(\"%s was %s, converting to %s\", image_id, fmt,"},{"line_number":759,"context_line":"                  volume_format)"}],"source_content_type":"text/x-python","patch_set":40,"id":"53cdd61c_2562bf61","line":756,"range":{"start_line":752,"start_character":8,"end_line":756,"end_character":20},"in_reply_to":"a3187c17_6ce14fec","updated":"2021-01-04 12:45:32.000000000","message":"Done","commit_id":"199385cc703ebec60155fc805b44ec1a7f1552ed"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"ff8ec01abdf000e54518e8bab1043fe405d4a846","unresolved":true,"context_lines":[{"line_number":631,"context_line":"    LOG.debug(\"Downloading image %s directly to %s, size: %s\", image_id,"},{"line_number":632,"context_line":"              dest, image_size_m)"},{"line_number":633,"context_line":"    start_time \u003d timeutils.utcnow()"},{"line_number":634,"context_line":"    cmd \u003d [\"openstack\", \"image\", \"save\", \"--os-token\","},{"line_number":635,"context_line":"           context.auth_token, \"--file\", dest, \"--os-endpoint\","},{"line_number":636,"context_line":"           endpoint]"},{"line_number":637,"context_line":"    if CONF.glance_ca_certificates_file:"}],"source_content_type":"text/x-python","patch_set":42,"id":"0ac14294_eec80571","line":634,"updated":"2021-01-04 13:50:18.000000000","message":"We should not call CLI operations here.","commit_id":"485ff3018549a02691c29fa85e128fda05780927"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"389b15dd64fd096f2dd016735a507e96a3598359","unresolved":true,"context_lines":[{"line_number":676,"context_line":"    except TypeError:"},{"line_number":677,"context_line":"        format_raw \u003d False"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"    if format_raw and volume_format \u003d\u003d \u0027raw\u0027:"},{"line_number":680,"context_line":"        download_image_to_dest(context, image_meta, image_id, dest,"},{"line_number":681,"context_line":"                               run_as_root)"},{"line_number":682,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":51,"id":"c55660d8_3901059c","line":679,"updated":"2021-01-05 19:25:03.000000000","message":"There are more checks required than just about the format -- this won\u0027t work if using encrypted volumes, an RBD volume driver, an NFS volume driver, etc.\n\nI think we need to look at improving this area from a higher level before diving too far into this particular optimization.","commit_id":"15f79b08e8901da1a54eabea6398383d75ab01d4"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"828f8252a14d05eef53de2710a7d234cd06c980c","unresolved":true,"context_lines":[{"line_number":676,"context_line":"    except TypeError:"},{"line_number":677,"context_line":"        format_raw \u003d False"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"    if format_raw and volume_format \u003d\u003d \u0027raw\u0027:"},{"line_number":680,"context_line":"        download_image_to_dest(context, image_meta, image_id, dest,"},{"line_number":681,"context_line":"                               run_as_root)"},{"line_number":682,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":51,"id":"b36c837f_4628da5a","line":679,"in_reply_to":"c55660d8_3901059c","updated":"2021-01-05 23:11:35.000000000","message":"Does this mean we have no unit tests for any of these or does it mean this patch works ?","commit_id":"15f79b08e8901da1a54eabea6398383d75ab01d4"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"b47fad008c12bcadfb1c509c5f2316a624197668","unresolved":true,"context_lines":[{"line_number":631,"context_line":"    LOG.debug(\"Downloading image %s directly to %s, size: %s\", image_id,"},{"line_number":632,"context_line":"              dest, image_size_m)"},{"line_number":633,"context_line":"    start_time \u003d timeutils.utcnow()"},{"line_number":634,"context_line":"    cmd \u003d [\"openstack\", \"image\", \"save\", \"--os-token\","},{"line_number":635,"context_line":"           context.auth_token, \"--file\", dest, \"--os-endpoint\","},{"line_number":636,"context_line":"           endpoint]"},{"line_number":637,"context_line":"    if CONF.glance_ca_certificates_file:"},{"line_number":638,"context_line":"        cmd.append(\"--os-cacert\")"},{"line_number":639,"context_line":"        cmd.append(CONF.glance_ca_certificates_file)"}],"source_content_type":"text/x-python","patch_set":53,"id":"0f786237_c173ccb1","line":636,"range":{"start_line":634,"start_character":0,"end_line":636,"end_character":20},"updated":"2021-01-06 13:33:10.000000000","message":"Absolutely not.  We are not making a call out to a command-line client.  This breaks all our current patterns of interaction with glance.","commit_id":"cd42c5433b38499e95714e4de0f642668955d15c"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"2f36ca89dd8f4904a80ce661bf63b3c1ccc10ae9","unresolved":true,"context_lines":[{"line_number":631,"context_line":"    LOG.debug(\"Downloading image %s directly to %s, size: %s\", image_id,"},{"line_number":632,"context_line":"              dest, image_size_m)"},{"line_number":633,"context_line":"    start_time \u003d timeutils.utcnow()"},{"line_number":634,"context_line":"    cmd \u003d [\"openstack\", \"image\", \"save\", \"--os-token\","},{"line_number":635,"context_line":"           context.auth_token, \"--file\", dest, \"--os-endpoint\","},{"line_number":636,"context_line":"           endpoint]"},{"line_number":637,"context_line":"    if CONF.glance_ca_certificates_file:"},{"line_number":638,"context_line":"        cmd.append(\"--os-cacert\")"},{"line_number":639,"context_line":"        cmd.append(CONF.glance_ca_certificates_file)"}],"source_content_type":"text/x-python","patch_set":53,"id":"4b487c5f_82d4433f","line":636,"range":{"start_line":634,"start_character":0,"end_line":636,"end_character":20},"in_reply_to":"0f786237_c173ccb1","updated":"2021-01-06 13:58:12.000000000","message":"We\u0027ll need to be able to do this as root as the devices are owned by root:root ... that was only a PoC .","commit_id":"cd42c5433b38499e95714e4de0f642668955d15c"}]}
