On Sat, Nov 10, 2012 at 02:40:24 +0100, Alon Levy wrote:
---
src/qemu/qemu_command.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ba99c7a..a1a4523 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6183,9 +6183,26 @@ qemuBuildCommandLine(virConnectPtr conn,
}
if (def->ngraphics > 1) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("only 1 graphics device is
supported"));
- goto error;
+ int sdl = 0, vnc = 0, spice = 0;
+ for (i = 0 ; i < def->ngraphics ; ++i) {
+ switch (def->graphics[i]->type) {
+ case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
+ ++sdl;
+ break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
+ ++vnc;
+ break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
+ ++spice;
+ break;
+ }
+ }
+ if (sdl > 1 || vnc > 1 || spice > 1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("only 1 graphics device of each type
"
+ "(sdl, vnc, spice) is supported"));
+ goto error;
+ }
}
We don't need the extra if (def->ngraphics > 1) around this code.
ACK with that removed.
Jirka