virsh_attach_detach_disk: attach tmp disk with config option into offline guest

We want to attach the disk with --config parameter, because we have to be sure,
that the disk will be attached using all versions of libvirt. But to use this
parameter we have to at first shutdown the guest because this chagne will affect
next boot of the guest.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh_attach_detach_disk: move add acpi module after attach/detach required disks

To reduce restart count and time needed to do it I've just move this code after
disks preparation. For disk preparation you need to have the guest offline and
it would be pointless to start the guest, modprobe the acpiphp and than shutdonw
the guest again to attach/detach required disks.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh_attach_detach_disk: attach second temp disk for the detach_twice test

We have to attach two disks for the detach_twice test in order to run the test.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh_attach_detach_disk: make the proper return status checking

It's obvious that if you are running the attach/detach config test
that you will not see the change in the xml returned by dumpxml of
a live guest.

This patch also fixes whitespace issues and typo in error message.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh_attach_detach_disk: improve 'acpiphp_module_modprobe' function

Executing the 'rpm -qa | grep redhat-release' on non RHEL system or
non RPM system will cause the tests to fail. Adding few more conditions
resolves this issue.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh_attach_detach_disk: resume guest before we check the xml file

On newer libvirt there is a fix for a bug, that xml file is updated
before guest is resumed. The correct way is that the xml file is
updated after the guest is resumed.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>