]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: new net-update command
authorLaine Stump <laine@laine.org>
Wed, 19 Sep 2012 11:38:43 +0000 (07:38 -0400)
committerLaine Stump <laine@laine.org>
Fri, 21 Sep 2012 02:20:22 +0000 (22:20 -0400)
commitfe7872827f0451fcc8f6618269f5ed13a2feeb67
treeef96f88d616360bc9402ced125525d33976b0c84
parentcd4f01ea860949ded97f1347a190e05a029f48ba
virsh: new net-update command

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).
tools/virsh-network.c
tools/virsh.pod