so by definition guest from different subnets cannot talk to each other directly unless they are connected via some router. That means you don't need any filter for that. If there is a router between the networks and it is needed for some cases then you could change the filter I have posted to use IP restriction instead of MAC one e.g [2]. Have not tested it myself but it should work fine. 
Hopefully this helps.
[1] 
<filter name='clean-traffic-ip-gateway'>
	<!-- An example of a traffic filter enforcing clean traffic
        	from a VM by
      		- preventing MAC spoofing -->
	<filterref filter='no-mac-spoofing'/>
  	
	<!-- preventing IP spoofing on outgoing -->
	<filterref filter='no-ip-spoofing'/>
	
	<!-- preventing ARP spoofing/poisoning -->
  	<filterref filter='no-arp-spoofing'/>
	
	<!-- accept all other incoming and outgoing ARP traffic -->
  	<rule action='accept' direction='inout' priority='-500'>
    		<mac protocolid='arp'/>
  	</rule>
	
	<!-- accept traffic only from specified MAC address -->
	<rule action='drop' direction='in'>
                <ip match='yes' srcipaddr='$GATEWAY_IP' 
		srcipmask='$GATEWAY_IP_MASK' />
        </rule>
	
	<!-- allow traffic only to specified MAC address -->
        <rule action='drop' direction='out'>
                <ip match='yes' dstipaddr='$GATEWAY_IP' 
		dstipmask='$GATEWAY_IP_MASK' />
        </rule>
	
	<!-- preventing any other traffic than between specified MACs 
	and ARP -->
  	<filterref filter='no-other-l2-traffic'/>
	<!-- allow qemu to send a self-announce upon migration end -->
	<filterref filter='qemu-announce-self'/>
</filter>