1. 05 5月, 2016 3 次提交
    • C
      conf: Drop restrictions on rng backend path · bc858f46
      Cole Robinson 提交于
      Currently we only allow /dev/random and /dev/hwrng as host input
      for <rng><backend model='random'/> device. This was added after
      various upstream discussions in commit 4932ef45
      
      However this restriction has generated quite a few complaints over
      the years, so a new discussion was initiated:
      
      http://www.redhat.com/archives/libvir-list/2016-April/msg00987.html
      
      Several people suggested removing the restriction, and nobody really
      spoke up to defend it. So this patch drops the path restriction
      entirely
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1074464
      (cherry picked from commit 67f2b727)
      bc858f46
    • C
      virconf: Handle conf file without ending newline · ca9180ad
      Cole Robinson 提交于
      $ echo -n 'log_level=1' > ~/.config/libvirt/libvirtd.conf
      $ libvirtd --timeout=10
      2014-10-10 10:30:56.394+0000: 6626: info : libvirt version: 1.1.3.6, package: 1.fc20 (Fedora Project, 2014-09-08-17:50:42, buildvm-05.phx2.fedoraproject.org)
      2014-10-10 10:30:56.394+0000: 6626: error : main:1261 : Can't load config file: configuration file syntax error: /home/rjones/.config/libvirt/libvirtd.conf:1: expecting a value: /home/rjones/.config/libvirt/libvirtd.conf
      
      Rather than try to fix this in the depths of the parser, just catch
      the case when a config file doesn't end in a newline, and manually
      append a newline to the content before parsing
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1151409
      (cherry picked from commit 3cc2a9e0)
      ca9180ad
    • L
      network: fix DHCPv6 on networks with prefix != 64 · 8ceb0fea
      Laine Stump 提交于
      According to the dnsmasq manpage, the netmask for IPv4 address ranges
      will be auto-deteremined from the interface dnsmasq is listening on,
      but it can't do this for IPv6 for some reason - it instead assumes a
      network prefix of 64 for all IPv6 address ranges. If this is
      incorrect, dnsmasq will refuse to give out an address to clients,
      instead logging this message:
      
       dnsmasq-dhcp[2380]: no address range available for DHCPv6 request via virbr0
      
      The solution is for libvirt to add ",$prefix" to all IPv6 dhcp-range
      arguments when building the dnsmasq.conf file.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1033739
      (cherry picked from commit bf3d9f30)
      8ceb0fea
  2. 20 4月, 2016 4 次提交
    • J
      tests: fix xen-related tests · af20fbab
      Ján Tomko 提交于
      My commit 6879be48 moved the addition of the implicit video device
      from the XML parser to the PostParse function, but did not regenerate
      all the tests.
      
      (cherry picked from commit 4b35a715)
      af20fbab
    • J
      tests: Fix syntax in iSCSI auth/secret tests · 35351d52
      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>
      (cherry picked from commit dd140028)
      35351d52
    • J
      Libvirt: virTypedParamsValidate: Fix detection of multiple parameters · 791c90cb
      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>
      (cherry picked from commit 0e570a6a)
      791c90cb
    • J
      conf: also mark the implicit video as primary · 9bf53474
      Ján Tomko 提交于
      Commit 119cd06e started setting the primary bool for the first
      user-specified video even if user omitted the 'primary' attribute.
      
      However this was done before the addition of the implicit device.
      This broke startup of transient qemu domains with no <video>:
      https://bugzilla.redhat.com/show_bug.cgi?id=1325757
      
      Move this default to virDomainDefPostParseInternal,
      after the addition of the implicit video device, to catch the implicit
      video as well.
      
      (cherry picked from commit 6d8b6d28)
      9bf53474
  3. 15 4月, 2016 1 次提交
  4. 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
  5. 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
  6. 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
  7. 25 3月, 2016 4 次提交
  8. 24 3月, 2016 3 次提交
  9. 23 3月, 2016 2 次提交
    • M
      qemuxml2argv: Mock virSCSIDeviceGetSgName · 4b527c1a
      Michal Privoznik 提交于
      When constructing SCSI hostdev command line for qemu, the
      /sys/bus/scsi/devices/... dir is scanned. Unfortunately, even in
      the tests. This is needed to determine the name of SCSI device to
      passthrough to qemu, because in the domain XML we were given its
      address instead. Anyway, we should not be touching live system
      data in our test suite as it produced unpredictable results. The
      test is regressing from 1e9a0837 on.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4b527c1a
    • A
      tests: hostdev: Add more tests · ee07c980
      Andrea Bolognani 提交于
      Ensure the code behaves properly even for situations that were not
      being considered before, such as simply detaching devices from the
      host without attaching them to a guest and attaching devices as
      managed even though they had already been manually detached from
      the host.
      ee07c980
  10. 22 3月, 2016 7 次提交
  11. 21 3月, 2016 4 次提交
    • J
      xenconfig: change 'hap' setting to align with Xen behavior · 4c9ffc53
      Jim Fehlig 提交于
      hap is enabled by default in xm and xl config and usually only
      specified when it is desirable to disable hap (hap = 0). Change
      the xm,xl <-> xml converter to behave similarly. I.e. only
      produce 'hap = 0' when <hap state='off'/> and vice versa.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      4c9ffc53
    • M
      util: Add virSocketAddrSetIPv[46]AddrNetOrder and use it · 573c41a2
      Martin Kletzander 提交于
      This allows setting the address in host and/or network order and makes
      the naming consistent.  Now you don't need to call [hn]to[nh]l()
      functions as that is taken care of by these functions.  Also, now
      the *NetOrder take the address in network order, the other functions in
      host order so the naming and usage is consistent.  Some places were
      having the address in network order and calling ntohl() just so the
      original function can call htonl() again.  This makes it nicer to read.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      573c41a2
    • C
      qemu: Don't add -spice port=0 when no port is specified · 6d28ef91
      Christophe Fergeau 提交于
      If a <graphics type='spice'> has no port nor tlsPort set, the generated
      QEMU command line will contain -spice port=0.
      This is later going to be ignored by spice-server, but it's better not
      to add it at all in this situation.
      As an empty -spice is not allowed, we still need to append port=0 if we
      did not add any other argument.
      6d28ef91
    • C
      qemu: Omit SPICE address if no port is specified · 8dab3d1d
      Christophe Fergeau 提交于
      Currently -spice addr=127.0.0.1 is generated, but spice-server is going
      to ignore this as no port is specified.
      8dab3d1d
  12. 20 3月, 2016 1 次提交
  13. 19 3月, 2016 2 次提交
    • M
      nodedev: Expose PCI header type · d77ffb68
      Martin Kletzander 提交于
      If we expose this information, which is one byte in every PCI config
      file, we let all mgmt apps know whether the device itself is an endpoint
      or not so it's easier for them to decide whether such device can be
      passed through into a VM (endpoint) or not (*-bridge).
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1317531Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      d77ffb68
    • M
      tests: Introduce nsslinktest · 5bcd96f5
      Michal Privoznik 提交于
      The only purpose of this test is to catch possible linking
      problems with libnss_libvirt.so.2.
      One of the problems I faced was that the NSS plugin was unloaded
      immediately after it got loaded and the name resolution process
      continued with next configured option. Without any error. It was
      very hard to debug why until I created this simple test and found
      out immediately that there were some symbols missing. The reason
      why problem was not caught in nsstest is that in the test we want
      to use all the fancy stuff and therefore link it with libvirt.la.
      So even if there's a symbol missing in the NSS plugin it will be
      found in the libvirt.la.
      But even after I resolved the issue we still need this test
      because files the NSS plugin is built from are still live (mostly
      those under utils/ dir). So as they change new symbol might be
      required which would render the NSS plugin unusable.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5bcd96f5