update_device: Add changes from prior to split

When tp-libvirt was split from virt-test, all PR's were closed - this
PR is adding back the changes made by myself and cevich from PR #1171.

Adjust the test to use the newer --live option rather than --persistent.

Also fix issue with shut_off_option testing.  When a guest is off, the
failure should only be if someone passed the --live flag.  Add the
shut_off_option testing to the normal_test list and use the diff_file
check to ensure that a shutdown guest would be updated.  The --live
option processing should only affect the running guest and not the
configuration after shutdown

Signed-off-by: John Ferlan <jferlan@redhat.com>
update_device: version-specific behavior

* Added --persistent and --config version-specific behavior checks.
* Updated test to use disk device XML class.
* Re-worked result checking logic to be easier to read

jferlan added cevich's change plus the suggested disk.xmltreefile.write()
call from code review

Signed-off-by: John Ferlan <jferlan@redhat.com>
update_device: Fixes to get things to work

Adjust prior set of changes to make things work.

1. Add a cdrom device to guest
   Not sure if somewhere along the way when the code was first developed
   if the cdrom was part of the guest or not or if some previous test just
   happened to leave one around... In any case, the current code doesn't
   have one for the guest - so I added code to add one

2. Adjust create_attach_xml
   Rather than rely on hardcoded device and bus, pass it along.  Some one
   in the future can do the work to make them more configurable to have
   virtio instead of ide, but for now go with the ide bus & hde device

3. Adjust is_attached
   Pass the device name and fix the indention on the return True; otherwise,
   it was never hit.

4. libvirt_library_version
   Remove the code from here - I actually moved this version of how to parse
   the 'virsh version' output into the provider code (see PR #82). Thus this
   code also makes use of that new code.

5. Moved the state/setup closer to where it's used

6. Modified the flag_list setup code - I found that doing a flag.split("--")
   of an empty flag list (eg. "".split("--")) returned [''] instead of [],
   so I adjusted the logic slightly to account for that.

7. Create the cdrom device in order for it to be updated.  Initial device
   will be "orig.iso" and it'll be changed to "test.iso" or "test_diff.iso".

8. Fix the "diff_iso" logic - it's a boolean not a value

9. Fix the 'inactive_attached' logic to look at the inactive_device

Signed-off-by: John Ferlan <jferlan@redhat.com>
Merge pull request #109 from jferlan/update_device

update_device: Revisit old changes and fix