1. 29 5月, 2015 1 次提交
    • L
      node_device: more informative error log when device isn't found · 06a18bc8
      Laine Stump 提交于
      In a couple of cases, the node device driver (and the test node device
      driver which likely copied it) was only logging "Node device not
      found" when it couldn't find the requested device. This patch changes
      those cases to log the name (and in the case when it's relevant, the
      wwnn and wwpn) as well.
      06a18bc8
  2. 28 5月, 2015 6 次提交
  3. 27 5月, 2015 8 次提交
    • A
      qemu: Limit rtc-reset-reinjection requirement to x86 only. · ceab3979
      Andrea Bolognani 提交于
      The QMP command, like the interrupt reinjection logic it's connected
      to, is only implemented in QEMU when TARGET_I386 is defined, so
      checking for its availability on any other architecture is pointless.
      
      On the other hand, when we're on x86, we shouldn still make sure that
      rtc-reset-reinjection is available and refuse to set the time
      otherwise.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1211938
      ceab3979
    • M
      storage_fs: Create directory with UID if needed · 7d0481cb
      Martin Kletzander 提交于
      The code already exists there, it just modified different flags.  I just
      noticed this when looking at the code.  This patch is better to view
      with bigger context or '-W'.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      7d0481cb
    • Z
      util: make it more robust to calculate timeout value · 39d0396f
      Zhang Bo 提交于
      When we change system clock to years ago, a certain CPU may use up 100% cputime.
      The reason is that in function virEventPollCalculateTimeout(), we assign the
      unsigned long long result to an INT variable,
              *timeout = then - now; // timeout is INT, and then/now are long long
              if (*timeout < 0)
                  *timeout = 0;
      there's a chance that variable @then minus variable @now may be a very large number
      that overflows INT value expression, then *timeout will be negative and be assigned to 0.
      Next the 'poll' in function virEventPollRunOnce() will get into an 'endless' while loop there.
      thus, the cpu that virEventPollRunOnce() thread runs on will go up to 100%.
      
      Although as we discussed before in https://www.redhat.com/archives/libvir-list/2015-May/msg00400.html
      it should be prohibited to set-time while other applications are running, but it does
      seems to have no harm to make the codes more robust.
      Signed-off-by: NWang Yufei <james.wangyufei@huawei.com>
      Signed-off-by: NZhang Bo <oscar.zhangbo@huawei.com>
      39d0396f
    • R
      zfs: fix storagepoolxml2xml test · b071ec43
      Roman Bogorodskiy 提交于
      Commit 7c2d65dd dropped setting default mode.
      
      Update zfs tests accordingly.
      b071ec43
    • P
      qemu: Fix compilation error when enum variable size differs from 'int' · 27fd5598
      Peter Krempa 提交于
      Since commit bcd9a564 virDomainNumatuneGetMode returns the value
      via a pointer rather than in the return value. The change triggered
      problems with platforms where the compiler decides to use a data type of
      size different than integer at the point where we typecast it.
      
      Work around the issue by using an intermediate variable of the correct
      type that gets casted back by the default typecasting rules.
      27fd5598
    • L
      util: improve the sysinfo element XML format · e14cdeb4
      Luyao Huang 提交于
      If the <sysinfo type='smbios'...> ends up not formatting any sub-elements,
      then rather than formatting as:
      
        <sysinfo type='smbios'>
        </sysinfo>
      
      Just format it more cleanly as:
      
        <sysinfo type='smbios'/>
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      e14cdeb4
    • L
      conf: Avoid formatting empty redirfilter element · 733950c2
      Luyao Huang 提交于
      If the redirfilter has no usbdev sub-elements, then do not format anything
      rather than formatting an empty pair of elements:
      
          <redirfilter>
          </redirfilter>
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      733950c2
    • E
      maint: update to latest gnulib · 3502f791
      Eric Blake 提交于
      Time to update to new gnulib before a release.
      
      gcc 5.1 introduced a new -Wformat-signedness, and new gnulib now
      turns it on by default.  However, it is still rather lame at the
      moment, because it warns for enums, even though there is no way
      to control the signeness of an enum which does not use any members
      that are negative or larger than INT_MAX, and even though such an
      enum would always print the same for both %d and %u:
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66249
      
      In file included from ../../src/util/virarch.c:26:0:
      ../../src/util/virarch.c: In function 'virArchFromHost':
      ../../src/util/virarch.c:180:15: error: format '%d' expects argument of type 'int', but argument 9 has type 'unsigned int' [-Werror=format=]
           VIR_DEBUG("Mapped %s to %d (%s)",
      
      So this patch turns off the new warning as part of enabling all
      other new gcc 5.1 warnings that gnulib now enables.
      
      * .gnulib: Update to latest, in part for gcc 5.1 interaction.
      * m4/virt-compile-warnings.m4: Ignore -Wformat-signedness, for now.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3502f791
  4. 26 5月, 2015 11 次提交
    • J
      qemu: Add libvirt version check to refresh capabilities algorithm · a14eff38
      John Ferlan 提交于
      Rather than an algorithm based solely on libvirtd ctime to refresh the
      capabilities add the element of the libvirt build version into the equation.
      Since that version wouldn't be there prior to this code being run - don't
      fail on reading the capabilities if not found. In this case, the cache
      will always be rebuilt when a new libvirt version is installed.
      a14eff38
    • J
      qemu: Force capabilities cache refresh if libvirtd date is different · 0b4211f9
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1195882
      
      Original commit id 'cbde3589' indicates that the cache file would be
      discarded if either the QEMU binary or libvirtd 'ctime' changes; however,
      the code only discarded if the QEMU binary time didn't match or if the
      new libvirtd ctime was later than what created the cache file.
      
      Since many factors come into play with 'ctime' adjustments (including
      perhaps turning back the hands of time), change the logic to also force
      a refresh if the ctime of libvirt is different than what's in the cache.
      0b4211f9
    • D
      docs: update github project name · 205a6db0
      Daniel P. Berrange 提交于
      The github project was renamed from libvirtproject to libvirt
      205a6db0
    • J
      qemu: Resolve Coverity RESOURCE_LEAK · 2f9f7b5f
      John Ferlan 提交于
      Recent changes to the -M/--machine processing code in qemuParseCommandLine
      caused Coverity to determine there was a possible resource leak with how
      the 'list' is managed. Rather than try to add virStringFreeList calls
      everywhere - just promote list to the top of the variables and free it
      within the error processing code. Also required a couple of other tweaks
      in order to avoid double free's.
      2f9f7b5f
    • J
      conf: Resolve Coverity NEGATIVE_RETURNS · c214f56a
      John Ferlan 提交于
      Commit id '73eda710' added virDomainKeyWrapDefParseXML which uses
      virXPathNodeSet, but does not handle a -1 return thus causing a possible
      loop condition exit problem later when the return value is used.
      
      Change the logic to return the value from virXPathNodeSet if <= 0
      c214f56a
    • C
      storage: fs: Only force directory permissions if required · db1140f1
      Cole Robinson 提交于
      Only set directory permissions at pool build time, if:
      
      - User explicitly requested a mode via the XML
      - The directory needs to be created
      - We need to do the crazy NFS root-squash workaround
      
      This allows qemu:///session to call build on an existing directory
      like /tmp.
      db1140f1
    • C
      conf: storage: Don't emit empty <permissions> block · 42dd6a99
      Cole Robinson 提交于
      42dd6a99
    • C
      storage: conf: Don't set any default <mode> in the XML · 7c2d65dd
      Cole Robinson 提交于
      The XML parser sets a default <mode> if none is explicitly passed in.
      This is then used at pool/vol creation time, and unconditionally reported
      in the XML.
      
      The problem with this approach is that it's impossible for other code
      to determine if the user explicitly requested a storage mode. There
      are some cases where we want to make this distinction, but we currently
      can't.
      
      Handle <mode> parsing like we handle <owner>/<group>: if no value is
      passed in, set it to -1, and adjust the internal consumers to handle
      it.
      7c2d65dd
    • C
      docs: formatstorage: Update <permissions> docs · fafcc818
      Cole Robinson 提交于
      - Don't redocument the permissions fields for backingstore, just point to
        the volume docs.
      - Clarify that owner/group are inherited from the parent directory at
        volume create/pool build time.
      - Clarify that <permissions> fields report runtime values too
      fafcc818
    • M
      parallels: fix possible crash in case of errors in prlsdkLoadDomain · 55714f78
      Maxim Nestratov 提交于
      Cleanup code in prlsdkLoadDomain doesn't take into account the fact
      if private domain structure along with freeing function is assigned
      or not. In case it is, we shouldn't call it manually because
      virDomainObjListRemove calls it and frees pdom.
      Also, allocated def structure should be freed only if it's not
      assigned to domain. Otherwise it will be called twice: one time by
      virDomainObjListRemove and the second by prlsdkLoadDomain itself.
      Signed-off-by: NMaxim Nestratov <mnestratov@parallels.com>
      55714f78
    • M
      parallels: move up updating parameter in prlsdkLoadDomain · dc58e742
      Maxim Nestratov 提交于
      It is better to get all necessary parameters and check them on newly
      created configuration before actually creating a domain with them or
      applying them to an existing domain.
      Signed-off-by: NMaxim Nestratov <mnestratov@parallels.com>
      dc58e742
  5. 25 5月, 2015 2 次提交
  6. 24 5月, 2015 6 次提交
  7. 22 5月, 2015 6 次提交
    • L
      util: better error message after failure to initialize firewall backend · a9c53462
      Laine Stump 提交于
      If the firewalld backend wasn't available and libvirt decides to try
      setting up a "direct" backend, it checks for the presence of iptables,
      ip6tables, and ebtables. If they are not found, a message like this is logged:
      
        error : virFirewallValidateBackend:193 : direct firewall backend
                requested, but /usr/sbin/ip6tables is not available:
                No such file or directory
      
      But then at a later time if an attempt is made to use the virFirewall
      API, failure will be indicated with:
      
        error : virFirewallApply:936 : out of memory
      
      This patch changes virFirewallApply to first check if a firewall
      backend hadn't been successfully setup, and logs a slightly more
      informative message in that case:
      
        error : virFirewallApply:940 : internal error:
                Failed to initialize a valid firewall backend
      
      This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1223876
      a9c53462
    • L
      interface: allow multiple IPv4 addresses + dhcp on a single interface · ba5566e8
      Laine Stump 提交于
      As of netcf-0.2.8, netcf supports configuring multipl IPv4 addresses,
      as well as simultaneously configuring dhcp and static IPv4 addresses,
      on a single interface. This patch updates libvirt's interface.rng to
      allow such configurations.
      
      This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1223688
      ba5566e8
    • L
      netdev: fail when setting up an SRIOV VF if PF is offline · 474523fa
      Laine Stump 提交于
      If an SRIOV PF is offline, the kernel won't complain if you set the
      mac address and vlan tag for a VF via this PF, and it will even let
      you assign the VF to a guest using PCI device assignment or macvtap
      passthrough. But in this case (the PF isn't online), the device won't
      be usable in the guest.
      
      Silently setting the PF online would solve the connectivity problem,
      but as pointed out by Dan Berrange, when an interface is set online
      with no associated config, the kernel will by default turn on IPv6
      autoconf, which could create unexpected security problems for the
      host. For this reason, this patch instead logs an error and fails the
      operation.
      
      This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=893738
      
      Originally filed against RHEL6, but present in every version of
      libvirt until today.
      474523fa
    • C
      storage: conf: Don't output owner/group -1 · c4d27bdd
      Cole Robinson 提交于
      -1 is just an internal placeholder and is meaningless to output in the XML.
      c4d27bdd
    • M
      node_device: fix libvirt build if WITH_HAL is defined · b903b3b0
      Maxim Nestratov 提交于
      commit ffc40b63 changed uniond _virNodeDevCapData into a typedef
      named virNodeDevCapData with a struct that contains the union as well
      as a type enum. This change necessitated changing every reference to
      "caps->type" into "caps->data.type", but the author of that patch
      failed to test a build "WITH_HAL". This patch fixes the one place in
      the hal backend that needed changing.
      b903b3b0
    • M
      sysinfo: Fix reports on ARM · 85128e29
      Michal Privoznik 提交于
      Due to a kernel commit (b4b8f770e), cpuinfo format has changed on
      ARMs. Firstly, 'Processor: ...' may not be reported, it's
      replaced by 'model name: ...'. Secondly, the "Processor" string
      may occur in CPU name, e.g. 'ARMv7 Processor rev 5 (v7l)'.
      Therefore, we must firstly look for 'model name' and then for
      'Processor' if not found.
      Moreover, lines in the cpuinfo file are shuffled, so we better
      not manipulate the pointer to start of internal buffer as we may
      lost some info.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      85128e29