virt/scripts/cb.py: Clipboard Python Script

Adding a python script to copy and paste from the clipboard.  The test
will be used in a copy and paste test, to test spice-vdagent.

Signed-off-by: Vimal Patel <vipatel@redhat.com>
virt/kvm_vm.py: Adding Spice Option for qemu-kvm

Adding the spice option disable-copy-paste for qemu-kvm.

Signed-off-by: Vimal Patel <vipatel@redhat.com>
virt.spice: Adding a Copy and Paste Test for Spice-Vdagent

Adding a copy and paste test to test spice vdagent.  The test
can handle copying from the client to guest and vice versa, and
it also handles negative tests if spice-vdagent service is off
or if disable-copy-paste option is set on the vm.

Changes from v3:
 * Removed lots of non py 2.4 constructs

Signed-off-by: Vimal Patel <vipatel@redhat.com>
virt.spice: Defining parameters for rv_copyandpaste test

Setting up the parameters for rv_copyandpaste, to get this
to work I also needed to add virtio setup to rv_connect and
rv_disconnect.

Signed-off-by: Vimal Patel <vipatel@redhat.com>
virt/deps: Adding an image to be used for testing in the copy and paste tests.

Signed-off-by: Vimal Patel <vipatel@redhat.com>
virt/utils_spice: Adding a utils file for common spice utilities

Changes from v3:
 * Removed non py 2.4 constructs
 * Rebase to new virt test structure

Signed-off-by: Vimal Patel <vipatel@redhat.com>
virt.spice: Adding the Copy & Paste Tests & disable-copy-paste variant

Adding all the Copy & Paste Scenarios (14 tests), adding
the disable-copy-paste variant, and modifying the other
tests to be able to handle the new variant.

Signed-off-by: Vimal Patel <vipatel@redhat.com>
virt.base.cfg: Add spice seamless migration option reference

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
virt.kvm_vm: Add support for SSL and seamless spice migration

Add tls-port and cert subject options to spice migrate info qemu call
during spice migration with encrypted channels.

Add seamless-migration qemu option and wait for notification from spice
about finish of the seamless migration.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
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>