1. 05 3月, 2015 2 次提交
    • M
      qemu: Allow spaces in disk serial · 5aee81a0
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1195660
      
      There's been a bug report appearing on the qemu-devel list, that
      libvirt is unable to pass spaces in disk serial number [1]. Not only
      our RNG schema forbids that, the code is not prepared either. However,
      with a bit of escaping (if needed) we can allow spaces there.
      
      1: https://lists.gnu.org/archive/html/qemu-devel/2015-02/msg04041.htmlSigned-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5aee81a0
    • J
      SRIOV NIC offload feature discovery · c9027d8f
      James Chapman 提交于
      Adding functionality to libvirt that will allow it
      query the ethtool interface for the availability
      of certain NIC HW offload features
      
      Here is an example of the feature XML definition:
      
      <device>
      <name>net_eth4_90_e2_ba_5e_a5_45</name>
        <path>/sys/devices/pci0000:00/0000:00:03.0/0000:08:00.1/net/eth4</path>
        <parent>pci_0000_08_00_1</parent>
        <capability type='net'>
          <interface>eth4</interface>
          <address>90:e2:ba:5e:a5:45</address>
          <link speed='10000' state='up'/>
          <feature name='rx'/>
          <feature name='tx'/>
          <feature name='sg'/>
          <feature name='tso'/>
          <feature name='gso'/>
          <feature name='gro'/>
          <feature name='rxvlan'/>
          <feature name='txvlan'/>
          <feature name='rxhash'/>
          <capability type='80203'/>
        </capability>
      </device>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      c9027d8f
  2. 04 3月, 2015 2 次提交
  3. 03 3月, 2015 3 次提交
    • P
      8672a1e4
    • P
      schema: Fix interface link state schema · 8eb907b8
      Peter Krempa 提交于
      In commit edd1295e I've introduced an
      XML element that allows to configure state of the network interface
      link. Somehow the RNG schema hunk ended up in a weird place in the
      network schema definition. Move it to the right place and add a test
      case.
      
      Note that the link state is set up via the monitor at VM startup so I
      originally didn't think of adding a test case.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1173468
      8eb907b8
    • 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
  4. 02 3月, 2015 6 次提交
  5. 26 2月, 2015 1 次提交
    • L
      qemu: fix ifindex array reported to systemd · 4bbe1029
      Laine Stump 提交于
      Commit f7afeddc added code to report to systemd an array of interface
      indexes for all tap devices used by a guest. Unfortunately it not only
      didn't add code to report the ifindexes for macvtap interfaces
      (interface type='direct') or the tap devices used by type='ethernet',
      it ended up sending "-1" as the ifindex for each macvtap or hostdev
      interface. This resulted in a failure to start any domain that had a
      macvtap or hostdev interface (or actually any type other than
      "network" or "bridge").
      
      This patch does the following with the nicindexes array:
      
      1) Modify qemuBuildInterfaceCommandLine() to only fill in the
      nicindexes array if given a non-NULL pointer to an array (and modifies
      the test jig calls to the function to send NULL). This is because
      there are tests in the test suite that have type='ethernet' and still
      have an ifname specified, but that device of course doesn't actually
      exist on the test system, so attempts to call virNetDevGetIndex() will
      fail.
      
      2) Even then, only add an entry to the nicindexes array for
      appropriate types, and to do so for all appropriate types ("network",
      "bridge", and "direct"), but only if the ifname is known (since that
      is required to call virNetDevGetIndex().
      4bbe1029
  6. 25 2月, 2015 2 次提交
  7. 24 2月, 2015 1 次提交
  8. 21 2月, 2015 6 次提交
  9. 20 2月, 2015 2 次提交
    • P
      virsh: fix vcpupin info · 81dd81e4
      Pavel Hrdina 提交于
      The "virDomainGetInfo" will get for running domain only live info and for
      offline domain only config info. There was no way how to get config info
      for running domain. We will use "vshCPUCountCollect" instead to get the
      correct cpu count that we need to pass to "virDomainGetVcpuPinInfo".
      
      Also cleanup some unnecessary variables and checks that are done by
      drivers.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1160559Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      81dd81e4
    • M
      virQEMUCapsCacheLookupCopy: Filter qemuCaps based on machineType · af204232
      Michal Privoznik 提交于
      Not all machine types support all devices, device properties, backends,
      etc. So until we create a matrix of [machineType, qemuCaps], lets just
      filter out some capabilities before we return them to the consumer
      (which is going to make decisions based on them straight away).
      Currently, as qemu is unable to tell which capabilities are (not)
      enabled for given machine types, it's us who has to hardcode the matrix.
      One day maybe the hardcoding will go away and we can create the matrix
      dynamically on the fly based on a few monitor calls.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      af204232
  10. 17 2月, 2015 2 次提交
    • M
      qemuBuildMemoryBackendStr: Report backend requirement more appropriately · 7832fac8
      Michal Privoznik 提交于
      So, when building the '-numa' command line, the
      qemuBuildMemoryBackendStr() function does quite a lot of checks to
      chose the best backend, or to check if one is in fact needed. However,
      it returned that backend is needed even for this little fella:
      
        <numatune>
          <memory mode="strict" nodeset="0,2"/>
        </numatune>
      
      This can be guaranteed via CGroups entirely, there's no need to use
      memory-backend-ram to let qemu know where to get memory from. Well, as
      long as there's no <memnode/> element, which explicitly requires the
      backend. Long story short, we wouldn't have to care, as qemu works
      either way. However, the problem is migration (as always). Previously,
      libvirt would have started qemu with:
      
        -numa node,memory=X
      
      in this case and restricted memory placement in CGroups. Today, libvirt
      creates more complicated command line:
      
        -object memory-backend-ram,id=ram-node0,size=X
        -numa node,memdev=ram-node0
      
      Again, one wouldn't find anything wrong with these two approaches.
      Both work just fine. Unless you try to migrated from the older libvirt
      into the newer one. These two approaches are, unfortunately, not
      compatible. My suggestion is, in order to allow users to migrate, lets
      use the older approach for as long as the newer one is not needed.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      7832fac8
    • M
      qemuxml2argvtest: Fake response from numad · 38064806
      Michal Privoznik 提交于
      Well, we can pretend that we've asked numad for its suggestion and let
      qemu command line be built with that respect. Again, this alone has no
      big value, but see later commits which build on the top of this.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      38064806
  11. 13 2月, 2015 1 次提交
  12. 12 2月, 2015 1 次提交
  13. 11 2月, 2015 3 次提交
  14. 10 2月, 2015 3 次提交
  15. 06 2月, 2015 1 次提交
  16. 04 2月, 2015 2 次提交
  17. 03 2月, 2015 1 次提交
  18. 31 1月, 2015 1 次提交
    • P
      qemu: command: Don't combine old and modern NUMA node creation · b92a0037
      Peter Krempa 提交于
      Change done by commit f309db1f wrongly
      assumes that qemu can start with a combination of NUMA nodes specified
      with the "memdev" option and the appropriate backends, and the legacy
      way by specifying only "mem" as a size argument. QEMU rejects such
      commandline though:
      
      $ /usr/bin/qemu-system-x86_64 -S -M pc -m 1024 -smp 2 \
      -numa node,nodeid=0,cpus=0,mem=256 \
      -object memory-backend-ram,id=ram-node1,size=12345 \
      -numa node,nodeid=1,cpus=1,memdev=ram-node1
      qemu-system-x86_64: -numa node,nodeid=1,cpus=1,memdev=ram-node1: qemu: memdev option must be specified for either all or no nodes
      
      To fix this issue we need to check if any of the nodes requires the new
      definition with the backend and if so, then all other nodes have to use
      it too.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1182467
      b92a0037