1. 11 7月, 2017 2 次提交
  2. 04 4月, 2017 1 次提交
  3. 02 7月, 2016 1 次提交
    • L
      conf: support host-side IP/route information in <interface> · 98fa8f3e
      Laine Stump 提交于
      This is place as a sub-element of <source>, where other aspects of the
      host-side connection to the network device are located (network or
      bridge name, udp listen port, etc). It's a bit odd that the interface
      we're configuring with this info is itself named in <target dev='x'/>,
      but that ship sailed long ago:
      
          <interface type='ethernet'>
            <mac address='00:16:3e:0f:ef:8a'/>
            <source>
              <ip address='192.168.122.12' family='ipv4'
                  prefix='24' peer='192.168.122.1'/>
              <ip address='192.168.122.13' family='ipv4' prefix='24'/>
              <route family='ipv4' address='0.0.0.0'
                     gateway='192.168.122.1'/>
              <route family='ipv4' address='192.168.124.0' prefix='24'
                     gateway='192.168.124.1'/>
            </source>
          </interface>
      
      In practice, this will likely only be useful for type='ethernet', so
      its presence in any other type of interface is currently forbidden in
      the generic device Validate function (but it's been put into the
      general population of virDomainNetDef rather than the
      ethernet-specific union member so that 1) we can more easily add the
      capability to other types if needed, and 2) we can retain the info
      when set to an invalid interface type all the way through to
      validation and report a proper error, rather than just ignoring it
      (which is currently what happens for many other type-specific
      settings).
      
      (NB: The already-existing configuration of IP info for the guest-side
      of interfaces is in subelements directly under <interface>, and the
      name of the guest-side interface (when configurable) is in <guest
      dev='x'/>).
      
      (This patch had been pushed earlier in
      commit fe6a7789, but was reverted in
      commit d6584565 because it had been
      accidentally pushed during the freeze for release 2.0.0)
      98fa8f3e
  4. 27 6月, 2016 2 次提交
    • J
      Revert "conf: support host-side IP/route information in <interface>" · d6584565
      Ján Tomko 提交于
      This reverts commit fe6a7789.
      
      This feature was accidentally pushed in the feature freeze.
      d6584565
    • L
      conf: support host-side IP/route information in <interface> · fe6a7789
      Laine Stump 提交于
      This is place as a sub-element of <source>, where other aspects of the
      host-side connection to the network device are located (network or
      bridge name, udp listen port, etc). It's a bit odd that the interface
      we're configuring with this info is itself named in <target dev='x'/>,
      but that ship sailed long ago:
      
          <interface type='ethernet'>
            <mac address='00:16:3e:0f:ef:8a'/>
            <source>
              <ip address='192.168.122.12' family='ipv4'
                  prefix='24' peer='192.168.122.1'/>
              <ip address='192.168.122.13' family='ipv4' prefix='24'/>
              <route family='ipv4' address='0.0.0.0'
                     gateway='192.168.122.1'/>
              <route family='ipv4' address='192.168.124.0' prefix='24'
                     gateway='192.168.124.1'/>
            </source>
          </interface>
      
      In practice, this will likely only be useful for type='ethernet', so
      its presence in any other type of interface is currently forbidden in
      the generic device Validate function (but it's been put into the
      general population of virDomainNetDef rather than the
      ethernet-specific union member so that 1) we can more easily add the
      capability to other types, and 2) we can retain the info when set to
      an invalid interface type all the way through to validation and report
      a proper error, rather than just ignoring it (which is currently what
      happens for many other type-specific settings).
      
      (NB: The already-existing configuration of IP info for the guest-side
      of interfaces is in subelements directly under <interface>, and the
      name of the guest-side interface (when configurable) is in <guest
      dev='x'/>).
      fe6a7789
  5. 08 6月, 2016 1 次提交
  6. 25 5月, 2016 1 次提交
    • L
      lxc: support <interface type='ethernet'> · 002b7704
      Laine Stump 提交于
      This is identical to type='bridge', but without the "connect to a
      bridge" part, so it can be handled by using the same functions (and
      often even the same cases in switch statements), after renaming
      virLXCProcessSetupInterfaceBridged() to virLXCProcessInterfaceTap()
      and enhancing it to skip bridge-related items when brname == NULL.
      
      To be truly useful, we need to support setting the ip address on the
      host side veth as well as guest side veth (already supported for
      type='bridge'), as well as setting the peer address for both.
      
      The <script> element (supported by type='ethernet' in qemu) isn't
      supported in this patch. An error is logged at domain start time if it
      is encountered. This may be changed in a later patch.
      002b7704
  7. 15 4月, 2016 1 次提交
  8. 26 2月, 2016 2 次提交
  9. 10 2月, 2016 1 次提交
  10. 09 1月, 2016 1 次提交
  11. 26 8月, 2015 1 次提交
    • I
      lxc: Inherit namespace feature · c27553b6
      ik.nitk 提交于
      This patch adds feature for lxc containers to inherit namespaces.
      This is very similar to what lxc-tools or docker provides.  Look
      for "man lxc-start" and you will find that you can pass command
      args as [ --share-[net|ipc|uts] name|pid ]. Or check out docker
      networking option in which you can give --net=container:NAME_or_ID
      as an option for sharing +namespace.
      
      >From this patch you can add extra libvirt option to share
      namespace in following way.
      
       <lxc:namespace>
         <lxc:sharenet type='netns' value='red'/>
         <lxc:shareipc type='pid' value='12345'/>
         <lxc:shareuts type='name' value='container1'/>
       </lxc:namespace>
      
      The netns option is specific to sharenet. It can be used to
      inherit from existing network namespace.
      
      Co-authored: Daniel P. Berrange <berrange@redhat.com>
      c27553b6
  12. 24 4月, 2015 2 次提交
  13. 21 4月, 2015 1 次提交
    • C
      domain: conf: Drop expectedVirtTypes · 835cf84b
      Cole Robinson 提交于
      This needs to specified in way too many places for a simple validation
      check. The ostype/arch/virttype validation checks later in
      DomainDefParseXML should catch most of the cases that this was covering.
      835cf84b
  14. 14 1月, 2015 1 次提交
    • D
      Give virDomainDef parser & formatter their own flags · 0ecd6851
      Daniel P. Berrange 提交于
      The virDomainDefParse* and virDomainDefFormat* methods both
      accept the VIR_DOMAIN_XML_* flags defined in the public API,
      along with a set of other VIR_DOMAIN_XML_INTERNAL_* flags
      defined in domain_conf.c.
      
      This is seriously confusing & error prone for a number of
      reasons:
      
       - VIR_DOMAIN_XML_SECURE, VIR_DOMAIN_XML_MIGRATABLE and
         VIR_DOMAIN_XML_UPDATE_CPU are only relevant for the
         formatting operation
       - Some of the VIR_DOMAIN_XML_INTERNAL_* flags only apply
         to parse or to format, but not both.
      
      This patch cleanly separates out the flags. There are two
      distint VIR_DOMAIN_DEF_PARSE_* and VIR_DOMAIN_DEF_FORMAT_*
      flags that are used by the corresponding methods. The
      VIR_DOMAIN_XML_* flags received via public API calls must
      be converted to the VIR_DOMAIN_DEF_FORMAT_* flags where
      needed.
      
      The various calls to virDomainDefParse which hardcoded the
      use of the VIR_DOMAIN_XML_INACTIVE flag change to use the
      VIR_DOMAIN_DEF_PARSE_INACTIVE flag.
      0ecd6851
  15. 30 7月, 2014 1 次提交
  16. 25 3月, 2014 1 次提交
  17. 18 3月, 2014 1 次提交
  18. 11 1月, 2014 2 次提交
    • D
      Exercise the ABI stability check code in test suite · 53a699a0
      Daniel P. Berrange 提交于
      Any test suite which involves a virDomainDefPtr should
      call virDomainDefCheckABIStability with itself just as
      a basic sanity check that the identity-comparison always
      succeeds. This would have caught the recent NULL pointer
      access crash.
      
      Make sure we cope with def->name being NULL since the
      VMWare config parser produces NULL names.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      53a699a0
    • E
      schema: fix idmap validation · dd0dda2e
      Eric Blake 提交于
      When idmap was added to LXC, we forgot to cover it in the testsuite.
      The schema was missing an <element> layer, and as a result,
      virt-xml-validate was failing on valid dumpxml output.
      
      Reported by Eduard - Gabriel Munteanu on IRC.
      
      * docs/schemas/domaincommon.rng (idmap): Include <idmap> element,
      and support interleaves.
      * tests/lxcxml2xmldata/lxc-idmap.xml: New file.
      * tests/lxcxml2xmltest.c (mymain): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      dd0dda2e
  19. 08 11月, 2013 1 次提交
  20. 09 10月, 2013 1 次提交
    • J
      LXC: Fix handling of RAM filesystem size units · 3f029fb5
      Ján Tomko 提交于
      Since 76b644c3 when the support for RAM filesystems was introduced,
      libvirt accepted the following XML:
      <source usage='1024' unit='KiB'/>
      
      This was parsed correctly and internally stored in bytes, but it
      was formatted as (with an extra 's'):
      <source usage='1024' units='KiB'/>
      When read again, this was treated as if the units were missing,
      meaning libvirt was unable to parse its own XML correctly.
      
      The usage attribute was documented as being in KiB, but it was not
      scaled if the unit was missing. Transient domains still worked,
      because this was balanced by an extra 'k' in the mount options.
      
      This patch:
      Changes the parser to use 'units' instead of 'unit', as the latter
      was never documented (fixing persistent domains) and some programs
      (libvirt-glib, libvirt-sandbox) already parse the 'units' attribute.
      
      Removes the extra 'k' from the tmpfs mount options, which is needed
      because now we parse our own XML correctly.
      
      Changes the default input unit to KiB to match documentation, fixing:
      https://bugzilla.redhat.com/show_bug.cgi?id=1015689
      3f029fb5
  21. 08 10月, 2013 1 次提交
  22. 26 9月, 2013 1 次提交
  23. 10 7月, 2013 1 次提交
    • M
      Introduce OOM reporting to virAsprintf · dc6f2dad
      Michal Privoznik 提交于
      Actually, I'm turning this function into a macro as filename,
      function name and line number needs to be passed. The new
      function virAsprintfInternal is introduced with the extended set
      of arguments.
      dc6f2dad
  24. 13 5月, 2013 1 次提交
    • D
      Add support for storage format in FS <driver> · ada14b86
      Daniel P. Berrange 提交于
      Extend the <driver> element in filesystem devices to
      allow a storage format to be set. The new attribute
      uses 'format' to reflect the storage format. This is
      different from the <driver> element in disk devices
      which use 'type' to reflect the storage format. This
      is because the 'type' attribute on filesystem devices
      is already used for the driver backend, for which the
      disk devices use the 'name' attribute. Arggggh.
      
      Anyway for disks we have
      
         <driver name="qemu" type="raw"/>
      
      And for filesystems this change means we now have
      
         <driver type="loop" format="raw"/>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ada14b86
  25. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  26. 17 4月, 2013 1 次提交
  27. 05 4月, 2013 2 次提交
  28. 13 3月, 2013 1 次提交
    • P
      virCaps: conf: start splitting out irrelevat data · 27cf98e2
      Peter Krempa 提交于
      The virCaps structure gathered a ton of irrelevant data over time that.
      The original reason is that it was propagated to the XML parser
      functions.
      
      This patch aims to create a new data structure virDomainXMLConf that
      will contain immutable data that are used by the XML parser. This will
      allow two things we need:
      
      1) Get rid of the stuff from virCaps
      
      2) Allow us to add callbacks to check and add driver specific stuff
      after domain XML is parsed.
      
      This first attempt removes pointers to private data allocation functions
      to this new structure and update all callers and function that require
      them.
      27cf98e2
  29. 08 2月, 2013 1 次提交
  30. 18 12月, 2012 1 次提交
    • D
      Add support for <hostdev mode="capabilities"> · aae0fc2a
      Daniel P. Berrange 提交于
      The <hostdev> device type has long had a redundant "mode"
      attribute, which has always been "subsys". This finally
      introduces a new mode "capabilities", which will be used
      by the LXC driver for device assignment. Since container
      based virtualization uses a single kernel, the idea of
      assigning physical PCI devices doesn't make sense. It is
      still reasonable to assign USB devices, but for assigning
      arbitrary nodes in /dev, the new 'capabilities' mode is
      to be used.
      
      The first capability support is 'storage', which is for
      assignment of block devices. Functionally this is really
      pretty similar to the <disk> support. The only difference
      is the device node name is identical in both host and
      container namespaces.
      
          <hostdev mode='capabilities' type='storage'>
            <source>
              <block>/dev/sdf1</block>
            </source>
          </hostdev>
      
      The second capability support is 'misc', which is for
      assignment of character devices. There is no existing
      parallel to this. Again the device node is the same
      inside & outside the container.
      
          <hostdev mode='capabilities' type='misc'>
            <source>
              <char>/dev/input/event3</char>
            </source>
          </hostdev>
      
      The reason for keeping the char & storage devices
      separate in the domain XML, is to mirror the split
      in the node device XML. NB the node device XML does
      not yet report character devices, but that's another
      new patch to come
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      aae0fc2a
  31. 30 3月, 2012 1 次提交
  32. 27 3月, 2012 1 次提交
    • D
      Add support for setting init argv for LXC · c91cff25
      Daniel P. Berrange 提交于
      Pass argv to the init binary of LXC, using a new <initarg> element.
      
      * docs/formatdomain.html.in: Document <os> usage for containers
      * docs/schemas/domaincommon.rng: Add <initarg> element
      * src/conf/domain_conf.c, src/conf/domain_conf.h: parsing and
        formatting of <initarg>
      * src/lxc/lxc_container.c: Setup LXC argv
      * tests/Makefile.am, tests/lxcxml2xmldata/lxc-systemd.xml,
        tests/lxcxml2xmltest.c, tests/testutilslxc.c,
        tests/testutilslxc.h: Test parsing/formatting of LXC related
        XML parts
      c91cff25