1. 20 4月, 2016 2 次提交
  2. 19 4月, 2016 2 次提交
    • M
      Include sysmacros.h where needed · aca4d72b
      Martin Kletzander 提交于
      So in glibc-2.23 sys/sysmacros.h is no longer included from sys/types.h
      and we don't build because of the usage of major/minor/makedev macros.
      Autoconf already has AC_HEADER_MAJOR macro that check where exactly
      these functions/macros are defined, so let's use that.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      aca4d72b
    • J
      tests: Fix syntax in iSCSI auth/secret tests · dd140028
      John Ferlan 提交于
      While working on the tests for the secret initialization vector, I found
      that the existing iSCSI tests were lacking in how they defined the IQN.
      Many had IQN's of just 'iqn.1992-01.com.example' for one disk while using
      'iqn.1992-01.com.example/1' for the second disk (same for hostdevs - guess
      how they were copied/generated).
      
      Typically (and documented this way), IQN's would include be of the form
      'iqn.1992-01.com.example:storage/1' indicating an IQN using "storage" for
      naming authority specific string and "/1" for the iSCSI LUN.
      
      So modify the input XML's to use the more proper format - this of course
      has a ripple effect on the output XML and the args.
      
      Also note that the "%3A" is generated by the virURIFormat/xmlSaveUri
      to represent the colon.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      dd140028
  3. 18 4月, 2016 1 次提交
    • J
      Libvirt: virTypedParamsValidate: Fix detection of multiple parameters · 0e570a6a
      Jason J. Herne 提交于
      virTypedParamsValidate currently uses an index based check to find
      duplicate parameters. This check does not work. Consider the following
      simple example:
      
      We have only 2 keys
      A  (multiples allowed)
      B  (multiples NOT allowed)
      
      We are given the following list of parameters to check:
      A
      A
      B
      
      If you work through the validation loop you will see that our last iteration
      through the loop has i=2 and j=1. In this case, i > j and keys[j].value.i will
      indicate that multiples are not allowed. Both conditionals are satisfied so
      an incorrect error will be given: "parameter '%s' occurs multiple times"
      
      This patch replaces the index based check with code that remembers
      the name of the last parameter seen and only triggers the error case if
      the current parameter name equals the last one. This works because the
      list is sorted and duplicate parameters will be grouped together.
      
      In reality, we hit this bug while using selective block migration to migrate
      a guest with 5 disks. 5 was apparently just the right number to push i > j
      and hit this bug.
      
      virsh migrate --live guestname --copy-storage-all
                    --migrate-disks vdb,vdc,vdd,vde,vdf
                    qemu+ssh://dsthost/systemSigned-off-by: NJason J. Herne <jjherne@linux.vnet.ibm.com>
      Reviewed-by: NEric Farman <farman@linux.vnet.ibm.com>
      0e570a6a
  4. 15 4月, 2016 10 次提交
    • P
      qemu: caps: Deprecate QEMU_CAPS_BALLOON · 2242a008
      Peter Krempa 提交于
      The flag is now unused and all qemus supported by libvirt already
      support it.
      2242a008
    • L
      qemu: support new pci controller model "pcie-expander-bus" · 8b62c65d
      Laine Stump 提交于
      This is backed by the qemu device pxb-pcie, which will be available in
      qemu 2.6.0.
      
      As with pci-expander-bus (which uses qemu's pxb device), the busNr
      attribute and <node> subelement of <target> are used to set the bus_nr
      and numa_node options.
      
      During post-parse we validate that the domain's machinetype is
      q35-based (since the device shows up for 440fx-based machinetypes, but
      is unusable), as well as checking that <node> specifies a node that is
      actually configured on the guest.
      8b62c65d
    • L
      conf: new pci controller model pcie-expander-bus · bc07251f
      Laine Stump 提交于
      This controller provides a single PCIe port on a new root. It is
      similar to pci-expander-bus, intended to provide a bus that can be
      associated with a guest-identifiable NUMA node, but is for
      machinetypes with PCIe rather than PCI (e.g. q35-based machinetypes).
      
      Aside from PCIe vs. PCI, the other main difference is that a
      pci-expander-bus has a companion pci-bridge that is automatically
      attached along with it, but pcie-expander-bus has only a single port,
      and that port will only connect to a pcie-root-port, or to a
      pcie-switch-upstream-port. In order for the bus to be of any use in
      the guest, it must have either a pcie-root-port or a
      pcie-switch-upstream-port attached (and one or more
      pcie-switch-downstream-ports attached to the
      pcie-switch-upstream-port).
      bc07251f
    • L
      qemu: add capabilities bit for device "pxb-pcie" · 0ec0bc85
      Laine Stump 提交于
          The pxb device is a PCIe expander bus that can be added to any
          Q35-based machinetype. A single PCIe port (*not* hotpluggable) is
          provided; if more than one device is desired, or if hotplug
          support is needed, either a pcie-root-port, or some combination of
          pcie-switch-upstream-port and pcie-swith-downstream-ports must be
          added to it. It can have a NUMA node number associated with it, as
          well as a bus number.
      0ec0bc85
    • L
      qemu: support new pci controller model "pci-expander-bus" · 400b2976
      Laine Stump 提交于
      This is backed by the qemu device "pxb".
      
      The pxb device always includes a pci-bridge that is at the bus number
      of the pxb + 1.
      
      busNr and <node> from the <target> subelement are used to set the
      bus_nr and numa_node options for pxb.
      
      During post-parse we validate that the domain's machinetype is
      440fx-based (since the pxb device only works on 440fx-based machines),
      and <node> also gets a sanity check to assure that the NUMA node
      specified for the pxb (if any - it's optional) actually exists on the
      guest.
      400b2976
    • L
      conf: new pci controller model pci-expander-bus · 52f3d0a4
      Laine Stump 提交于
      This is a standard PCI root bus (not a bridge) that can be added to a
      440fx-based domain. Although it uses a PCI slot, this is *not* how it
      is connected into the PCI bus hierarchy, but is only used for
      control. Each pci-expander-bus provides 32 slots (0-31) that can
      accept hotplug of standard PCI devices.
      
      The usefulness of pci-expander-bus relative to a pci-bridge is that
      the NUMA node of the bus can be specified with the <node> subelement
      of <target>. This gives guest-side visibility to the NUMA node of
      attached devices (presuming that management apps only assign a device
      to a bus that has a NUMA node number matching the node number of the
      device on the host).
      
      Each pci-expander-bus also has a "busNr" attribute. The expander-bus
      itself will take the busNr specified, and all buses that are connected
      to this bus (including the pci-bridge that is automatically added to
      any expander bus of model "pxb" (see the next commit)) will use
      busNr+1, busNr+2, etc, and the pci-root (or the expander-bus with next
      lower busNr) will use bus numbers lower than busNr.
      52f3d0a4
    • L
      qemu: add capabilities bit for device "pxb" · 5d4e2b17
      Laine Stump 提交于
      The pxb device is a PCI expander bus that can be added to any
      440fx-based machinetype. The PCI bus that is created has 32 standard
      PCI slots (hotpluggable). It can have a NUMA node number associated
      with it, as well as a bus number.
      5d4e2b17
    • L
      conf: allow use of slot 0 in a dmi-to-pci-bridge · 0d668434
      Laine Stump 提交于
      When support for dmi-to-pci-bridge was added, it was assumed that,
      just as with the pci-root bus, slot 0 was reserved. This is not the
      case - it can be used to connect a device just like any other slot, so
      remove the restriction and update the test cases that auto-assign an
      address on a dmi-to-pci-bridge.
      0d668434
    • C
      test: genericxml2xml: test graphics listen= compat · 313272e0
      Cole Robinson 提交于
      * Add a test for listen=XXX and <listen address=YYY/> collision error
      * Add an explicit test for listen=XXX duplicated to <listen address=XXX/>
        We implicitly test it elsewhere but I figure it's better to be explicit,
        and this test case can be extended in the future for additional listen
        back compat if/when we support <listen type='socket'/> syntax
      313272e0
    • C
      tests: Enable failure testing with CompareDomXML2XML · c493d216
      Cole Robinson 提交于
      This allows tests to check for specific failure scenarios
      c493d216
  5. 14 4月, 2016 3 次提交
  6. 13 4月, 2016 5 次提交
    • J
      qemuxml2argvtest: do not mock virCommand · cbbd74aa
      Ján Tomko 提交于
      Mock virNetDevRunEthernetScript instead.
      
      This restores the VIR_TEST_REGENERATE_OUTPUT functionality.
      cbbd74aa
    • J
      qemu: assign addresses before aliases · 786bc251
      Ján Tomko 提交于
      The address assigning code might add new pci bridges.
      We need them to have an alias when building the command line.
      
      In real word usage, this is not a problem because all the code
      paths already call qemuDomainAssignAddresses. However moving
      this call lets us remove one extra call from qemuxml2argvtest.
      786bc251
    • J
      qemuxml2argvtest: drop FLAG_EXPECT_ERROR · 1922d2f1
      Ján Tomko 提交于
      It is only used for failed address allocation
      Since we already have FLAG_EXPECT_FAILURE, use that instead.
      
      Also unify the output to print the whole log buffer instead
      of just the last error message.
      1922d2f1
    • J
      tests: clean up includes · f36c9f7b
      Ján Tomko 提交于
      After removing qemuBuildCommandLineCallbacks, testutilsqemu.h does not
      need to include qemu_command.h.
      
      Include just qemu_conf.h here and qemu_domain_address.h in files that
      need it.
      f36c9f7b
    • J
      drop qemuBuildCommandLineCallbacks · 0da965c5
      Ján Tomko 提交于
      Essentially revert commit 3a6204cb which added these to allow the test
      suite to pass without depending on the host system state.
      
      Since commit 4b527c1a we already mock virSCSIDeviceGetSgName, so these
      callbacks are useless.
      0da965c5
  7. 12 4月, 2016 2 次提交
  8. 11 4月, 2016 1 次提交
  9. 08 4月, 2016 3 次提交
  10. 07 4月, 2016 2 次提交
    • J
      qemu: Introduce qemuBuildMasterKeyCommandLine · d8a8cae3
      John Ferlan 提交于
      If the -object secret capability exists, then get the path to the
      masterKey file and provide that to qemu. Checking for the existence
      of the file before passing to qemu could be done, but causes issues
      in mock test environment.
      
      Since the qemuDomainObjPrivate is not available when building the
      command line, the qemuBuildHasMasterKey API will have to suffice
      as the primary arbiter for whether the capability exists in order
      to find/return the path to the master key for usage.
      
      Created the qemuDomainGetMasterKeyAlias API which will be used by
      later patches to define the 'keyid' (eg, masterKey) to be used by
      other secrets to provide the id to qemu for the master key.
      d8a8cae3
    • J
      qemu: Add capability bit for qemu secret object · d125685a
      John Ferlan 提交于
      Add a capability bit for the qemu secret object.
      
      Adjust the 2.6.0-1 caps/replies to add the secret object. For the
      .replies it's take from the '{"execute":"qom-list-types"}' output.
      d125685a
  11. 04 4月, 2016 1 次提交
    • M
      nodedev: Fix parsing of generated XMLs · 17a94ba7
      Martin Kletzander 提交于
      Commit d77ffb68 added not only reporting of the PCI header type, but
      also parsing of that information.  However, because there was no parsing
      done for the other sub-PCI capabilities, if there was any other
      capability then a valid header type name (like phys_function or
      virt_functions) the parsing would fail.  This prevented passing node
      device XMLs that we generated into our own functions when dealing with,
      e.g. with SRIOV cards.
      
      Instead of reworking the whole parsing, just fix this one occurence and
      remove a test for it for the time being.  Future patches will deal with
      the rest.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      17a94ba7
  12. 30 3月, 2016 2 次提交
    • R
      nss: FreeBSD support · 45408cd8
      Roman Bogorodskiy 提交于
       * tools/nss/libvirt_nss.[ch]: add BSD-comptabile wrappers and
         register via the nss_module_register() interface
       * m4/virt-nss.m4: add checks if we're building NSS for FreeBSD
       * tools/Makefile.am: handle target library name differences, as
         Linux needs libnss_libvirt.so.2 and FreeBSD needs
         nss_libvirt.so.1. Also, different syms files have to be used
         as Linux needs to export all the methods while FreeBSD
         only needs to have nss_module_register()
       * tests/nsstest.c, tests/nssmock.c: s/__linux__/NSS/
       * tests/nssmock.c: pass int instead of mode_t to va_arg() to please
         gcc 4.8
       * libvirt_nss_bsd.syms: FreeBSD syms file
      45408cd8
    • P
      util: bitmap: Introduce self-expanding bitmap APIs · 917426c8
      Peter Krempa 提交于
      In some cases it's impractical to use the regular APIs as the bitmap
      size needs to be pre-declared. These new APIs allow to use bitmaps that
      self expand.
      
      The new code adds a property to the bitmap to track the allocation of
      memory so that VIR_RESIZE_N can be used.
      917426c8
  13. 29 3月, 2016 6 次提交
    • P
      vsh: Tweak error message for scaled integers · b2c9d77b
      Peter Krempa 提交于
      It was too similar to the non-scaled alternative.
      
      before:
      error: Numeric value 'abc' for <size> option is malformed or out of range
      after:
      error: Scaled numeric value 'abc' for <size> option is malformed or out of range
      b2c9d77b
    • Q
      perf: add new xml element · afe833e9
      Qiaowei Ren 提交于
      This patch adds new xml element, and so we can have the option of
      also having perf events enabled immediately at startup.
      Signed-off-by: NQiaowei Ren <qiaowei.ren@intel.com>
      Message-id: 1459171833-26416-6-git-send-email-qiaowei.ren@intel.com
      afe833e9
    • C
      tests: virtnettlscontexttest: Use virGetLastErrorMessage() · 49022317
      Cole Robinson 提交于
      Use virGetLastErrorMessage() rather than open code it
      49022317
    • M
      conf: qemu: Add support for more HyperV Enlightenment features · 7068b56c
      Maxim Nestratov 提交于
      This patch adds support for "vpindex", "runtime", "synic",
      "stimer", and "vendor_id" features available in qemu 2.5+.
      
      - When Hyper-V "vpindex" is on, guest can use MSR HV_X64_MSR_VP_INDEX
      to get virtual processor ID.
      
      - Hyper-V "runtime" enlightement feature allows to use MSR
      HV_X64_MSR_VP_RUNTIME to get the time the virtual processor consumes
      running guest code, as well as the time the hypervisor spends running
      code on behalf of that guest.
      
      - Hyper-V "synic" stands for Synthetic Interrupt Controller, which is
      lapic extension controlled via MSRs.
      
      - Hyper-V "stimer" switches on Hyper-V SynIC timers MSR's support.
      Guest can setup and use fired by host events (SynIC interrupt and
      appropriate timer expiration message) as guest clock events
      
      - Hyper-V "reset" allows guest to reset VM.
      
      - Hyper-V "vendor_id" exposes hypervisor vendor id to guest.
      Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      7068b56c
    • A
      tests: storagepoolxml2xmltest: Enable pool-rbd · 289f37ea
      Anatole Denis 提交于
      This test was commited 4 years ago, but was never enabled in
      storagepoolxml2xmltest.c. This patch reactivates it, conditionnaly on RBD
      storage support being enabled
      289f37ea
    • A
      tests: storagepoolxml2xmltest: Fix pool-rbd test · 47847451
      Anatole Denis 提交于
      This test failed for two reasons:
      * The uuid was missing from the input file
      * The output file had the <name> in a different place from the actual output
      47847451