You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: virtualbox.rb
    path of file: ./repos/ohai/lib/ohai/plugins
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
#
# Author:: Tim Smith <tsmith@chef.io>
# Author:: Joshua Colson <joshua.colson@gmail.com>
# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: 2019 Joshua Colson
# License:: Apache License, Version 2.0
#
# Licensed under the Apache
    
  def vboxmanage_list_blocks(query_type, name_key)
    # ignore unrecognized query type
    supported_queries = %w{
      bridgedifs dhcpservers dvds hdds hostdvds
      hostfloppies hostonlyifs natnets
    }
    return nil unless supported_queries.include? query_type

    results = Mash.new

    so_cmd = "VBoxManage list --sorted #{query_type}"
    logger.trace(so_cmd)
    so = shell_out(so_cmd)
    # raise an exception if the command fails
    # so.error!

    if so.exitstatus == 0
      # break the result into paragraph blocks, on successive newlines
      so.stdout.each_line("") do |blk|
        # remove the multiple newlines of each record
        blk.chomp!.chomp!
        # initialize a blank record hash
        record = Mash.new
        # parse the record block into key/value pairs
        blk.each_line do |line|
          next unless line.include? ":"

          # split the line into key/value pair
          key, right = line.split(":", 2)

          # strip the leading/trailing whitespace if the value is not nil
          value = right.nil? ? "" : right.strip
          record[key.downcase] = value
        end

        # insert the record into the list of results
        if record.key? name_key.downcase
          name = record.delete(name_key.downcase)
          results[name] = record
        end
      end