virt: Remove virtio console socket files after qemu exit

This patch moves 'get_virtio_port_filename' method to virt_vm
module, and create a 'get_virtio_port_filenames' method for
the cleanup step in vm destroy function.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt: Make serial port configurable

Now autotest only support one serial port, and it's name
and parameters are hardcode in script. This patch adds a
parameter called 'isa_serial' in config file, let user
can add more than one serials to one guest.

An example for this sia_serial parameter.
isa_serial = "S1 S2 S3"

Changes from v1:
 - Raise exception if 'isa_serial' parameter is incorrect set.
 - Update variant name definition.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
KVM Test: qemu_guest_agent: Test guest agent with isa-serial device

The qemu guest agent supports both virtio serial and isa serial, but
the original guest agent test only test it with virtio serial. This
patch add the missing part of isa serial testing.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.kvm_monitor: Add a method to verify monitor cmd is supported by qemu

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.guest_agent: Add shutdown parameter to shutdown method

The 'guest-shutdown' cmd in qemu guest agent has 3 modes:
 - 'powerdown': The default action for this command.
 - 'reboot': Reboot guest.
 - 'halt': halt guest directly.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.guest_agent: Add suspend command for qemu guest agent

The 'guest-suspend-*' tries to execute the scripts provided
by the pm-utils package.  If it's not available, the suspend
operation will be performed by manually writing to a sysfs
file.
For the best results it's strongly recommended to have the
pm-utils package installed in the guest.

Qemu provides 3 modes to suspend guest:
 - "disk": Suspend guest to disk (S4)
    Note this "guest-suspend-disk" cmds won't return a response
    on success. Guest may quit with exit code 0 or return's a
    'shutdown' status when querying VM status via monitor.

 - "ram": Suspend guest to memory (S3)
    guest-suspend-ram requires QEMU to support the
    'system_wakeup' command. Thus, it's *required* to query
    QEMU for the presence of the 'system_wakeup' command
    before issuing guest-suspend-ram.
    Note: This command won't return a response on success.
    There are 2 ways to check guest status after issuing this
    command:
      * Wait for the SUSPEND QMP event from QEMU
      * Query VM status is "suspended" in QEMU monitor.

 - "hybird": Suspend guest to memory and disk
    guest-suspend-ram requires QEMU to support the
    'system_wakeup' command. Thus, it's *required* to query
    QEMU for the presence of the 'system_wakeup' command
    before issuing guest-suspend-ram.
    Note: This command won't return a response on success.
    There are 2 ways to check guest status after issuing this
    command:
      * Wait for the SUSPEND QMP event from QEMU
      * Query VM status is "suspended" in QEMU monitor.

Changes from v1:
 - Update random number generation method.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.guest_agent: Add fsfreeze and fsthraw support

The "guest-fsfreeze-freeze" and "guest-fsfreeze-thaw" cmds are
used to freeze/unfreeze all freezable, local guest filesystems.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>