1. 23 4月, 2012 1 次提交
    • E
      blockjob: enhance xml to track mirrors across libvirtd restart · ae6aa8c3
      Eric Blake 提交于
      In order to track a block copy job across libvirtd restarts, we
      need to save internal XML that tracks the name of the file
      holding the mirror.  Displaying this name in dumpxml might also
      be useful to the user, even if we don't yet have a way to (re-)
      start a domain with mirroring enabled up front.  This is done
      with a new <mirror> sub-element to <disk>, as in:
      
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/original.img'/>
            <mirror file='/var/lib/libvirt/images/copy.img' format='qcow2' ready='yes'/>
            ...
          </disk>
      
      For now, the element is output-only, in live domains; it is ignored
      when defining a domain or hot-plugging a disk (since those contexts
      use VIR_DOMAIN_XML_INACTIVE in parsing).  The 'ready' attribute appears
      when libvirt knows that the job has changed from the initial pulling
      phase over to the mirroring phase, although absence of the attribute
      is not a sure indicator of the current phase.  If we come up with a way
      to make qemu start with mirroring enabled, we can relax the xml
      restriction, and allow <mirror> (but not attribute 'ready') on input.
      Testing active-only XML meant tweaking the testsuite slightly, but it
      was worth it.
      
      * docs/schemas/domaincommon.rng (diskspec): Add diskMirror.
      * docs/formatdomain.html.in (elementsDisks): Document it.
      * src/conf/domain_conf.h (_virDomainDiskDef): New members.
      * src/conf/domain_conf.c (virDomainDiskDefFree): Clean them.
      (virDomainDiskDefParseXML): Parse them, but only internally.
      (virDomainDiskDefFormat): Output them.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: New test file.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror.xml: Likewise.
      * tests/qemuxml2xmltest.c (testInfo): Alter members.
      (testCompareXMLToXMLHelper): Allow more test control.
      (mymain): Run new test.
      ae6aa8c3
  2. 18 4月, 2012 1 次提交
    • O
      docs: Improve the schema for fs device · 7adeac67
      Osier Yang 提交于
      <filesystemtgt> is redundant, as every group uses it; <address>
      shouldn't be in <filesystemtgt> in case of the meaning could be
      "filesystemtarget"; The elements <address>, <alias>, <target>,
      ... should be interleaved.
      7adeac67
  3. 17 4月, 2012 2 次提交
  4. 16 4月, 2012 2 次提交
  5. 13 4月, 2012 1 次提交
  6. 04 4月, 2012 1 次提交
    • D
      Fix parallel build in docs/ directory · 4f4b496e
      Daniel P. Berrange 提交于
      Every now & then, with parallel builds, we get a failure to
      validate hvsupport.html.in.  I eventually noticed that this
      is because we get 2 instances of the generator running at
      once.
      
      We already list hvsupport.html.in in BUILT_SOURCES but this
      was not working. It turns out the flaw is that we were
      adding deps to the 'all:' target instead of the 'all-am:'
      target. BUILT_SOURCES is a dep of 'all', so any custom
      targets written in Makefile.am must use 'all-am:' so that
      they don't get run until BUILT_SOURCES are completely
      generated
      
      * docs/Makefile.am: s/all/all-am/
      4f4b496e
  7. 03 4月, 2012 4 次提交
  8. 02 4月, 2012 1 次提交
    • P
      Support clock=variable relative to localtime · b8bf79aa
      Philipp Hahn 提交于
      Since Xen 3.1 the clock=variable semantic is supported. In addition to
      qemu/kvm Xen also knows about a variant where the offset is relative to
      'localtime' instead of 'utc'.
      
      Extends the libvirt structure with a flag 'basis' to specify, if the
      offset is relative to 'localtime' or 'utc'.
      
      Extends the libvirt structure with a flag 'reset' to force the reset
      behaviour of 'localtime' and 'utc'; this is needed for backward
      compatibility with previous versions of libvirt, since they report
      incorrect XML.
      
      Adapt the only user 'qemu' to the new name.
      Extend the RelaxNG schema accordingly.
      Document the new 'basis' attribute in the HTML documentation.
      Adapt test for the new attribute.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      b8bf79aa
  9. 31 3月, 2012 1 次提交
    • D
      Refactor the libvirt RPM daemon pieces · 06a0d57f
      Daniel P. Berrange 提交于
      There are a number of flaws with our packaging of the libvirtd
      daemon:
      
       - Installing 'libvirt' does not install 'qemu-kvm' or 'xen'
         etc which are required to actually run the hypervisor in
         question
       - Installing 'libvirt' pulls in the default configuration
         files which may not be wanted & cause problems if installed
         inside a guest
       - It is not possible to explicitly required all the peices
         required to manage a specific hypervisor
      
      This change takes the 'libvirt' RPM and and changes it thus
      
       - libvirt: just a virtual package with dep on libvirt-daemon,
         libvirt-daemon-config-network & libvirt-daemon-config-nwfilter
       - libvirt-daemon: the libvirt daemon and related pieces
       - libvirt-daemon-config-network: the default network config
       - libvirt-daemon-config-nwfilter: the network filter configs
       - libvirt-docs: the website HTML
      
      We then introduce some more virtual (empty) packages
      
       - libvirt-daemon-qemu: Deps on libvirt-daemon & 'qemu'
       - libvirt-daemon-kvm: Deps on libvirt-daemon & 'qemu-kvm'
       - libvirt-daemon-lxc: Deps on libvirt-daemon
       - libvirt-daemon-uml: Deps on libvirt-daemon
       - libvirt-daemon-xen: Deps on libvirt-daemon & 'xen'
      
       - libvirt-qemu: Deps on libvirt-daemon-qemu & libvirt-daemon-config-{network,nwfilter}
       - libvirt-kvm: Deps on libvirt-daemon-kvm & libvirt-daemon-config-{network,nwfilter}
       - libvirt-lxc: Deps on libvirt-daemon-lxc & libvirt-daemon-config-{network,nwfilter}
       - libvirt-uml: Deps on libvirt-daemon-uml & libvirt-daemon-config-{network,nwfilter}
       - libvirt-xen: Deps on libvirt-daemon-xen & libvirt-daemon-config-network
      
      My intent in the future is to turn on the driver modules by
      default, at which time 'libvirt-daemon' will cease to include
      any specific drivers, instead we'll get libvirt-daemon-driver-XXXX
      packages for each driver. The libvirt-daemon-XXX packages will
      then pull in each driver that they require.
      
      It is recommended that applications required a locally installed
      libvirtd daemon, use either 'Requires: libvirt-daemon-XXXX' or
      'Requires: libvirt-XXX' and *not* "Requires: libvirt-daemon"
      or 'Requires: libvirt'
      
      * libvirt.spec.in: Refactor RPMs
      * docs/packaging.html.in, docs/sitemap.html.in: Document
        new RPM split rationale
      06a0d57f
  10. 27 3月, 2012 4 次提交
    • S
      Change the default of mdns_adv to false · 53e1d56d
      Stef Walter 提交于
       * Don't advertise information on the network without consent of
         the user, either through manual configuration, or a user
         interface that drives this option.
       * Since libvirtd must be configured for network access anyway
         (for all but ssh), this setting was not useful "out of the box",
         so changing this default setting does not remove "out of the box"
         functionality.
      53e1d56d
    • D
      Add LXC XML files to schema test & fix problems this uncovers · 72c50731
      Daniel P. Berrange 提交于
      * docs/schemas/domaincommon.rng: Add missing lxc & openvz
        console target types. Allow arch on LXC <os> type element
      * tests/domainschematest: Include tests/lxcxml2xmldata/
      72c50731
    • 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
    • D
      Expand docs for timer tick policy · 05e981df
      Daniel P. Berrange 提交于
      05e981df
  11. 23 3月, 2012 3 次提交
  12. 20 3月, 2012 2 次提交
    • M
      Minor docs fix · e22789de
      Martin Kletzander 提交于
      End tag for "host" element was missing in example configuration
      e22789de
    • L
      conf: forbid use of multicast mac addresses · 00072373
      Laine Stump 提交于
      A few times libvirt users manually setting mac addresses have
      complained of a networking failure that ends up being due to a multicast
      mac address being used for a guest interface. This patch prevents that
      by logging an error and failing if a multicast mac address is
      encountered in each of the three following cases:
      
      1) domain xml <interface> mac address.
      2) network xml bridge mac address.
      3) network xml dhcp/host mac address.
      
      There are several other places where a mac address can be input that
      aren't controlled in this manner because failure to do so has no
      consequences (e.g., if the address will be used to search through
      existing interfaces for a match).
      
      The RNG has been updated to add multiMacAddr and uniMacAddr along with
      the existing macAddr, and macAddr was switched to uniMacAddr where
      appropriate.
      00072373
  13. 16 3月, 2012 1 次提交
    • D
      Add support for forcing a private network namespace for LXC guests · 10a8b1f9
      Daniel P. Berrange 提交于
      If no <interface> elements are included in an LXC guest XML
      description, then the LXC guest will just see the host's
      network interfaces. It is desirable to be able to hide the
      host interfaces, without having to define any guest interfaces.
      
      This patch introduces a new feature flag <privnet/> to allow
      forcing of a private network namespace for LXC. In the future
      I also anticipate that we will add <privuser/> to force a
      private user ID namespace.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Add support
        for <privnet/> feature. Auto-set <privnet> if any <interface>
        devices are defined
      * src/lxc/lxc_container.c: Honour request for private network
        namespace
      10a8b1f9
  14. 15 3月, 2012 2 次提交
    • D
      Allow overriding default URI in config file · e457d5ef
      Daniel P. Berrange 提交于
      Currently if the URI passed to virConnectOpen* is NULL, then we
      
       - Look for LIBVIRT_DEFAULT_URI env var
       - Probe for drivers
      
      This changes it so that
      
       - Look for LIBVIRT_DEFAULT_URI env var
       - Look for 'uri_default' in $HOME/.libvirt/libvirt.conf
       - Probe for drivers
      e457d5ef
    • O
      qemu: Support numad · 0f8e7ae3
      Osier Yang 提交于
      numad is an user-level daemon that monitors NUMA topology and
      processes resource consumption to facilitate good NUMA resource
      alignment of applications/virtual machines to improve performance
      and minimize cost of remote memory latencies. It provides a
      pre-placement advisory interface, so significant processes can
      be pre-bound to nodes with sufficient available resources.
      
      More details: http://fedoraproject.org/wiki/Features/numad
      
      "numad -w ncpus:memory_amount" is the advisory interface numad
      provides currently.
      
      This patch add the support by introducing a new XML attribute
      for <vcpu>. e.g.
      
        <vcpu placement="auto">4</vcpu>
        <vcpu placement="static" cpuset="1-10^6">4</vcpu>
      
      The returned advisory nodeset from numad will be printed
      in domain's dumped XML. e.g.
        <vcpu placement="auto" cpuset="1-10^6">4</vcpu>
      
      If placement is "auto", the number of vcpus and the current
      memory amount specified in domain XML will be used for numad
      command line (numad uses MB for memory amount):
        numad -w $num_of_vcpus:$current_memory_amount / 1024
      
      The advisory nodeset returned from numad will be used to set
      domain process CPU affinity then. (e.g. qemuProcessInitCpuAffinity).
      
      If the user specifies both CPU affinity policy (e.g.
      (<vcpu cpuset="1-10,^7,^8">4</vcpu>) and placement == "auto"
      the specified CPU affinity will be overridden.
      
      Only QEMU/KVM drivers support it now.
      
      See docs update in patch for more details.
      0f8e7ae3
  15. 13 3月, 2012 1 次提交
  16. 12 3月, 2012 1 次提交
    • E
      qemu: support disk filenames with comma · 6e0ff1d4
      Eric Blake 提交于
      If there is a disk file with a comma in the name, QEmu expects a double
      comma instead of a single one (e.g., the file "virtual,disk.img" needs
      to be specified as "virtual,,disk.img" in QEmu's command line). This
      patch fixes libvirt to work with that feature. Fix RHBZ #801036.
      
      Based on an initial patch by Crístian Viana.
      
      * src/util/buf.h (virBufferEscape): Alter signature.
      * src/util/buf.c (virBufferEscape): Add parameter.
      (virBufferEscapeSexpr): Fix caller.
      * src/qemu/qemu_command.c (qemuBuildRBDString): Likewise.  Also
      escape commas in file names.
      (qemuBuildDriveStr): Escape commas in file names.
      * docs/schemas/basictypes.rng (absFilePath): Relax RNG to allow
      commas in input file names.
      * tests/qemuxml2argvdata/*-disk-drive-network-sheepdog.*: Update
      test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6e0ff1d4
  17. 09 3月, 2012 1 次提交
  18. 08 3月, 2012 7 次提交
    • P
      xml: Clean up schemas to use shared data types instead of local · cdab483e
      Peter Krempa 提交于
      The schema files contained duplicate data types that can be shared from
      the basictypes.rng file.
      cdab483e
    • E
      xml: allow scaled memory on input · 2e22f23b
      Eric Blake 提交于
      Output is still in kibibytes, but input can now be in different
      scales for ease of typing.
      
      * src/conf/domain_conf.c (virDomainParseMemory): New helper.
      (virDomainDefParseXML): Use it when parsing.
      * docs/schemas/domaincommon.rng: Expand XML; rename memoryKBElement
      to memoryElement and update callers.
      * docs/formatdomain.html.in (elementsMemoryAllocation): Document
      scaling.
      * tests/qemuxml2argvdata/qemuxml2argv-memtune.xml: Adjust test.
      * tests/qemuxml2xmltest.c: Likewise.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml: New file.
      2e22f23b
    • E
      xml: drop unenforced minimum memory limit from RNG · 1b1402b9
      Eric Blake 提交于
      The test domain allows <memory>0</memory>, but the RNG was stating
      that memory had to be at least 4096000 bytes.  Hypervisors should
      enforce their own limits, rather than complicating the RNG.
      
      Meanwhile, some copy and paste had introduced some fishy constructs
      in various unit tests.
      
      * docs/schemas/domaincommon.rng (memoryKB, memoryKBElement): Drop
      limit that isn't enforced in code.
      * src/conf/domain_conf.c (virDomainDefParseXML): Require current
      <= maximum.
      * tests/qemuxml2argvdata/*.xml: Fix offenders.
      1b1402b9
    • E
      storage: support more scaling suffixes · 2e148612
      Eric Blake 提交于
      Disk manufacturers are fond of quoting sizes in powers of 10,
      rather than powers of 2 (after all, 2.1 GB sounds larger than
      2.0 GiB, even though the exact opposite is true).  So, we might
      as well follow coreutils' lead in supporting three types of
      suffix: single letter ${u} (which we already had) and ${u}iB
      for the power of 2, and ${u}B for power of 10.
      
      Additionally, it is impossible to create a file with more than
      2**63 bytes, since off_t is signed (if you have enough storage
      to even create one 8EiB file, I'm jealous).  This now reports
      failure up front rather than down the road when the kernel
      finally refuses an impossible size.
      
      * docs/schemas/basictypes.rng (unit): Add suffixes.
      * src/conf/storage_conf.c (virStorageSize): Use new function.
      * docs/formatstorage.html.in: Document it.
      * tests/storagevolxml2xmlin/vol-file-backing.xml: Test it.
      * tests/storagevolxml2xmlin/vol-file.xml: Likewise.
      2e148612
    • E
      xml: output memory unit for clarity · 26545784
      Eric Blake 提交于
      Make it obvious to 'dumpxml' readers what unit we are using,
      since our default of KiB for memory (1024) differs from qemu's
      default of MiB; and differs from our use of bytes for storage.
      
      Tests were updated via:
      
      $ find tests/*data tests/*out -name '*.xml' | \
        xargs sed -i 's/<\(memory\|currentMemory\|hard_limit\|soft_limit\|min_guarantee\|swap_hard_limit\)>/<\1 unit='"'KiB'>/"
      $ find tests/*data tests/*out -name '*.xml' | \
        xargs sed -i 's/<\(capacity\|allocation\|available\)>/<\1 unit='"'bytes'>/"
      
      followed by a few fixes for the stragglers.
      
      Note that with this patch, the RNG for <memory> still forbids
      validation of anything except unit='KiB', since the code silently
      ignores the attribute; a later patch will expand <memory> to allow
      scaled input in the code and update the RNG to match.
      
      * docs/schemas/basictypes.rng (unit): Add 'bytes'.
      (scaledInteger): New define.
      * docs/schemas/storagevol.rng (sizing): Use it.
      * docs/schemas/storagepool.rng (sizing): Likewise.
      * docs/schemas/domaincommon.rng (memoryKBElement): New define; use
      for memory elements.
      * src/conf/storage_conf.c (virStoragePoolDefFormat)
      (virStorageVolDefFormat): Likewise.
      * src/conf/domain_conf.h (_virDomainDef): Document unit used
      internally.
      * src/conf/storage_conf.h (_virStoragePoolDef, _virStorageVolDef):
      Likewise.
      * tests/*data/*.xml: Update all tests.
      * tests/*out/*.xml: Likewise.
      * tests/define-dev-segfault: Likewise.
      * tests/openvzutilstest.c (testReadNetworkConf): Likewise.
      * tests/qemuargv2xmltest.c (blankProblemElements): Likewise.
      26545784
    • E
      xml: share 'unit' in RNG · cb7583e1
      Eric Blake 提交于
      The code supported unit='E' for "exabyte", but the RNG did not;
      conversely, the RNG supported "z" and "y" but the code did not
      (I'm jealous if you have that much storage, particularly since
      it won't fit in 64-bit off_t).  Also, the code supported
      <allocation unit='...'>, but not the RNG.
      
      In an effort to make 'unit' more worthwhile in future patches,
      it's easier to share it between files.
      
      In making this factorization, note that absFilePath is more
      permissive than 'path', so storage pools and storage volumes
      will now validate with a wider set of file names than before.
      I don't think this should be a problem in practice.
      
      * docs/schemas/storagepool.rng: Include basic types, rather than
      repeating things here.
      * docs/schemas/storagevol.rng: Likewise.
      * docs/schemas/basictypes.rng: Add 'unsignedLong', 'unit', and fix
      to match storage code.
      cb7583e1
    • E
      docs: use correct terminology for 1024 bytes · 9dfdeadc
      Eric Blake 提交于
      Yes, I like kilobytes better than kibibytes (when I say kilobytes,
      I generally mean 1024).  But since the term is ambiguous, it can't
      hurt to say what we mean, by using both the correct name and
      calling out the numeric equivalent.
      
      * src/libvirt.c (virDomainGetMaxMemory, virDomainSetMaxMemory)
      (virDomainSetMemory, virDomainSetMemoryFlags)
      (virNodeGetFreeMemory): Tweak wording.
      * docs/formatdomain.html.in: Likewise.
      * docs/formatstorage.html.in: Likewise.
      9dfdeadc
  19. 07 3月, 2012 1 次提交
    • O
      docs: Fix typo · b340994b
      Osier Yang 提交于
      It used "&lt" for ">", reported by Kyla Zhang <weizhan@redhat.com>
      b340994b
  20. 06 3月, 2012 1 次提交
    • L
      conf: parse/format type='hostdev' network interfaces · 3b1c191f
      Laine Stump 提交于
      This is the new interface type that sets up an SR-IOV PCI network
      device to be assigned to the guest with PCI passthrough after
      initializing some network device-specific things from the config
      (e.g. MAC address, virtualport profile parameters). Here is an example
      of the syntax:
      
        <interface type='hostdev' managed='yes'>
          <source>
            <address type='pci' domain='0' bus='0' slot='4' function='3'/>
          </source>
          <mac address='00:11:22:33:44:55'/>
          <address type='pci' domain='0' bus='0' slot='7' function='0'/>
        </interface>
      
      This would assign the PCI card from bus 0 slot 4 function 3 on the
      host, to bus 0 slot 7 function 0 on the guest, but would first set the
      MAC address of the card to 00:11:22:33:44:55.
      
      NB: The parser and formatter don't care if the PCI card being
      specified is a standard single function network adapter, or a virtual
      function (VF) of an SR-IOV capable network adapter, but the upcoming
      code that implements the back end of this config will work *only* with
      SR-IOV VFs. This is because modifying the mac address of a standard
      network adapter prior to assigning it to a guest is pointless - part
      of the device reset that occurs during that process will reset the MAC
      address to the value programmed into the card's firmware.
      
      Although it's not supported by any of libvirt's hypervisor drivers,
      usb network hostdevs are also supported in the parser and formatter
      for completeness and consistency. <source> syntax is identical to that
      for plain <hostdev> devices, except that the <address> element should
      have "type='usb'" added if bus/device are specified:
      
        <interface type='hostdev'>
          <source>
            <address type='usb' bus='0' device='4'/>
          </source>
          <mac address='00:11:22:33:44:55'/>
        </interface>
      
      If the vendor/product form of usb specification is used, type='usb'
      is implied:
      
        <interface type='hostdev'>
          <source>
            <vendor id='0x0012'/>
            <product id='0x24dd'/>
          </source>
          <mac address='00:11:22:33:44:55'/>
        </interface>
      
      Again, the upcoming patch to fill in the backend of this functionality
      will log an error and fail with "Unsupported Config" if you actually
      try to assign a USB network adapter to a guest using <interface
      type='hostdev'> - just use a standard <hostdev> entry in that case
      (and also for single-port PCI adapters).
      3b1c191f
  21. 01 3月, 2012 1 次提交
  22. 29 2月, 2012 1 次提交