On 03/21/2013 10:05 PM, Chris Evich wrote:
On 03/21/2013 04:29 AM, Alex Jia wrote:
On 03/20/2013 11:33 PM, Chris Evich wrote:
On 03/20/2013 06:11 AM, Yu Mingfei wrote:
virsh_instance = virsh.VirshPersistent(**virsh_dargs)

IIRC, you can recycle this by calling virsh_instance.new_session()
here, but it's only very small nit-pick, what you have is fine. The
test looks good overall.

ToDo: IIRC, there's a way to reboot the host and have autotest resume
testing when it comes up. I'm almost 100% sure this doesn't work with
current virt-test code, but it would be nice to get it

As usual, we restart libvirtd service to emulate host reboot for this
kinds of testing, in addition, you had better to check whether
$network.xml exists under the /etc/libvirt/$hypervisor/networks/autostart/.

Yes, it's the "...also check XYZ" appendixes why I'm not 100% comfortable "simulating" reboots. Not only can we get false-PASS, but we can also get false-FAIL very easy. Remember, this must work across multiple distro's, the overall variability is probably larger that we realize.

IMHO, we need to be testing this with a host reboot also since this is what autostart is designed for. Otherwise, if we run into an issue with simulated reboot + autostart, engineering will be mad if it is not reproducible problem on real host reboot.


Yes, agree, testers should verify if the virtual network can be automatically started when the host machine boots, and the autotest supports the feature, we can continue to do the rest of testing after rebooting host.

For some internal test suite, it's not more powerful than autotest, so it's a optional solution to simulate host reboots for us, but from technical point of view, you may destroy the defined virtual network(with autostart enabled) then restart libvirtd service to check it, for this, we need to know what the happen is after running virsh net-autostart <domain> and rebooting host.

The following is common structure in libvirt source codes, as usual, when libvirt daemon starts it will register kinds of drivers such as virRegisterNetworkDriver then daemonSetupNetworking() and initialization function for the qemu daemon, so the networkStartup() will be called and the networkShutdown() will be called after stopping libvirtd service, I will list some important function call in here to explain why it should be feasible for destroying virtual network then restart libvirtd service to simulate reboot+autostart.

static virStateDriver networkStateDriver = {
    .name = "Network",
    .initialize  = networkStartup,
    .cleanup = networkShutdown,
    .reload = networkReload,
};

networkDestroy->networkShutdownNetwork
service libvirtd restart will call the networkStartup()->networkAutostartConfigs->networkStartNetwork

When we reboot host, the libvirtd service will be stopped firstly and relevant '.cleanup' registered function will be called, for above codes, the networkShutdown() will destroy virtual network and free allocated resource, the networkShutdownNetwork() is a similar function with the networkShutdown(), so we use the networkDestroy() to simulate this process. For host boots, it's the same process, the libvirtd service will be started then call the networkStartup(), which will load all of configuration such as virNetworkLoadAllConfigs(..,.., driverState->networkAutostartDir), in here, the networkAutostartDir is /etc/libvirt//qemu/networks/autostart, which is created by the networkSetAutostart(), which will call virFileMakePath(driver->networkAutostartDir) and symlink(configFile, autostartLink) firstly, so I suggest testers should check $network.xml under the directory, for save directory, it often is put some persistent configurations.

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to