vga: allow non-global vmstate

Need a way to opt-out from vga.vram being global vmstate, for
secondary vga cards.  Add a bool parameter to vga_common_init
to support this.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
vga: add secondary stdvga variant

Add a standard vga variant which doesn't occupy any legacy
resources and thus can easily be used as secondary (or legacy-free)
graphics adapter.  Programming must be done using the MMIO bar.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
add display-vga test

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
add secondary-vga to display-vga test

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
block: fix qemu-img --help invocation

This fixes a bug introduced in commit ac1307ab, that caused the
'--help' option to not be recognized as a valid command, and not
print any help.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
mirror: Use DIV_ROUND_UP

Although bdrv_getlength() was just called above this, and checked for
error, it is better to just use the value we already get, and use
DIV_ROUND_UP.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tcg: Fix missed pointer size != TCG_TARGET_REG_BITS changes

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg: Add INDEX_op_trunc_shr_i32

Let the backend do something special for truncation.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-sparc: Remove most uses of TCG_TARGET_REG_BITS

Replace with SPARC64 define.  Soon even sparcv8plus will use
64-bit register as far as TCG is concerned.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-sparc: Support trunc_shr_i32

Unlike a 64-bit shift op, allows the output to be in %l or %i registers
for sparcv8plus.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-sparc: Use 64-bit registers with sparcv8plus

Quite a lot of effort was spent composing and decomposing 64-bit
quantities in registers, when we should just create them and leave
them as one 64-bit register.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-sparc: Use the RETURN instruction

Saves one insn per TB exit over JMPL+RESTORE.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-sparc: Implement muls2_i32

Using the 32-bit SMUL is a tad more efficient than
resorting to extending and using the 64-bit MULX.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-sparc: Tidy check_fit_* tests

Use sextract instead of raw bit shifting for the tests.  Introduce
a new check_fit_ptr macro to make it clear we're looking at pointers.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-sparc: Don't handle mov/movi in tcg_out_op

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-sparc: Hoist common argument loads in tcg_out_op

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-sparc: Fixup function argument types

Use TCGReg everywhere appropriate.  Use int32_t for all arguments
that may be registers or immediate constants.  Merge tcg_out_addi
into its only caller.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-sparc: Fix small 32-bit movi

We tested imm13 before discarding garbage high bits.

Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-sparc: Accept stores of zero

Signed-off-by: Richard Henderson <rth@twiddle.net>
block: Add '--version' option to qemu-img

This allows qemu-img to print out version information, without
needing to print the long help wall of text.

While there, perform some minor whitespace cleanup, and remove the
unused option_index variable in the call to getopt_long().

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>