Okay I see you are doing low-level call to <code>virsh.net_autostart</code> because net_ref might not match any state encoded in a <code>NetworkXML</code> instance.

Optional Suggestion: It might be good to make a comment reminding readers of this.  I have come back to code 1+ year later and kick myself sometime for not making a comment, I have to figure out "why" all over again :S  Easier to just make comment, they are free :)