1. 16 3月, 2015 12 次提交
  2. 14 3月, 2015 1 次提交
  3. 13 3月, 2015 1 次提交
    • J
      Introduce virBitmapIsBitSet · 22fd3ac3
      Ján Tomko 提交于
      A helper that never returns an error and treats bits out of bitmap range
      as false.
      
      Use it everywhere we use ignore_value on virBitmapGetBit, or loop over
      the bitmap size.
      22fd3ac3
  4. 12 3月, 2015 1 次提交
  5. 11 3月, 2015 2 次提交
    • M
      domain_conf: fix crash in virDomainObjListFindByUUIDInternal · 616003d6
      Michael Chapman 提交于
      If a domain object is being removed and looked up concurrently we must
      ensure we unlock the object before unreferencing it, since the latter
      might free the object.
      
      The flaw was introduced in commit feb1a4d7.
      Signed-off-by: NMichael Chapman <mike@very.puzzling.org>
      616003d6
    • M
      {domain, network}_conf: disable autostart when deleting config · a6ec4f47
      Michael Chapman 提交于
      Undefining a running, autostarted domain removes the autostart link, but
      dom->autostart is not cleared. If the domain is subsequently redefined,
      libvirt thinks it is already autostarted and will not create the link
      even if requested:
      
        # virsh dominfo example | grep Autostart
        Autostart:      enable
      
        # ls /etc/libvirt/qemu/autostart/example.xml
        /etc/libvirt/qemu/autostart/example.xml
      
        # virsh undefine example
        Domain example has been undefined
      
        # virsh define example.xml
        Domain example defined from example.xml
      
        # virsh dominfo example | grep Autostart
        Autostart:      enable
      
        # virsh autostart example
        Domain example marked as autostarted
      
        # ls /etc/libvirt/qemu/autostart/example.xml
        ls: cannot access /etc/libvirt/qemu/autostart/example.xml: No such file or directory
      
      This commit ensures dom->autostart is cleared whenever the config and
      autostart link (if present) are removed.
      
      The bridge network driver cleared this flag itself in networkUndefine.
      This commit moves this into virNetworkDeleteConfig for symmetry with
      virDomainDeleteConfig, and to ensure it is not missed in future network
      drivers.
      Signed-off-by: NMichael Chapman <mike@very.puzzling.org>
      a6ec4f47
  6. 06 3月, 2015 2 次提交
    • M
      domain_conf: Format <pvpanic/> without address correctly · b39b1397
      Michal Privoznik 提交于
      We have something like pvpanic device. However, in some cases it does
      not have any address assigned, in which case we produce this ugly XML
      (still valid though):
      
        <devices>
          <emulator>/usr/bin/qemu</emulator>
          ...
          <panic>
          </panic>
        </devices>
      
      Lets format "<panic/>" instead.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b39b1397
    • P
      memtune: change the way how we store unlimited value · cf521fc8
      Pavel Hrdina 提交于
      There was a mess in the way how we store unlimited value for memory
      limits and how we handled values provided by user.  Internally there
      were two possible ways how to store unlimited value: as 0 value or as
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED.  Because we chose to store memory
      limits as unsigned long long, we cannot use -1 to represent unlimited.
      It's much easier for us to say that everything greater than
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED means unlimited and leave 0 as valid
      value despite that it makes no sense to set limit to 0.
      
      Remove unnecessary function virCompareLimitUlong.  The update of test
      is to prevent the 0 to be miss-used as unlimited in future.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146539Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      cf521fc8
  7. 05 3月, 2015 1 次提交
  8. 03 3月, 2015 2 次提交
    • M
      conf: De-duplicate scheduling policy enums · 2fd5880b
      Martin Kletzander 提交于
      Since adding the support for scheduler policy settings in commit
      8680ea97, there are two enums with the same information.  That was
      caused by rewriting the patch since first draft.
      
      Find out thanks to clang, but there was no impact whatsoever.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      2fd5880b
    • J
      disk: Disallow duplicated target 'dev' values · e0e29055
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1142631
      
      This patch resolves a situation where the same "<target dev='$name'...>"
      can be used for multiple disks in the domain.
      
      While the $name is "mostly" advisory regarding the expected order that
      the disk is added to the domain and not guaranteed to map to the device
      name in the guest OS, it still should be unique enough such that other
      domblk* type operations can be performed.
      
      Without the patch, the domblklist will list the same Target twice:
      
      $ virsh domblklist $dom
      Target     Source
      ------------------------------------------------
      sda        /var/lib/libvirt/images/file.qcow2
      sda        /var/lib/libvirt/images/file.img
      
      Additionally, getting domblkstat, domblkerror, domblkinfo, and other block*
      type calls will not be able to reference the second target.
      
      Fortunately, hotplug disallows adding a "third" sda value:
      
      $ qemu-img create -f raw /var/lib/libvirt/images/file2.img 10M
      $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sda
      error: Failed to attach disk
      error: operation failed: target sda already exists
      
      $
      
      BUT, it since 'sdb' doesn't exist one would get the following on the same
      hotplug attempt, but changing to use 'sdb' instead of 'sda'
      
      $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sdb
      error: Failed to attach disk
      error: internal error: unable to execute QEMU command 'device_add': Duplicate ID 'scsi0-0-1' for device
      
      $
      
      Since we cannot fix this issue at parsing time, the best that can be done so
      as to not "lose" a domain is to make the check prior to starting the guest
      with the results as follows:
      
      $ virsh start $dom
      error: Failed to start domain $dom
      error: XML error: target 'sda' duplicated for disk sources '/var/lib/libvirt/images/file.qcow2' and '/var/lib/libvirt/images/file.img'
      
      $
      
      Running 'make check' found a few more instances in the tests where this
      duplicated target dev value was being used. These also exhibited some
      duplicated 'id=' values (negating the uniqueness argument of aliases) in
      the corresponding .args file and of course the *xmlout version of a few
      input XML files.
      e0e29055
  9. 27 2月, 2015 1 次提交
    • J
      Ignore listen attribute of <graphics> for type network listens · 8c45e8be
      Ján Tomko 提交于
      Commit 69929941 started filling the listen attribute
      of the parent <graphics> elements from type='network' listens.
      
      When this XML is passed to UpdateDevice, parsing fails:
      XML error: graphics listen attribute 10.20.30.40 must match
      address attribute of first listen element (found none)
      
      Ignore the address in the parent <graphics> attribute
      when no type='address' listens are found,
      the same we ignore the address for the <listen> subelements
      when parsing inactive XML.
      8c45e8be
  10. 21 2月, 2015 13 次提交
  11. 19 2月, 2015 1 次提交
    • J
      Search for schemas and cpu_map.xml in source tree · bc6e2063
      Jiri Denemark 提交于
      Not all files we want to find using virFileFindResource{,Full} are
      generated when libvirt is built, some of them (such as RNG schemas) are
      distributed with sources. The current API was not able to find source
      files if libvirt was built in VPATH.
      
      Both RNG schemas and cpu_map.xml are distributed in source tarball.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      bc6e2063
  12. 13 2月, 2015 1 次提交
  13. 12 2月, 2015 2 次提交
    • M
      docs, schema, conf: Add support for setting scheduler parameters of guest threads · 8680ea97
      Martin Kletzander 提交于
      In order for QEMU vCPU (and other) threads to run with RT scheduler,
      libvirt needs to take care of that so QEMU doesn't have to run privileged.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1178986Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      8680ea97
    • L
      domain: include portgroup in interface status xml · 89d26890
      Laine Stump 提交于
      Prior to commit 7d5bf484 (first appearing in libvirt 1.2.2), the
      status XML of a domain's interface was missing a lot of important
      information; mainly it just output the config of the interface, plus
      the name of the tap device and qemu device alias. Commit 7d5bf484
      changed the status XML to include many important bits of information
      that were required to make network "hook" scripts useful - bandwidth
      information, vlan tag, the name of the bridge (or physical device in
      the case of macvtap) that the tap/macvtap device was attached to - the
      commit log for 7d5bf484 has a very detailed explanation of the
      change. For quick reference - in the example given there, prior to the
      change, status XML looked like figure [C]:
      
            <interface type='network'>
              <source network='testnet' portgroup='admin'/>
              <target dev='macvtap0'/>
              <alias name='net0'/>
              <address type='pci' domain='0x0000' bus='0x00'
                       slot='0x03' function='0x0'/>
            </interface>
      
      and after the change, it looked like figure [E]:
      
            <interface type='direct'>
              <source dev='p4p1_0' mode='bridge'/>
              <bandwidth>
                  <inbound average='1000' peak='5000' burst='1024'/>
                  <outbound average='128' peak='256' burst='256'/>
              </bandwidth>
              <target dev='macvtap0'/>
              <alias name='net0'/>
              <address type='pci' domain='0x0000' bus='0x00'
                       slot='0x03' function='0x0'/>
            </interface>
      
      You'll notice that bandwidth info, physdev, and macvtap mode have been
      added, but the network and portgroup names are now missing - I didn't
      think that this information was of any use once the needed
      bandwidth/vlan/etc config had been pulled from the network/portgroup.
      
      I was wrong.
      
      A few months after that change a user on IRC asked what happened to
      portgroup in the status XML and described how he used it (more or less
      as a tag to decide what external information to use in a hook script
      that was run at startup/migration time - see
      http://wiki.libvirt.org/page/OVS_and_PVLANS ). At that time I planned
      to make a patch to re-add portgroup, but life intervened as that was
      just prior to a transatlantic move involving several weeks of
      "vacation". During this time I somehow forgot to make the patch, and
      also mistakenly remembered that I *had* made it.
      
      Subsequent to this, as a part of mprivozn's work to add support for
      network-specific hooks, I did re-add the output of the network name in
      status XML, but once again completely forgot about portgroup. This was
      in commit a3609121 (first appearing in libvirt 1.2.11). This made the
      status XML from the above example look like this:
      
            <interface type='direct'>
              <source network='testnet' dev='p4p1_0' mode='bridge'/>
              <bandwidth>
                  <inbound average='1000' peak='5000' burst='1024'/>
                  <outbound average='128' peak='256' burst='256'/>
              </bandwidth>
              <target dev='macvtap0'/>
              <alias name='net0'/>
              <address type='pci' domain='0x0000' bus='0x00'
                       slot='0x03' function='0x0'/>
            </interface>
      
      *This* patch just adds the portgroup back to the status XML, so the
       same example interface will look like this:
      
            <interface type='direct'>
              <source network='testnet' portgroup='admin'
                      dev='p4p1_0' mode='bridge'/>
              <bandwidth>
                  <inbound average='1000' peak='5000' burst='1024'/>
                  <outbound average='128' peak='256' burst='256'/>
              </bandwidth>
              <target dev='macvtap0'/>
              <alias name='net0'/>
              <address type='pci' domain='0x0000' bus='0x00'
                       slot='0x03' function='0x0'/>
            </interface>
      
      The result is that the status XML now contains all information about
      how the interface is setup (bandwidth, physical device, tap device,
      etc), in addition to pointers to its origin (the network and
      portgroup).
      89d26890