diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index db0b762e28..9f1bb5fa27 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -892,7 +892,7 @@

Each controller has a mandatory attribute type, - which must be one of "ide", "fdc", "scsi", "sata", or + which must be one of "ide", "fdc", "scsi", "sata", "ccid", or "virtio-serial", and a mandatory attribute index which is the decimal integer describing in which order the bus controller is encountered (for use in controller @@ -991,6 +991,99 @@ not used by qemu. +

Smartcard devices

+ +

+ A virtual smartcard device can be supplied to the guest via the + smartcard element. A USB smartcard reader device on + the host cannot be used on a guest with simple device + passthrough, since it will then not be available on the host, + possibly locking the host computer when it is "removed". + Therefore, some hypervisors provide a specialized virtual device + that can present a smartcard interface to the guest, with + several modes for describing how credentials are obtained from + the host or even a from a channel created to a third-party + smartcard provider. Since 0.8.8 +

+ +
+  ...
+  <devices>
+    <smartcard mode='host'/>
+    <smartcard mode='host-certificates'>
+      <certificate>cert1</certificate>
+      <certificate>cert2</certificate>
+      <certificate>cert3</certificate>
+      <database>/etc/pki/nssdb/</database>
+    </smartcard>
+    <smartcard mode='passthrough' type='tcp'>
+      <source mode='bind' host='127.0.0.1' service='2001'/>
+      <protocol type='raw'/>
+      <address type='ccid' controller='0' slot='0'/>
+    </smartcard>
+  </devices>
+  ...
+
+ +

+ The <smartcard> element has a mandatory + attribute mode. The following modes are supported; + in each mode, the guest sees a device on its USB bus that + behaves like a physical USB CCID (Chip/Smart Card Interface + Device) card. +

+ +
+
mode='host'
+
The simplest operation, where the hypervisor relays all + requests from the guest into direct access to the host's + smartcard via NSS. No other attributes or sub-elements are + required. See below about the use of an + optional <address> sub-element.
+ +
mode='host-certificates'
+
Rather than requiring a smartcard to be plugged into the + host, it is possible to provide three NSS certificate names + residing in a database on the host. These certificates can be + generated via the command certutil -d /etc/pki/nssdb -x -t + CT,CT,CT -S -s CN=cert1 -n cert1, and the resulting three + certificate names must be supplied as the content of each of + three <certificate> sub-elements. An + additional sub-element <database> can specify + the absolute path to an alternate directory (matching + the -d option of the certutil command + when creating the certificates); if not present, it defaults to + /etc/pki/nssdb.
+ +
mode='passthrough'
+
Rather than having the hypervisor directly communicate with + the host, it is possible to tunnel all requests through a + secondary character device to a third-party provider (which may + in turn be talking to a smartcard or using three certificate + files). In this mode of operation, an additional + attribute type is required, matching one of the + supported serial device types, to + describe the host side of the tunnel; type='tcp' is + typical. Further sub-elements, such + as <source>, are required according to the + given type, although a <target> sub-element + is not required (since the consumer of the character device is + the hypervisor itself, rather than a device visible in the + guest).
+
+ +

+ Each mode supports an optional + sub-element <address>, which fine-tunes the + correlation between the smartcard and a ccid bus controller. + If present, the element must have an attribute + of type='ccid' as well as a bus + attribute listing the index of the bus that the smartcard + utilizes. An optional slot attribute lists which + slot within the bus. For now, qemu only supports at most one + smartcard, with an address of bus=0 slot=0. +

+

Network interfaces

diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 8a2e7c70b5..69fb432245 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -749,6 +749,7 @@
                 ide
                 scsi
                 sata
+                ccid
               
             
           
@@ -1632,6 +1633,51 @@
       
     
   
+  
+    
+      
+        
+          
+            host
+          
+          
+        
+        
+          
+            host-certificates
+          
+          
+          
+          
+          
+            
+              
+            
+          
+        
+        
+          
+            passthrough
+          
+          
+          
+            
+            
+              
+            
+          
+        
+      
+      
+        
+      
+    
+  
+  
+    
+      
+    
+  
   
     
       
@@ -1768,8 +1814,21 @@
       
     
   
+  
+    
+      
+    
+    
+      
+        
+      
+    
+  
   
   
     
@@ -1792,6 +1851,7 @@
             
             
             
+            
           
         
         
@@ -2021,6 +2081,12 @@
           
           
         
+        
+          
+            ccid
+          
+          
+        
       
     
   
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-smartcard-controller.xml b/tests/qemuxml2argvdata/qemuxml2argv-smartcard-controller.xml
new file mode 100644
index 0000000000..2a53dbb628
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-smartcard-controller.xml
@@ -0,0 +1,19 @@
+
+  QEMUGuest1
+  c7a5fdbd-edaf-9455-926a-d65c16db1809
+  219136
+  219200
+  1
+  
+    hvm
+    
+  
+  
+    /usr/bin/qemu
+    
+    
+      
+ + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-smartcard-host-certificates.xml b/tests/qemuxml2argvdata/qemuxml2argv-smartcard-host-certificates.xml new file mode 100644 index 0000000000..5a9844b487 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-smartcard-host-certificates.xml @@ -0,0 +1,20 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219200 + 1 + + hvm + + + + /usr/bin/qemu + + cert1 + cert2 + cert3 + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-smartcard-host.xml b/tests/qemuxml2argvdata/qemuxml2argv-smartcard-host.xml new file mode 100644 index 0000000000..95790f2050 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-smartcard-host.xml @@ -0,0 +1,16 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219200 + 1 + + hvm + + + + /usr/bin/qemu + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough-tcp.xml b/tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough-tcp.xml new file mode 100644 index 0000000000..f133391dbb --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough-tcp.xml @@ -0,0 +1,19 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219200 + 1 + + hvm + + + + /usr/bin/qemu + + + + + + +