code: def _update_serial_ports(serial_old_new):
      '''
      Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
      deployed serial port configuration to the new given config
  
      serial_old_new
           Dictionary with old and new keys which contains the current and the
            next config for a serial port device
      '''
      serial_changes = []
      if serial_old_new:
          devs = [serial['old']['adapter'] for serial in serial_old_new]
          log.trace('Updating serial ports %s', devs)
          for item in serial_old_new:
              current_serial = item['old']
              next_serial = item['new']
              difference = recursive_diff(current_serial, next_serial)
              difference.ignore_unset_values = False
              if difference.changed():
                  serial_changes.append(_apply_serial_port(next_serial,
                                                           current_serial['key'],
                                                           'edit'))
          return serial_changef _update_serial_ports(serial_old_new):
      '''
      Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
      deployed serial port configuration to the new given config
  
      serial_old_new
           Dictionary with old and new keys which contains the current and the
            next config for a serial port device
      '''
      serial_changes = []
      if serial_old_new:
          devs = [serial['old']['adapter'] for serial in serial_old_new]
          log.trace('Updating serial ports %s', devs)
          for item in serial_old_new:
              current_serial = item['old']
              next_serial = item['new']
              difference = recursive_diff(current_serial, next_serial)
              difference.ignore_unset_values = False
              if difference.changed():
                  serial_changes.append(_apply_serial_port(next_serial,
                                                           current_serial['key'],
                                                           'edit'))
          return serial_changes
docs: Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
      deployed serial port configuration to the new given config
  
      serial_old_new
           Dictionary with old and new keys which contains the current and the
            next config for a serial port device