From 79f9267f4bd697fbcfeb040440404bc49195eb48 Mon Sep 17 00:00:00 2001
From: Eric Blake
Date: Thu, 3 Feb 2011 19:23:31 -0700
Subject: [PATCH] smartcard: add spicevmc support
Adds , which uses the
new of .
* docs/schemas/domain.rng: Support new XML.
* docs/formatdomain.html.in: Document it.
* src/conf/domain_conf.h (virDomainGraphicsSpiceChannelName): New
enum value.
(virDomainChrSpicevmcName): New enum.
(virDomainChrSourceDef): Distinguish spicevmc types.
* src/conf/domain_conf.c (virDomainGraphicsSpiceChannelName): Add
smartcard.
(virDomainSmartcardDefParseXML): Parse it.
(virDomainChrDefParseXML, virDomainSmartcardDefParseXML): Set
spicevmc name.
(virDomainChrSpicevmc): New enum conversion functions.
* src/libvirt_private.syms: Export new functions.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr): Conditionalize
name.
* tests/qemuxml2argvtest.c (domain): New test.
* tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough-spicevmc.args:
New file.
* tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough-spicevmc.xml:
Likewise.
---
docs/formatdomain.html.in | 14 ++++++----
docs/schemas/domain.rng | 1 +
src/conf/domain_conf.c | 27 ++++++++++++-------
src/conf/domain_conf.h | 12 ++++++++-
src/libvirt_private.syms | 2 ++
src/qemu/qemu_command.c | 3 ++-
...l2argv-smartcard-passthrough-spicevmc.args | 7 +++++
...ml2argv-smartcard-passthrough-spicevmc.xml | 16 +++++++++++
tests/qemuxml2argvtest.c | 4 +++
9 files changed, 70 insertions(+), 16 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough-spicevmc.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough-spicevmc.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index d91fdb9fd4..43c78fc311 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1021,6 +1021,7 @@
<protocol type='raw'/>
<address type='ccid' controller='0' slot='0'/>
</smartcard>
+ <smartcard mode='passthrough' type='spicevmc'/>
</devices>
...
@@ -1063,9 +1064,11 @@
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
+ describe the host side of the tunnel; type='tcp'
+ or type='spicevmc' (which uses the smartcard
+ channel of a SPICE graphics
+ device) are typical. Further sub-elements, such
+ as <source>, may be 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
@@ -1505,8 +1508,9 @@ qemu-kvm -net nic,model=? /dev/null
can be desirable to restrict what channels can be run on each port.
This is achieved by adding one or more <channel> elements inside
the main <graphics> element. Valid channel names include
- main,display,inputs,cursor,
- playback,record.
+ main, display, inputs,
+ cursor, playback, record;
+ and since 0.8.8: smartcard.