libvirt: Add unittests for virsh session manager

* test_del_VirshPersistent to make sure __del__ method works well.
* test_VirshSession to make sure VirshSession works well without virshPersistent.
* test_VirshPersistent to make sure COUNTERS in VirshPersistent works well.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
libvirt-virsh: cut off the reference from VirshClosure objects to virshpersistent.

In current code, VirshPersistent.__del__() will never be called in
`del virshPersistent_instance`
Because there are some other references to this object.
They are VirshClosure object. The VirshClosure.dict_like_instance is a
reference to VirshPersistent object. So, we can't use the del feature
of VirshPersistent at all.
So every test using VirshPersistent object will remain a virsh process
after exiting.

This patch fix this problem.
 * Change the dict_like_instance in VirshClosure from the reference of
Virsh object to another object named closure_args stored in VirshPersistent.
And we update the closure_args in setting slots of VirshPersistent to keep
the closure_args and VirshPersistent in-sync.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
libvirt-virsh: remove calling for undefined method in virshPersistent.__del__

Fix an error of exit. There is no method named exit in Virsh class,
So super().__exit__ in VirshPersistent will down.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
libvirt-virsh: Add autoclose param in VirshSession.__init__()

Add a param named auto_close into __init__ method of VirshSession. The default
value of this param is False, and it will not close the ShellSession when we derefer it.
So, I add this param to allow user pass a auto_close=True to use it more convinient.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
libvirt-virsh: update the using of VirshSession in VirshPersistent.

Introduce a class variable named COUNTERS in VirshPersistent. COUNTERS is a
dict whose key is a_id and value is counter. Two method counter_increase and
counter_decrease introduced in VirshPersistent at the same time. B/c VirshSession is
not auto closed, then we need to manage the VirshSession in VirshPersistent.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Merge pull request #609 from yangdongsheng/virshpersistent

libvirt: Virsh: session manager fixing.
qemu.tests: small bug fix in nmi_bsod_catch

Give a default value "" to reboot_after_config. Otherwise it will raise
an TypeError(argument of type 'NoneType' is not iterable) when it is None.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
shared.unattended: enable serial console in SUSE guest

update autoyast.xml to enable serial console in SUSE guest;

Signed-off-by: Xu Tian <xutian@redhat.com>