# File lib/fog/aws/requests/compute/register_image.rb, line 37
        def register_image(name, description, location, block_devices=[], options={})
          common_options = {
            'Action'      => 'RegisterImage',
            'Name'        => name,
            'Description' => description,
            :parser       => Fog::Parsers::Compute::AWS::RegisterImage.new
          }

          # This determines if we are doing a snapshot or a S3 backed AMI.
          if(location =~ /^\/dev\/sd[a-p]\d{0,2}$/)
            common_options['RootDeviceName'] = location
          else
            common_options['ImageLocation'] = location
          end

          block_devices.each_with_index do |bd, index|
            index += 1
            ["DeviceName","VirtualName"].each do |n|
              common_options["BlockDeviceMapping.#{index}.#{n}"] = bd[n] if bd[n]
            end
            ["SnapshotId","VolumeSize","NoDevice","DeleteOnTermination"].each do |n|
              common_options["BlockDeviceMapping.#{index}.Ebs.#{n}"] = bd[n] if bd[n]
            end
          end

          request(common_options.merge!(options))
        end