autotest/virt-test — pull request #1210 by Hao-Liu (2013-12-09 16:00:04+00:00)
Title: virttest: Fix network xml sync with state unchanged

When using original sync of NetworkXML class to restore a backup
network, it is redefined and started, leaving autostart disabled.
This is not the default setting (all true for active/persistent/
autostart) for the network.

In this modification, we set the default behavior of sync to
set all state to true. With the help of an optional "state" dict
parameter, we can restore the network to any state you like, or
in practical, to the state we backed up.

To facilitate this backup & restore process, I also added a helper
function state_dict() to retrieve a active/persistent/autostart
dict for backing up current vm state.

The unittest for these network manipulators is given in a new file
instead of libvirt_xml_unittest.py to separate manipulator tests
from XML base test.

Signed-off-by: Hao Liu