qemu.tests: Add flag_check test cases

    1. boot guest with -cpu model,+extra_flags (extra_flags is optional)
       a. no defined model_name in cfg file
          guest_model = host_model
       b. model_name defined in cfg file
          guest_model = params.get("cpu_model")
    2. get guest flags
    3. get expected model flags from dump file
       a. -cpu host: qemu_model = host_model
       b. guest_model > host_model --> expected_model = host_model
          e.g guest_model = Haswell, host_model = Sandybridge
              expected_model = Sandybridge
       c. guest_model < host_model --> expected_model = guest_model
    4. get extra flags
       a. add_flags = +flag
          1). flag is exposed to guest if it's supported in host
          2). flag is not supported to guest if it's unknown in host
          3). ignore "check", "enforce" which are params not flag
       b. del_flags = -flag
          flag is removed if it's supported in guest
       c. params check: check lack flag in host include unknow flag
    5. compare expected flag with flags in guest
       a. out_flags: not supported with some conf, this kinds of flag
          will be displayed in dump file, but not in guest.
          e.g tsc-dedline is not supported with -M rhel6.3.0
       b. option_flags: some flag is generated by kernel which is not
          defined in dump file. it's acceptable when display in guest.
          e.g rep_good
       expected_flags = expected_model_flags + add_flags - del_flags - out_flags
       miss_flag = expected_flags - guest_flags
       unexpect_flag = guest_flags - expected_flags - option_flags

Change v1:
1). add model_info check
2). improve for loop
3). put sub-func at the top

Change from v2:
1). move qemu_binary to function get_all_support_flags()
2). add flags value check

Change from v3:
Add one more blank line between functions

Change from v4:
change more_flags to unexpect_flag
improve get_extra_flags function

Change from V5:
1). remove unused model
2). add try, except for m.groups()[0]
3). result format of -cpu ? are diff between rhel6, and rhel7,
    set pattern in config file

Change from V6:
1). update flag.groups() to flag_list.groups()
2). add blank space between "" and ,

Signed-off-by: Suqin Huang <shuang@redhat.com>
Acked-by: Xu Tian <xutian@redhat.com>

Update the dump_file dir to make it accept local file. And update
some flags should in option_flags.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
qemu.tests: Add boot_cpu_model test cases

1). boot guest with cpu_model in the cluster one by one
2). check flags in guest if flag check is required, otherwise shutdown guest

Change from v1:
use cpu_model_%s instead of intel_model/amd_model

Signed-off-by: Suqin Huang <shuang@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>
utils_misc: Introduce get_qemu_binary utility functions

It is a fairly frequent task to pick up the current
qemu binary being used at a time, and as time passed,
we had a proliferation of mechanisms to do it, slightly
similar to each other. Introduce get_qemu_binary,
get_qemu_img_binary() and get_qemu_io_binary(), utility
functions that get the path of each of the QEMU binaries
for use in tests and utility functions. Use the new
functions across virt test.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>