org.inria.myriads.snoozenode.groupmanager.virtualclusterparser.util
Class VirtualClusterParserUtils

java.lang.Object
  extended by org.inria.myriads.snoozenode.groupmanager.virtualclusterparser.util.VirtualClusterParserUtils

public final class VirtualClusterParserUtils
extends Object

Virtual cluster parser utilities.

Author:
Eugen Feller

Method Summary
static String getMacAddressFromLibVirtTemplate(String template)
          Gets the MAC of the libvirt template.
static List<String> getNetworkInterfacesFromXml(String xmlDescription)
          Returns a list of networks attached to a domain.
static String replaceMacAddressInLibVirtTemplate(String template, String newMacAddress)
          Replaces the MAC address inside libvirt template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

replaceMacAddressInLibVirtTemplate

public static String replaceMacAddressInLibVirtTemplate(String template,
                                                        String newMacAddress)
Replaces the MAC address inside libvirt template.

Parameters:
template - The template
newMacAddress - The new mac address
Returns:
Modified template string

getMacAddressFromLibVirtTemplate

public static String getMacAddressFromLibVirtTemplate(String template)
Gets the MAC of the libvirt template.

Parameters:
template - The template
Returns:
The mac address

getNetworkInterfacesFromXml

public static List<String> getNetworkInterfacesFromXml(String xmlDescription)
Returns a list of networks attached to a domain. Note: This implementation is fragile! Libvirt 0.9.4 is missing an API to get network interfaces attached to a domain! Hence, we need to dump and parse domain XML description! Open problem: The default network interface names (i.e., vnetX) could have been overridden by the users!

Parameters:
xmlDescription - The xml description
Returns:
The list of network interfaces


Copyright © 2012. All Rights Reserved.