Thanks for the review.
I think comparing the value of persistent/autostart/active outputted by virsh net-info and ones by virsh net-list is superfluous. They are calling the same libvirt functions to get the values.
Checking return value is enough for virsh net-info