<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 09/26/2013 12:41 AM, Mihamina
      Rakotomandimby wrote:<br>
    </div>
    <blockquote cite="mid:5243BB13.4030000@rktmb.org" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      Hi all,<br>
      <br>
      Running Fedora 18 and the bundled libvirt and virt-tools. Desktop
      use.<br>
      <br>
      As I like to access my guests with a hostname and not a numerical
      IP address, I fix the IP addressing in the network configuration:
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
        href="http://pastebin.com/rfMKn40j">http://pastebin.com/rfMKn40j</a><br>
      <br>
      Unfortunately, I cant find a way to add a host without loosing the
      whole networking, as when I add a ahost, I destroy and redefine
      the network.<br>
      <br>
      Restarting libvirtd is not the solution.<br>
      <br>
      <br>
      How would you recommend to have networking UP after network
      redefinition?<br>
    </blockquote>
    <br>
    <br>
    When you modify the definition of a network with "virsh net-edit",
    you must net-destroy then net-start the network for those changes to
    take effect. This has the unfortunate effect of destroying the
    network's bridge device, and when it is re-created the guests' tap
    devices aren't reattached to the new bridge.<br>
    <br>
    Rather than adding the new static dhcp host entries with "virsh
    net-edit", you can add them with "virsh net-update", and the changes
    will take effect immediately without restarting the network or
    disconnecting the guests.<br>
    <br>
    Here is an example of adding a static dhcp host entry to the
    "default" network using virsh net-update:<br>
    <br>
       virsh net-update --config --live default add ip-dhcp-host \<br>
             "<host mac='52:54:00:01:02:03' name='xyz.example.com'
    ip='192.168.122.25'/>"<br>
    <br>
    (the --config option tells virsh to make the change permanent in the
    network's config (otherwise it would only remain in place until the
    network was taken down, and be gone the next time it was started),
    and "--live" tells it to make the change take effect immediately on
    the running network.)<br>
    <br>
    virsh net-update was introduced in libvirt-0.10.2, so you must be
    running at least that version to use it.<br>
    <br>
    <br>
  </body>
</html>