diff mbox

kvm tools: Fix SDL and VNC by adding default vidmode

Message ID 1350809218-7887-1-git-send-email-asias.hejun@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Asias He Oct. 21, 2012, 8:46 a.m. UTC
In commit d73b168b3145f7bfe3f0e5d968653a1125b93a4e (kvm tools: ui
improvements), the code to set a default vidmode was killed
accidentally. This makes SDL and VNC not working unless '--vidmode'
option is added, e.g lkvm run --sdl --vidmode 786.

Signed-off-by: Asias He <asias.hejun@gmail.com>
---
 tools/kvm/builtin-run.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Pekka Enberg Oct. 21, 2012, 3:20 p.m. UTC | #1
On Sun, 21 Oct 2012, Asias He wrote:
> In commit d73b168b3145f7bfe3f0e5d968653a1125b93a4e (kvm tools: ui
> improvements), the code to set a default vidmode was killed
> accidentally. This makes SDL and VNC not working unless '--vidmode'
> option is added, e.g lkvm run --sdl --vidmode 786.
> 
> Signed-off-by: Asias He <asias.hejun@gmail.com>

Applied, thanks Asias!

> ---
>  tools/kvm/builtin-run.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
> index 50495a3..709ed33 100644
> --- a/tools/kvm/builtin-run.c
> +++ b/tools/kvm/builtin-run.c
> @@ -593,9 +593,17 @@ static struct kvm *kvm_cmd_run_init(int argc, const char **argv)
>  	if (!kvm->cfg.script)
>  		kvm->cfg.script = DEFAULT_SCRIPT;
>  
> -	if (!kvm->cfg.vnc && !kvm->cfg.sdl)
> +	if (!kvm->cfg.vidmode)
>  		kvm->cfg.vidmode = -1;
>  
> +	/* vidmode should be either specified or set by default */
> +	if (kvm->cfg.vnc || kvm->cfg.sdl) {
> +		if (kvm->cfg.vidmode == -1)
> +			kvm->cfg.vidmode = 0x312;
> +	} else {
> +		kvm->cfg.vidmode = 0;
> +	}
> +
>  	if (!kvm->cfg.network)
>                  kvm->cfg.network = DEFAULT_NETWORK;
>  
> -- 
> 1.7.11.7
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index 50495a3..709ed33 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -593,9 +593,17 @@  static struct kvm *kvm_cmd_run_init(int argc, const char **argv)
 	if (!kvm->cfg.script)
 		kvm->cfg.script = DEFAULT_SCRIPT;
 
-	if (!kvm->cfg.vnc && !kvm->cfg.sdl)
+	if (!kvm->cfg.vidmode)
 		kvm->cfg.vidmode = -1;
 
+	/* vidmode should be either specified or set by default */
+	if (kvm->cfg.vnc || kvm->cfg.sdl) {
+		if (kvm->cfg.vidmode == -1)
+			kvm->cfg.vidmode = 0x312;
+	} else {
+		kvm->cfg.vidmode = 0;
+	}
+
 	if (!kvm->cfg.network)
                 kvm->cfg.network = DEFAULT_NETWORK;