virttest.env_process: Don't update params of an unused living VM

Currently during vm_preprocess params of unused running VMs are updated,
but VM is not recreated (it's not used, so there is no need for it).
If we create VM in 1st test, in 2nd test we use different params but set
start_vm = no, params are updated so when we use the same params from
2nd test in 3rd test, preprocess would match the VM from 1st test as
the params were updated. Anyway as the VM is not recreated, the running
VM doesn't represents the params from 2nd test.

With my modification the preprocess would always handle VM properly. The
only problem might be, when someone uses vm.create() directly without
preprocess in the 2nd test. Anyway it's a bad practise and I haven't found
it in upstream tests. We always use preprocess to prepare the VM.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Fix DevContainer.remove() issues

Fix issues of DevContainer.remove() and add support for
non-recursive removal.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Add calls to handle QBaseDevice.child_bus

To simplify and unify usage of QBaseDevice.child_bus I added
add/rm_child_bus functions.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Hotplug/unplug support

This patch adds the possibility to safely hotplug/unplug devices from
running VM.

Additionally it adds another VM state and VM param. When the test
requires clean VM, you might specify "allow_hotplugged_vm = no" and
when VM used hotplug it will be recreated.

For hotplugging you might specify monitor, which should be used and
whether to verify results. This is not supported by all devices, but
when there is a method to automatically verify hotplug results, it'll
do it for you and cleans the qdev state for you. Otherwise it's upto the
user to do it by qdev.hotplug_verified().

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Add support for hotpluggable drives

Add support for QDrive, which supports drive_add (QHPDrive) or
__com.redhat_drive_add (QRHDrive).

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Fix error messages of DevContainer.insert

Error reason was shown only in force insertion mode.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Set bus/addr when force insertion device

When we force insert device into bus where it doesn't belongs to
we should probably set bus and addr as it's not the default behavior.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Skip 'driver=' string in devices

Libvirt doesn't use the full cmdline, but only -device $driver,$params
format. This patch makes autotest follow this syntax too.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
shared.cfg.machines: Disallow 'ide' usage on q35

q35 doesn't have ide bus. People should use ahci instead.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_vm: Remove unused functions add_drive and add_cdrom

add_drive and add_cdrom are obsoleted by
virttest.qemu_devices.images_define_by_variables()

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu_devices: Fix missing import

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