[libvirt] [PATCH 0/4] Support for SPICE graphics

This series of patches adds minimal support for SPICE graphics which is newly introduced in RHEL-5.4's fork of KVM. Since this is not yet merged in upstream QEMU/KVM, I'm not proposing to merge all these patches. The two XML schema patches are straightforward to merge. The two implementation ones are RHEL5 specific and I want to avoid declaring them supported until we have a sign of what the upstream merge will look like, since previous attempst to support KVM args prior to QEMU acceptance have been very painful long term. Daniel

* src/qemu_conf.c: Add dummy entry in enumeration * docs/schemas/domain.rng: Add 'qxl' as a type for the <video> tag * src/domain_conf.c, src/domain_conf.h: Add QXL to video type enumerations --- docs/schemas/domain.rng | 7 +++---- src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 1 + src/qemu/qemu_conf.c | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng index 70e98a7..f9d6d7e 100644 --- a/docs/schemas/domain.rng +++ b/docs/schemas/domain.rng @@ -805,10 +805,8 @@ </element> </define> <!-- - A graphic description, currently in Xen only 2 types are supported: - - sdl with optional display, xauth and fullscreen - - vnc with a required port and optional listen IP address, password - and keymap + A video adapter description, allowing configuration of device + model, number of virtual heads, and video ram size --> <define name="video"> <element name="video"> @@ -821,6 +819,7 @@ <value>vmvga</value> <value>xen</value> <value>vbox</value> + <value>qxl</value> </choice> </attribute> <optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5e37d96..4930c38 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -149,7 +149,8 @@ VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "cirrus", "vmvga", "xen", - "vbox") + "vbox", + "qxl") VIR_ENUM_IMPL(virDomainInput, VIR_DOMAIN_INPUT_TYPE_LAST, "mouse", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 7c918a7..7ea1152 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -305,6 +305,7 @@ enum virDomainVideoType { VIR_DOMAIN_VIDEO_TYPE_VMVGA, VIR_DOMAIN_VIDEO_TYPE_XEN, VIR_DOMAIN_VIDEO_TYPE_VBOX, + VIR_DOMAIN_VIDEO_TYPE_QXL, VIR_DOMAIN_VIDEO_TYPE_LAST }; diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 2db38df..7ba0ac2 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -86,7 +86,8 @@ VIR_ENUM_IMPL(qemuVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "cirrus", "vmware", NULL, /* no arg needed for xen */ - NULL /* don't support vbox */); + NULL, /* don't support vbox */ + NULL, /* Not implemented yet */); #define PROC_MOUNT_BUF_LEN 255 -- 1.6.2.5

This adds an element <graphics type='spice' port='5903' tlsPort='5904' listen='127.0.0.1'/> This is the bare minimum that should be exposed in the guest config for SPICE. Other parameters are better handled as per host level configuration tunables * docs/schemas/domain.rng: Define the SPICE <graphics> schema * src/domain_conf.h, src/domain_conf.c: Add parsing and formatting for SPICE graphics config * src/qemu_conf.c: Complain about unsupported graphics types --- docs/schemas/domain.rng | 30 +++++++++++++++++++++ src/conf/domain_conf.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++- src/conf/domain_conf.h | 8 ++++++ src/qemu/qemu_conf.c | 9 ++++++ 4 files changed, 111 insertions(+), 1 deletions(-) diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng index f9d6d7e..8aa2079 100644 --- a/docs/schemas/domain.rng +++ b/docs/schemas/domain.rng @@ -746,6 +746,36 @@ </group> <group> <attribute name="type"> + <value>spice</value> + </attribute> + <optional> + <attribute name="port"> + <ref name="PortNumber"/> + </attribute> + </optional> + <optional> + <attribute name="tlsPort"> + <ref name="PortNumber"/> + </attribute> + </optional> + <optional> + <attribute name="listen"> + <ref name="addrIP"/> + </attribute> + </optional> + <optional> + <attribute name="passwd"> + <text/> + </attribute> + </optional> + <optional> + <attribute name="keymap"> + <text/> + </attribute> + </optional> + </group> + <group> + <attribute name="type"> <value>rdp</value> </attribute> <optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4930c38..ca5dfc3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -165,7 +165,8 @@ VIR_ENUM_IMPL(virDomainGraphics, VIR_DOMAIN_GRAPHICS_TYPE_LAST, "sdl", "vnc", "rdp", - "desktop") + "desktop", + "spice") VIR_ENUM_IMPL(virDomainHostdevMode, VIR_DOMAIN_HOSTDEV_MODE_LAST, "subsystem", @@ -267,6 +268,12 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def) case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: VIR_FREE(def->data.desktop.display); break; + + case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: + VIR_FREE(def->data.spice.listenAddr); + VIR_FREE(def->data.spice.keymap); + VIR_FREE(def->data.spice.passwd); + break; } VIR_FREE(def); @@ -1692,6 +1699,38 @@ virDomainGraphicsDefParseXML(virConnectPtr conn, def->data.desktop.fullscreen = 0; def->data.desktop.display = virXMLPropString(node, "display"); + } else if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) { + char *port = virXMLPropString(node, "port"); + char *tlsPort; + + if (port) { + if (virStrToLong_i(port, NULL, 10, &def->data.spice.port) < 0) { + virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, + _("cannot parse spice port %s"), port); + VIR_FREE(port); + goto error; + } + VIR_FREE(port); + } else { + def->data.spice.port = 5900; + } + + tlsPort = virXMLPropString(node, "tlsPort"); + if (tlsPort) { + if (virStrToLong_i(tlsPort, NULL, 10, &def->data.spice.tlsPort) < 0) { + virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, + _("cannot parse spice tlsPort %s"), tlsPort); + VIR_FREE(tlsPort); + goto error; + } + VIR_FREE(tlsPort); + } else { + def->data.spice.tlsPort = 0; + } + + def->data.spice.listenAddr = virXMLPropString(node, "listen"); + def->data.spice.passwd = virXMLPropString(node, "passwd"); + def->data.spice.keymap = virXMLPropString(node, "keymap"); } cleanup: @@ -4100,6 +4139,30 @@ virDomainGraphicsDefFormat(virConnectPtr conn, break; + case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: + if (def->data.spice.port) + virBufferVSprintf(buf, " port='%d'", + def->data.spice.port); + + if (def->data.spice.tlsPort) + virBufferVSprintf(buf, " tlsPort='%d'", + def->data.spice.tlsPort); + + if (def->data.spice.listenAddr) + virBufferVSprintf(buf, " listen='%s'", + def->data.spice.listenAddr); + + if (def->data.spice.keymap) + virBufferEscapeString(buf, " keymap='%s'", + def->data.spice.keymap); + + if (def->data.spice.passwd && + (flags & VIR_DOMAIN_XML_SECURE)) + virBufferEscapeString(buf, " passwd='%s'", + def->data.spice.passwd); + + break; + } virBufferAddLit(buf, "/>\n"); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 7ea1152..4cb10d3 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -334,6 +334,7 @@ enum virDomainGraphicsType { VIR_DOMAIN_GRAPHICS_TYPE_VNC, VIR_DOMAIN_GRAPHICS_TYPE_RDP, VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP, + VIR_DOMAIN_GRAPHICS_TYPE_SPICE, VIR_DOMAIN_GRAPHICS_TYPE_LAST, }; @@ -366,6 +367,13 @@ struct _virDomainGraphicsDef { char *display; int fullscreen : 1; } desktop; + struct { + int port; + int tlsPort; + char *listenAddr; + char *keymap; + char *passwd; + } spice; } data; }; diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 7ba0ac2..ae171bc 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -2067,6 +2067,12 @@ int qemudBuildCommandLine(virConnectPtr conn, } } + if (def->ngraphics > 1) { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + "%s", _("only one graphics output is currently supported")); + goto error; + } + if ((def->ngraphics == 1) && def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) { virBuffer opt = VIR_BUFFER_INITIALIZER; @@ -2155,6 +2161,9 @@ int qemudBuildCommandLine(virConnectPtr conn, */ ADD_ENV_COPY("QEMU_AUDIO_DRV"); ADD_ENV_COPY("SDL_AUDIODRIVER"); + } else if (def->ngraphics) { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + "%s", _("unsupported graphics output requested")); } if (def->nvideos) { -- 1.6.2.5

Thanks for the patches (and sorry for the late response). The patches are fine, though I am still missing a means to control which of spice channels are to be encrypted. Also missing is a way to set key/cert files and cipher suite per domain. (I aksed spice folks to avoid this problem by using reasonable defaults). More of a problem is the need to set/reset spice "ticket" (one time password), or at least disable it completely on the command line (with ,disable-ticketing). On Tue, Sep 29, 2009 at 04:43:51PM +0100, Daniel P. Berrange wrote:
This supports the -qxl argument in RHEL-5's fork of KVM which has SPICE support. QXL is a graphics card, but inexplicably doesn't use the standard -vga syntax for generic configuration. Also -qxl is rather useless unless you also supply -spice (coming in next patch)
+ + if (virAsprintf(&optstr, "%u,ram=%u", + def->videos[0]->heads, + (def->videos[0]->vram /1024)) < 0) + goto no_memory;
this hides spice's own default, and sends ",ram=0" if xml lacks vram attribute. I think it would be better to drop ",ram" completely if vram==0. Regards, Dan.

On Mon, Oct 19, 2009 at 05:47:47PM +0200, Dan Kenigsberg wrote:
Thanks for the patches (and sorry for the late response).
The patches are fine, though I am still missing a means to control which of spice channels are to be encrypted. Also missing is a way to set key/cert files and cipher suite per domain. (I aksed spice folks to avoid this problem by using reasonable defaults). More of a problem is the need to set/reset spice "ticket" (one time password), or at least disable it completely on the command line (with ,disable-ticketing).
For VNC, we leave key/cert file configuration to be done per-host in /etc/libvirt/qemu.conf. I was anticipating the same for SPICE, with a spice_tls_x509_cert_dir parameter, to match the existing vnc_tls_x509_cert_dir parameter. We could easily add cipher suite parameters to the config too if there's a compelling need to use a non-default setting. IIRC, there's an open RFE for the 'ticket' stuff already.
On Tue, Sep 29, 2009 at 04:43:51PM +0100, Daniel P. Berrange wrote:
This supports the -qxl argument in RHEL-5's fork of KVM which has SPICE support. QXL is a graphics card, but inexplicably doesn't use the standard -vga syntax for generic configuration. Also -qxl is rather useless unless you also supply -spice (coming in next patch)
+ + if (virAsprintf(&optstr, "%u,ram=%u", + def->videos[0]->heads, + (def->videos[0]->vram /1024)) < 0) + goto no_memory;
this hides spice's own default, and sends ",ram=0" if xml lacks vram attribute. I think it would be better to drop ",ram" completely if vram==0.
hmm, I missed something somewhere then, because our XML parser should always set a default vram value if it is omitted, so you should never get a ram=0 flag. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Mon, Oct 19, 2009 at 04:52:10PM +0100, Daniel P. Berrange wrote:
On Mon, Oct 19, 2009 at 05:47:47PM +0200, Dan Kenigsberg wrote:
Thanks for the patches (and sorry for the late response).
The patches are fine, though I am still missing a means to control which of spice channels are to be encrypted. Also missing is a way to set key/cert files and cipher suite per domain. (I aksed spice folks to avoid this problem by using reasonable defaults). More of a problem is the need to set/reset spice "ticket" (one time password), or at least disable it completely on the command line (with ,disable-ticketing).
For VNC, we leave key/cert file configuration to be done per-host in /etc/libvirt/qemu.conf. I was anticipating the same for SPICE, with a spice_tls_x509_cert_dir parameter, to match the existing vnc_tls_x509_cert_dir parameter. We could easily add cipher suite parameters to the config too if there's a compelling need to use a non-default setting.
IIRC, there's an open RFE for the 'ticket' stuff already.
you are correct.
On Tue, Sep 29, 2009 at 04:43:51PM +0100, Daniel P. Berrange wrote:
This supports the -qxl argument in RHEL-5's fork of KVM which has SPICE support. QXL is a graphics card, but inexplicably doesn't use the standard -vga syntax for generic configuration. Also -qxl is rather useless unless you also supply -spice (coming in next patch)
+ + if (virAsprintf(&optstr, "%u,ram=%u", + def->videos[0]->heads, + (def->videos[0]->vram /1024)) < 0) + goto no_memory;
this hides spice's own default, and sends ",ram=0" if xml lacks vram attribute. I think it would be better to drop ",ram" completely if vram==0.
hmm, I missed something somewhere then, because our XML parser should always set a default vram value if it is omitted, so you should never get a ram=0 flag.
What I am saying is that hiding spice's default with adding diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 27fcdf1..67b9e2a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1798,6 +1798,9 @@ virDomainVideoDefaultRAM(virDomainDefPtr def, /* Original Xen PVFB hardcoded to 4 MB */ return 4 * 1024; + case VIR_DOMAIN_VIDEO_TYPE_QXL: + return 64 * 1024; + default: return 0; } seems suboptimal to me.

On Mon, Oct 19, 2009 at 06:10:08PM +0200, Dan Kenigsberg wrote:
On Mon, Oct 19, 2009 at 04:52:10PM +0100, Daniel P. Berrange wrote:
On Mon, Oct 19, 2009 at 05:47:47PM +0200, Dan Kenigsberg wrote:
Thanks for the patches (and sorry for the late response).
The patches are fine, though I am still missing a means to control which of spice channels are to be encrypted. Also missing is a way to set key/cert files and cipher suite per domain. (I aksed spice folks to avoid this problem by using reasonable defaults). More of a problem is the need to set/reset spice "ticket" (one time password), or at least disable it completely on the command line (with ,disable-ticketing).
For VNC, we leave key/cert file configuration to be done per-host in /etc/libvirt/qemu.conf. I was anticipating the same for SPICE, with a spice_tls_x509_cert_dir parameter, to match the existing vnc_tls_x509_cert_dir parameter. We could easily add cipher suite parameters to the config too if there's a compelling need to use a non-default setting.
IIRC, there's an open RFE for the 'ticket' stuff already.
you are correct.
On Tue, Sep 29, 2009 at 04:43:51PM +0100, Daniel P. Berrange wrote:
This supports the -qxl argument in RHEL-5's fork of KVM which has SPICE support. QXL is a graphics card, but inexplicably doesn't use the standard -vga syntax for generic configuration. Also -qxl is rather useless unless you also supply -spice (coming in next patch)
+ + if (virAsprintf(&optstr, "%u,ram=%u", + def->videos[0]->heads, + (def->videos[0]->vram /1024)) < 0) + goto no_memory;
this hides spice's own default, and sends ",ram=0" if xml lacks vram attribute. I think it would be better to drop ",ram" completely if vram==0.
hmm, I missed something somewhere then, because our XML parser should always set a default vram value if it is omitted, so you should never get a ram=0 flag.
What I am saying is that hiding spice's default with adding
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 27fcdf1..67b9e2a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1798,6 +1798,9 @@ virDomainVideoDefaultRAM(virDomainDefPtr def, /* Original Xen PVFB hardcoded to 4 MB */ return 4 * 1024;
+ case VIR_DOMAIN_VIDEO_TYPE_QXL: + return 64 * 1024; + default: return 0; }
seems suboptimal to me.
There is no good solution here - we wanted to be able to expose to apps what amount of video RAM is being used, since this RAM is counted ontop of normal guest RAM & thus important to know about when figuring out if you are overcommitting a host or not. Ultimately QEMU needs to be able to tell us what its defaults are so we can avoid this problem. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Just stumpbled on another issue: On Tue, Sep 29, 2009 at 04:43:50PM +0100, Daniel P. Berrange wrote:
@@ -366,6 +367,13 @@ struct _virDomainGraphicsDef { char *display; int fullscreen : 1; } desktop; + struct { + int port; + int tlsPort; + char *listenAddr; + char *keymap; + char *passwd; + } spice; } data; };
just like vnc, spice needs autoport here (as well as in the schema). I wanted to ignore that, however, migration is impossibly unreliable without autoport=yes - the destination may have the port binded to something else. BTW, and for the sake of the archives, <interface type='bridge'> with named <target dev= > is as problematic as specifying ports. Dan.

On Sun, Oct 25, 2009 at 05:15:26PM +0200, Dan Kenigsberg wrote:
Just stumpbled on another issue:
On Tue, Sep 29, 2009 at 04:43:50PM +0100, Daniel P. Berrange wrote:
@@ -366,6 +367,13 @@ struct _virDomainGraphicsDef { char *display; int fullscreen : 1; } desktop; + struct { + int port; + int tlsPort; + char *listenAddr; + char *keymap; + char *passwd; + } spice; } data; };
just like vnc, spice needs autoport here (as well as in the schema).
I wanted to ignore that, however, migration is impossibly unreliable without autoport=yes - the destination may have the port binded to something else.
Ok, i'll add that.
BTW, and for the sake of the archives, <interface type='bridge'> with named <target dev= > is as problematic as specifying ports.
The <target> element should always be left out when defining XML so that its all auto-assigned. In fact if you give a name of vnetXXX then libvirt will totally ignore it Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Sun, Oct 25, 2009 at 10:54:19PM +0000, Daniel P. Berrange wrote:
On Sun, Oct 25, 2009 at 05:15:26PM +0200, Dan Kenigsberg wrote:
Just stumpbled on another issue:
On Tue, Sep 29, 2009 at 04:43:50PM +0100, Daniel P. Berrange wrote:
@@ -366,6 +367,13 @@ struct _virDomainGraphicsDef { char *display; int fullscreen : 1; } desktop; + struct { + int port; + int tlsPort; + char *listenAddr; + char *keymap; + char *passwd; + } spice; } data; };
just like vnc, spice needs autoport here (as well as in the schema).
I wanted to ignore that, however, migration is impossibly unreliable without autoport=yes - the destination may have the port binded to something else.
Ok, i'll add that.
BTW, is there any recommended port range to use for SPICE TCP and TLS ports ? VNC for example starts at 5900 and searches upwards Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Wed, Oct 28, 2009 at 07:57:05PM +0000, Daniel P. Berrange wrote:
On Sun, Oct 25, 2009 at 10:54:19PM +0000, Daniel P. Berrange wrote:
On Sun, Oct 25, 2009 at 05:15:26PM +0200, Dan Kenigsberg wrote:
Just stumpbled on another issue:
On Tue, Sep 29, 2009 at 04:43:50PM +0100, Daniel P. Berrange wrote:
@@ -366,6 +367,13 @@ struct _virDomainGraphicsDef { char *display; int fullscreen : 1; } desktop; + struct { + int port; + int tlsPort; + char *listenAddr; + char *keymap; + char *passwd; + } spice; } data; };
just like vnc, spice needs autoport here (as well as in the schema).
I wanted to ignore that, however, migration is impossibly unreliable without autoport=yes - the destination may have the port binded to something else.
Ok, i'll add that.
BTW, is there any recommended port range to use for SPICE TCP and TLS ports ? VNC for example starts at 5900 and searches upwards
currently I use 5900 upward for spice ports too, and 5900 downward for tlsPort. (better keep it this way to save changes in iptables)

On Wed, Oct 28, 2009 at 10:53:48PM +0200, Dan Kenigsberg wrote:
On Wed, Oct 28, 2009 at 07:57:05PM +0000, Daniel P. Berrange wrote:
On Sun, Oct 25, 2009 at 10:54:19PM +0000, Daniel P. Berrange wrote:
On Sun, Oct 25, 2009 at 05:15:26PM +0200, Dan Kenigsberg wrote:
Just stumpbled on another issue:
On Tue, Sep 29, 2009 at 04:43:50PM +0100, Daniel P. Berrange wrote:
@@ -366,6 +367,13 @@ struct _virDomainGraphicsDef { char *display; int fullscreen : 1; } desktop; + struct { + int port; + int tlsPort; + char *listenAddr; + char *keymap; + char *passwd; + } spice; } data; };
just like vnc, spice needs autoport here (as well as in the schema).
I wanted to ignore that, however, migration is impossibly unreliable without autoport=yes - the destination may have the port binded to something else.
Ok, i'll add that.
BTW, is there any recommended port range to use for SPICE TCP and TLS ports ? VNC for example starts at 5900 and searches upwards
currently I use 5900 upward for spice ports too, and 5900 downward for tlsPort. (better keep it this way to save changes in iptables)
Dan K., isn't there some magical range from 5900-5999 or something that VDSM ignores? Or did I dream that? Thanks, --Hugh -- ======================================================== Hugh Brock, hbrock@redhat.com, +1-215-564-3232 Deltacloud API + Portal http://deltacloud.org Libvirt virtualization library http://libvirt.org ======================================================== Register now for Red Hat Virtual Experience, December 9. Enterprise Linux, virtualization, cloud, and more. http://www.redhat.com/virtualexperience

On Wed, Oct 28, 2009 at 05:01:48PM -0400, Hugh O. Brock wrote:
On Wed, Oct 28, 2009 at 10:53:48PM +0200, Dan Kenigsberg wrote:
On Wed, Oct 28, 2009 at 07:57:05PM +0000, Daniel P. Berrange wrote:
On Sun, Oct 25, 2009 at 10:54:19PM +0000, Daniel P. Berrange wrote:
On Sun, Oct 25, 2009 at 05:15:26PM +0200, Dan Kenigsberg wrote:
Just stumpbled on another issue:
On Tue, Sep 29, 2009 at 04:43:50PM +0100, Daniel P. Berrange wrote:
@@ -366,6 +367,13 @@ struct _virDomainGraphicsDef { char *display; int fullscreen : 1; } desktop; + struct { + int port; + int tlsPort; + char *listenAddr; + char *keymap; + char *passwd; + } spice; } data; };
just like vnc, spice needs autoport here (as well as in the schema).
I wanted to ignore that, however, migration is impossibly unreliable without autoport=yes - the destination may have the port binded to something else.
Ok, i'll add that.
BTW, is there any recommended port range to use for SPICE TCP and TLS ports ? VNC for example starts at 5900 and searches upwards
currently I use 5900 upward for spice ports too, and 5900 downward for tlsPort. (better keep it this way to save changes in iptables)
Dan K., isn't there some magical range from 5900-5999 or something that VDSM ignores? Or did I dream that?
No, you weren't dreaming. I hoped to save libvir-list from this vdsm's historical oddity. Yes, in RHEV-H-2.1 we squander the 5891--5909 range.

This supports the -qxl argument in RHEL-5's fork of KVM which has SPICE support. QXL is a graphics card, but inexplicably doesn't use the standard -vga syntax for generic configuration. Also -qxl is rather useless unless you also supply -spice (coming in next patch) * src/qemu_conf.c: Probe for -qxl arg in QEMU help. Format a -qxl arg for launching VMs * src/qemu_conf.h: Add flag for -qxl arg availability * tests/qemuhelpdata/kvm-83-rhel, tests/qemuhelptest.c: test for -qxl arg help parsing * tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c, tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args, tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml: add tests for -qxl graphics XML to ARGV handling --- src/qemu/qemu_conf.c | 41 +++++- src/qemu/qemu_conf.h | 2 +- tests/qemuhelpdata/kvm-83-rhel | 151 ++++++++++++++++++++ tests/qemuhelptest.c | 16 ++ .../qemuxml2argv-graphics-spice.args | 1 + .../qemuxml2argv-graphics-spice.xml | 25 ++++ tests/qemuxml2argvtest.c | 3 + tests/qemuxml2xmltest.c | 1 + 8 files changed, 235 insertions(+), 5 deletions(-) create mode 100644 tests/qemuhelpdata/kvm-83-rhel create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index ae171bc..695ee7c 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -87,7 +87,7 @@ VIR_ENUM_IMPL(qemuVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "vmware", NULL, /* no arg needed for xen */ NULL, /* don't support vbox */ - NULL, /* Not implemented yet */); + NULL, /* qxl is a bizarre special case */); #define PROC_MOUNT_BUF_LEN 255 @@ -865,6 +865,8 @@ static unsigned int qemudComputeCmdFlags(const char *help, } if (strstr(help, "-vga") && !strstr(help, "-std-vga")) flags |= QEMUD_CMD_FLAG_VGA; + if (strstr(help, "-qxl")) + flags |= QEMUD_CMD_FLAG_QXL; if (strstr(help, "boot=on")) flags |= QEMUD_CMD_FLAG_DRIVE_BOOT; if (strstr(help, "serial=s")) @@ -2174,9 +2176,15 @@ int qemudBuildCommandLine(virConnectPtr conn, } if (qemuCmdFlags & QEMUD_CMD_FLAG_VGA) { - if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_XEN) { + switch (def->videos[0]->type) { + case VIR_DOMAIN_VIDEO_TYPE_XEN: /* nothing - vga has no effect on Xen pvfb */ - } else { + break; + case VIR_DOMAIN_VIDEO_TYPE_QXL: + /* handle later */ + break; + default: + { const char *vgastr = qemuVideoTypeToString(def->videos[0]->type); if (!vgastr) { qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, @@ -2187,9 +2195,10 @@ int qemudBuildCommandLine(virConnectPtr conn, ADD_ARG_LIT("-vga"); ADD_ARG_LIT(vgastr); + break; + } } } else { - switch (def->videos[0]->type) { case VIR_DOMAIN_VIDEO_TYPE_VGA: ADD_ARG_LIT("-std-vga"); @@ -2204,6 +2213,10 @@ int qemudBuildCommandLine(virConnectPtr conn, /* No special args - this is the default */ break; + case VIR_DOMAIN_VIDEO_TYPE_QXL: + /* handle later */ + break; + default: qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, _("video type %s is not supported with QEMU"), @@ -2211,6 +2224,26 @@ int qemudBuildCommandLine(virConnectPtr conn, goto error; } } + + if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + + if (qemuCmdFlags & QEMUD_CMD_FLAG_QXL) { + char *optstr; + + if (virAsprintf(&optstr, "%u,ram=%u", + def->videos[0]->heads, + (def->videos[0]->vram /1024)) < 0) + goto no_memory; + + ADD_ARG_LIT("-qxl"); + ADD_ARG(optstr); + } else { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s", + _("qxl graphics are not supported with this QEMU")); + goto error; + } + } + } /* Add sound hardware */ diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 96b7c0c..c8e3276 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -60,7 +60,6 @@ enum qemud_cmd_flags { QEMUD_CMD_FLAG_KVM = (1 << 13), /* Whether KVM is compiled in */ QEMUD_CMD_FLAG_DRIVE_FORMAT = (1 << 14), /* Is -drive format= avail */ QEMUD_CMD_FLAG_VGA = (1 << 15), /* Is -vga avail */ - /* features added in qemu-0.10.0 */ QEMUD_CMD_FLAG_0_10 = (1 << 16), QEMUD_CMD_FLAG_NET_NAME = QEMUD_CMD_FLAG_0_10, /* -net ...,name=str */ @@ -70,6 +69,7 @@ enum qemud_cmd_flags { QEMUD_CMD_FLAG_MEM_PATH = (1 << 18), /* mmap'ped guest backing supported */ QEMUD_CMD_FLAG_DRIVE_SERIAL = (1 << 19), /* -driver serial= available */ QEMUD_CMD_FLAG_XEN_DOMID = (1 << 20), /* -xen-domid (new style xen integration) */ + QEMUD_CMD_FLAG_QXL = (1 << 21), /* Is -qxl avail (RHEL-5/6 custom) */ }; /* Main driver state */ diff --git a/tests/qemuhelpdata/kvm-83-rhel b/tests/qemuhelpdata/kvm-83-rhel new file mode 100644 index 0000000..aeae3a4 --- /dev/null +++ b/tests/qemuhelpdata/kvm-83-rhel @@ -0,0 +1,151 @@ +QEMU PC emulator version 0.9.1 (kvm-83-maint-snapshot-20090205), Copyright (c) 2003-2008 Fabrice Bellard +usage: qemu [options] [disk_image] + +'disk_image' is a raw hard image image for IDE hard disk 0 + +Standard options: +-M machine select emulated machine (-M ? for list) +-cpu cpu select CPU (-cpu ? for list) +-fda/-fdb file use 'file' as floppy disk 0/1 image +-hda/-hdb file use 'file' as IDE hard disk 0/1 image +-hdc/-hdd file use 'file' as IDE hard disk 2/3 image +-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master) +-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i] + [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off] + [,cache=writethrough|writeback|none][,format=f][,serial=s] + [,boot=on|off] + use 'file' as a drive image +-mtdblock file use 'file' as on-board Flash memory image +-sd file use 'file' as SecureDigital card image +-pflash file use 'file' as a parallel flash image +-boot [a|c|d|n] boot on floppy (a), hard disk (c), CD-ROM (d), or network (n) +-snapshot write to temporary files instead of disk image files +-no-frame open SDL window without a frame and window decorations +-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt) +-no-quit disable SDL window close capability +-no-fd-bootchk disable boot signature checking for floppy disks +-m megs set virtual RAM size to megs MB [default=128] +-smp n set the number of CPUs to 'n' [default=1] +-nographic disable graphical output and redirect serial I/Os to console +-portrait rotate graphical output 90 deg left (only PXA LCD) +-k language use keyboard layout (for example "fr" for French) +-audio-help print list of audio drivers and their options +-soundhw c1,... enable audio support + and only specified sound cards (comma separated list) + use -soundhw ? to get the list of supported cards + use -soundhw all to enable all of them +-vga [std|cirrus|vmware] + select video card type +-localtime set the real time clock to local time [default=utc] +-full-screen start in full screen +-win2k-hack use it when installing Windows 2000 to avoid a disk full bug +-rtc-td-hack use it to fix time drift in Windows ACPI HAL +-usb enable the USB driver (will be the default soon) +-usbdevice name add the host or guest USB device 'name' +-name string set the name of the guest +-uuid %08x-%04x-%04x-%04x-%012x specify machine UUID +-notify event enable async-notifications for event +-qxl <num>[,ram=megs] + use 'num' qxl display devices, each with RAM size of 'megs' MB + [default=64] +-spice <args> use spice +-spice-help show spice usage + +Network options: +-net nic[,vlan=n][,macaddr=addr][,model=type][,name=str] + create a new Network Interface Card and connect it to VLAN 'n' +-net user[,vlan=n][,name=str][,hostname=host] + connect the user mode network stack to VLAN 'n' and send + hostname 'host' to DHCP clients +-net tap[,vlan=n][,name=str][,fd=h][,ifname=name][,script=file][,downscript=dfile] + connect the host TAP network interface to VLAN 'n' and use the + network scripts 'file' (default=/etc/qemu-ifup) + and 'dfile' (default=/etc/qemu-ifdown); + use '[down]script=no' to disable script execution; + use 'fd=h' to connect to an already opened TAP interface +-net socket[,vlan=n][,name=str][,fd=h][,listen=[host]:port][,connect=host:port] + connect the vlan 'n' to another VLAN using a socket connection +-net socket[,vlan=n][,name=str][,fd=h][,mcast=maddr:port] + connect the vlan 'n' to multicast maddr and port +-net none use it alone to have zero network devices; if no -net option + is provided, the default is '-net nic -net user' + +-bt hci,null Dumb bluetooth HCI - doesn't respond to commands +-bt hci,host[:id] + Use host's HCI with the given name +-bt hci[,vlan=n] + Emulate a standard HCI in virtual scatternet 'n' +-bt vhci[,vlan=n] + Add host computer to virtual scatternet 'n' using VHCI +-bt device:dev[,vlan=n] + Emulate a bluetooth device 'dev' in scatternet 'n' + +-tftp dir allow tftp access to files in dir [-net user] +-bootp file advertise file in BOOTP replies +-smb dir allow SMB access to files in 'dir' [-net user] +-redir [tcp|udp]:host-port:[guest-host]:guest-port + redirect TCP or UDP connections from host to guest [-net user] + +Linux boot specific: +-kernel bzImage use 'bzImage' as kernel image +-append cmdline use 'cmdline' as kernel command line +-initrd file use 'file' as initial ram disk + +Debug/Expert options: +-monitor dev redirect the monitor to char device 'dev' +-vmchannel di:DI,dev redirect the hypercall device with device id DI, to char device 'dev' +-balloon dev redirect the balloon hypercall device to char device 'dev' +-serial dev redirect the serial port to char device 'dev' +-parallel dev redirect the parallel port to char device 'dev' +-pidfile file Write PID to 'file' +-S freeze CPU at startup (use 'c' to start execution) +-s wait gdb connection to port +-p port set gdb connection port [default=1234] +-d item1,... output log to /tmp/qemu.log (use -d ? for a list of log items) +-hdachs c,h,s[,t] force hard disk 0 physical geometry and the optional BIOS + translation (t=none or lba) (usually qemu can guess them) +-L path set the directory for the BIOS, VGA BIOS and keymaps +-no-kvm disable KVM hardware virtualization +-no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC +-no-kvm-pit disable KVM kernel mode PIT +-no-kvm-pit-reinjection disable KVM kernel mode PIT interrupt reinjection +-enable-nesting enable support for running a VM inside the VM (AMD only) +-pcidevice host=bus:dev.func[,dma=none][,name=string] + expose a PCI device to the guest OS. + dma=none: don't perform any dma translations (default is to use an iommu) + 'string' is used in log output. +-no-acpi disable ACPI +-no-hpet disable HPET +-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,data=file1[:file2]...] + ACPI table description +-smbios file=binary + Load SMBIOS entry from binary file +-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d] + Specify SMBIOS type 0 fields +-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str] + [,uuid=uuid][,sku=str][,family=str] + Specify SMBIOS type 1 fields +-no-reboot exit instead of rebooting +-no-shutdown stop before shutdown +-loadvm [tag|id] start right away with a saved state (loadvm in monitor) +-vnc display start a VNC server on display +-daemonize daemonize QEMU after initializing +-tdf inject timer interrupts that got lost +-kvm-shadow-memory megs set the amount of shadow pages to be allocated +-mem-path set the path to hugetlbfs/tmpfs mounted directory, also + enables allocation of guest memory with huge pages +-mem-prealloc toggles preallocation of -mem-path backed physical memory + at startup. Default is enabled. +-option-rom rom load a file, rom, into the option ROM space +-clock force the use of the given methods for timer alarm. + To see what timers are available use -clock ? +-startdate select initial date of the clock +-icount [N|auto] + Enable virtual instruction counter with 2^N clock ticks per instruction + +During emulation, the following keys are useful: +ctrl-alt-f toggle full screen +ctrl-alt-n switch to virtual console 'n' +ctrl-alt toggle mouse and keyboard grab + +When using -nographic, press 'ctrl-a h' to get some help. diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 428d9a3..7fd9e92 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -179,6 +179,22 @@ mymain(int argc, char **argv) QEMUD_CMD_FLAG_PCIDEVICE | QEMUD_CMD_FLAG_MEM_PATH, 10092, 1, 0); + DO_TEST("kvm-83-rhel", + QEMUD_CMD_FLAG_VNC_COLON | + QEMUD_CMD_FLAG_NO_REBOOT | + QEMUD_CMD_FLAG_DRIVE | + QEMUD_CMD_FLAG_DRIVE_BOOT | + QEMUD_CMD_FLAG_NAME | + QEMUD_CMD_FLAG_UUID | + QEMUD_CMD_FLAG_VNET_HDR | + QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP | + QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC | + QEMUD_CMD_FLAG_DRIVE_CACHE_V2 | + QEMUD_CMD_FLAG_KVM | + QEMUD_CMD_FLAG_DRIVE_FORMAT | + QEMUD_CMD_FLAG_VGA | + QEMUD_CMD_FLAG_QXL, + 9001, 1, 0); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args new file mode 100644 index 0000000..d401b85 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args @@ -0,0 +1 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -qxl 3,ram=64 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml new file mode 100644 index 0000000..17f4b20 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml @@ -0,0 +1,25 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory>219200</memory> + <currentMemory>219200</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + </disk> + <video> + <model type='qxl' vram='65536' heads='3'/> + </video> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 3255146..142ee76 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -244,6 +244,9 @@ mymain(int argc, char **argv) DO_TEST("graphics-sdl", 0); DO_TEST("graphics-sdl-fullscreen", 0); + + DO_TEST("graphics-spice", QEMUD_CMD_FLAG_QXL); + DO_TEST("input-usbmouse", 0); DO_TEST("input-usbtablet", 0); DO_TEST("input-xen", QEMUD_CMD_FLAG_DOMID); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 2cba47b..defc35d 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -107,6 +107,7 @@ mymain(int argc, char **argv) DO_TEST("graphics-vnc-tls"); DO_TEST("graphics-sdl"); DO_TEST("graphics-sdl-fullscreen"); + DO_TEST("graphics-spice"); DO_TEST("input-usbmouse"); DO_TEST("input-usbtablet"); DO_TEST("input-xen"); -- 1.6.2.5

This supports the -spice argument in RHEL-5's fork of KVM which has SPICE support. There are many more options for -spice than need to be added - at very least the x509 cert paths should be pulled out of /etc/libvirt/qemu.conf * src/qemu_conf.c, src/qemu_conf.h: Add SPICE flag. Check for -spice availability. Format -spice arg for command line * qemuhelptest.c: Add SPICE flag * qemuxml2argvdata/qemuxml2argv-graphics-spice.args: Add <graphics> for spice * qemuxml2argvdata/qemuxml2argv-graphics-spice.xml: Add -spice arg * qemuxml2argvtest.c: Add SPICE flag --- src/qemu/qemu_conf.c | 38 ++++++++++++++++++++ src/qemu/qemu_conf.h | 1 + tests/qemuhelptest.c | 3 +- .../qemuxml2argv-graphics-spice.args | 2 +- .../qemuxml2argv-graphics-spice.xml | 2 + tests/qemuxml2argvtest.c | 2 +- 6 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 695ee7c..fea0747 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -865,6 +865,8 @@ static unsigned int qemudComputeCmdFlags(const char *help, } if (strstr(help, "-vga") && !strstr(help, "-std-vga")) flags |= QEMUD_CMD_FLAG_VGA; + if (strstr(help, "-spice")) + flags |= QEMUD_CMD_FLAG_SPICE; if (strstr(help, "-qxl")) flags |= QEMUD_CMD_FLAG_QXL; if (strstr(help, "boot=on")) @@ -2163,6 +2165,42 @@ int qemudBuildCommandLine(virConnectPtr conn, */ ADD_ENV_COPY("QEMU_AUDIO_DRV"); ADD_ENV_COPY("SDL_AUDIODRIVER"); + } else if ((def->ngraphics == 1) && + def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) { + virBuffer opt = VIR_BUFFER_INITIALIZER; + char *optstr; + + if (!(qemuCmdFlags & QEMUD_CMD_FLAG_SPICE)) { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s", + _("spice graphics are not supported with this QEMU")); + goto error; + } + + virBufferVSprintf(&opt, "port=%u", def->graphics[0]->data.spice.port); + + if (def->graphics[0]->data.spice.tlsPort) + virBufferVSprintf(&opt, ",sport=%u", def->graphics[0]->data.spice.tlsPort); + + if (def->graphics[0]->data.spice.listenAddr) + virBufferVSprintf(&opt, ",host=%s", def->graphics[0]->data.spice.listenAddr); + + if (virBufferError(&opt)) + goto no_memory; + + optstr = virBufferContentAndReset(&opt); + + ADD_ARG_LIT("-spice"); + ADD_ARG(optstr); + if (def->graphics[0]->data.spice.keymap) { + ADD_ARG_LIT("-k"); + ADD_ARG_LIT(def->graphics[0]->data.spice.keymap); + } + /* SPICE includes native support for tunnelling audio, so we + * set the audio backend to none, to prevent it opening the + * host OS audio devices since that causes security issues + * and is non-sensical when using SPICE. + */ + ADD_ENV_LIT("QEMU_AUDIO_DRV=none"); } else if (def->ngraphics) { qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s", _("unsupported graphics output requested")); diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index c8e3276..3866f0e 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -70,6 +70,7 @@ enum qemud_cmd_flags { QEMUD_CMD_FLAG_DRIVE_SERIAL = (1 << 19), /* -driver serial= available */ QEMUD_CMD_FLAG_XEN_DOMID = (1 << 20), /* -xen-domid (new style xen integration) */ QEMUD_CMD_FLAG_QXL = (1 << 21), /* Is -qxl avail (RHEL-5/6 custom) */ + QEMUD_CMD_FLAG_SPICE = (1 << 22), /* Is -spice avail (RHEL-5/6 custom) */ }; /* Main driver state */ diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 7fd9e92..980d8bd 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -193,7 +193,8 @@ mymain(int argc, char **argv) QEMUD_CMD_FLAG_KVM | QEMUD_CMD_FLAG_DRIVE_FORMAT | QEMUD_CMD_FLAG_VGA | - QEMUD_CMD_FLAG_QXL, + QEMUD_CMD_FLAG_QXL | + QEMUD_CMD_FLAG_SPICE, 9001, 1, 0); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args index d401b85..43516da 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -qxl 3,ram=64 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -spice port=5903,sport=5904,host=127.0.0.1 -qxl 3,ram=64 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml index 17f4b20..f985c89 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml @@ -18,6 +18,8 @@ <source dev='/dev/HostVG/QEMUGuest1'/> <target dev='hda' bus='ide'/> </disk> + <input type='mouse' bus='ps2'/> + <graphics type='spice' port='5903' tlsPort='5904' listen='127.0.0.1'/> <video> <model type='qxl' vram='65536' heads='3'/> </video> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 142ee76..9650900 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -245,7 +245,7 @@ mymain(int argc, char **argv) DO_TEST("graphics-sdl", 0); DO_TEST("graphics-sdl-fullscreen", 0); - DO_TEST("graphics-spice", QEMUD_CMD_FLAG_QXL); + DO_TEST("graphics-spice", QEMUD_CMD_FLAG_QXL | QEMUD_CMD_FLAG_SPICE); DO_TEST("input-usbmouse", 0); DO_TEST("input-usbtablet", 0); -- 1.6.2.5
participants (3)
-
Dan Kenigsberg
-
Daniel P. Berrange
-
Hugh O. Brock