def smartcard(options = {})
if options[:mode].nil?
raise 'Option mode must be specified.'
elsif options[:mode] != 'passthrough'
raise 'Currently only passthrough mode is supported!'
elsif options[:type] == 'tcp' && (options[:source_mode].nil? || options[:source_host].nil? || options[:source_service].nil?)
raise 'If using type "tcp", option "source_mode", "source_host" and "source_service" must be specified.'
end
if @smartcard_dev == UNSET_VALUE
@smartcard_dev = {}
end
@smartcard_dev[:mode] = options[:mode]
@smartcard_dev[:type] = options[:type] || 'spicevmc'
@smartcard_dev[:source_mode] = options[:source_mode] if @smartcard_dev[:type] == 'tcp'
@smartcard_dev[:source_host] = options[:source_host] if @smartcard_dev[:type] == 'tcp'
@smartcard_dev[:source_service] = options[:source_service] if @smartcard_dev[:type] == 'tcp'
end