• L
    virsh: new net-update command · fe787282
    Laine Stump 提交于
    This command uses the new virNetworkUpdate() API to modify an existing
    network definition, and optionally have those modifications take
    effect immediately without restarting the network.
    
    An example usage:
    
      virsh net-update mynet add-last ip-dhcp-host \
       "<host mac='00:11:22:33:44:55' ip='192.168.122.45'/>" \
       --live --config
    
    If you like, you can instead put the xml into a file, and call like
    this:
    
      virsh net-update mynet add ip-dhcp-host /tmp/myxml.xml
       --live --config
    
    virsh will autodetect whether the argument is itself an xml element,
    or if it's a file, by looking at the first character - the first
    character of an xml element is always "<", and the first character of
    a file is almost always *not* "<" (in the rare case that it is, the
    user could specify "./<filename...").
    
    A --parent-index option is also available (to give the index within a
    list of parent objects, e.g. the index of the parent <ip> element when
    updating ip-dhcp-host elements), but is optional and at least for now
    will probably be used rarely.
    
    --live, --config, and --current options - if you specify --live, only
    the live state of the network will be updated. If you also specify
    --config, then the persistent configuration will also be updated;
    these two commands can be given separately, or both together. If you
    don't specify either (you can optionally specify "--current" for the
    same effect), then the "current" config will be updated (i.e. if the
    network is active, then only its live config is affected, but if the
    network is inactive, only the persistent config is affected).
    fe787282
virsh.pod 123.1 KB