1. 04 6月, 2015 5 次提交
    • P
      conf: Add new helpers to resolve virDomainModificationImpact to domain defs · 3d021381
      Peter Krempa 提交于
      virDomainLiveConfigHelperMethod that is used for this job now does
      modify the flags but still requires the callers to extract the correct
      definition objects.
      
      In addition coverity and other static analyzers are usually unhappy as
      they don't grasp the fact that @flags are upadted according to the
      correct def to be present.
      
      To work this issue around and simplify the calling chain let's add a new
      helper that will work only on drivers that always copy the persistent
      def to a transient at start of a vm. This will allow to drop a few
      arguments. The new function syntax will also fill two definition
      pointers rather than modifying the @flags parameter.
      3d021381
    • P
      conf: Store cpu count as unsigned int · fbbea798
      Peter Krempa 提交于
      While we probably won't see machines with more than 65536 cpus for a
      while lets store the cpu count as an integer so that we can avoid quite
      a lot of overflow checks in our code.
      fbbea798
    • J
      Always add 'console' matching the 'serial' device · 8728a78e
      Ján Tomko 提交于
      We have been formatting the first serial device also
      as a console device, but only if there were no other consoles.
      
      If there is a <serial> device present in the XML, but no serial
      <console>, or if there isn't any <console> at all but the domain
      definition hasn't gone through a parse->format->parse round-trip,
      the <console> device would not be formatted.
      
      Change the code to always add the stub device for the first
      serial device.
      
      Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1089914
      8728a78e
    • J
      maint: remove incorrect apostrophes from 'its' · 12b949df
      Ján Tomko 提交于
      12b949df
    • S
      check if console/channel PTY is null before attempting to open · eac9445e
      Shivaprasad G Bhat 提交于
      Console/channel devices have their pty devices assigned when the emulator is
      actually started. If time is spent in guest preparation, someone attempts
      to open the console/channel, the libvirt crashes in virChrdevLockFilePath().
      The patch attempts to fix the crash by adding a check before attempting to
      open.
      Signed-off-by: NShivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
      eac9445e
  2. 03 6月, 2015 7 次提交
  3. 29 5月, 2015 1 次提交
    • J
      Properly free the xmlDocPtr when loading pool state · 5aa72904
      Ján Tomko 提交于
      Use xmlFreeDoc instead of plain xmlFree.
      
      4 bytes in 1 blocks are definitely lost in loss record 9 of 1,084
          at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
          by 0x70730D6: xmlStrndup (in /usr/lib64/libxml2.so.2.9.2)
          by 0x701E3DC: xmlNewDoc (in /usr/lib64/libxml2.so.2.9.2)
          by 0x70C39F8: xmlSAX2StartDocument (in /usr/lib64/libxml2.so.2.9.2)
          by 0x7017245: xmlParseDocument (in /usr/lib64/libxml2.so.2.9.2)
          by 0x7017606: xmlDoRead (in /usr/lib64/libxml2.so.2.9.2)
          by 0x5309DAD: virXMLParseHelper (virxml.c:742)
          by 0x5367584: virStoragePoolLoadState (storage_conf.c:1863)
      5aa72904
  4. 28 5月, 2015 1 次提交
  5. 27 5月, 2015 1 次提交
  6. 26 5月, 2015 3 次提交
    • 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
      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
  7. 24 5月, 2015 1 次提交
  8. 22 5月, 2015 1 次提交
  9. 21 5月, 2015 3 次提交
  10. 20 5月, 2015 3 次提交
    • P
      conf: Catch memory size overflow earlier · bc89ebe5
      Peter Krempa 提交于
      virDomainParseMemory parses the size and then rounds up while converting
      it to kibibytes. Since the number is limit-checked before the rounding
      it's possible to use a number that would be correctly parsed the first
      time, but not the second time. For numbers not limited to 32 bit systems
      the magic is 9223372036854775807 bytes. That number then can't be parsed
      back in kibibytes.
      
      To solve the issue add a second overflow check for the few values that
      would cause the problem. Since virDomainParseMemory is used in config
      parsing, this avoids vanishing VMs.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1221504
      bc89ebe5
    • M
      virDomainNumatuneGetMode: Report if numatune was defined · bcd9a564
      Michal Privoznik 提交于
      So far, we are not reporting if numatune was even defined. The
      value of zero is blindly returned (which maps onto
      VIR_DOMAIN_NUMATUNE_MEM_STRICT). Unfortunately, we are making
      decisions based on this value. Instead, we should not only return
      the correct value, but report to the caller if the value is valid
      at all.
      
      For better viewing of this patch use '-w'.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      bcd9a564
    • J
      Taint domains using cdrom-passthrough · 99a2d6af
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=976387
      
      For a domain configured using the host cdrom, we should taint the domain
      due to problems encountered when the host and guest try to control the tray.
      99a2d6af
  11. 18 5月, 2015 2 次提交
  12. 16 5月, 2015 1 次提交
  13. 15 5月, 2015 3 次提交
  14. 14 5月, 2015 2 次提交
    • J
      reject out of range memory in SetMemory APIs · 3511c122
      Ján Tomko 提交于
      The APIs take the memory value in KiB and we store it in KiB
      internally, but we cannot parse the whole ULONG_MAX range
      on 64-bit systems, because virDomainParseScaledValue
      needs to fit the value in bytes in an unsigned long long.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1176739
      3511c122
    • J
      conf: Expose iothreadids when delete non sequential iothreadids · 375c185c
      John Ferlan 提交于
      Since 'autofill'd iothreadid entries are not written during XML format
      processing, it is possible that if an iothreadid in the middle of an
      autofilled list would then change it's id on a subsequent restart.
      
      Thus during the iothreadid deletion, if we determine the delete is not
      the "last" thread, then clear the autofill bit for all iothreadid's
      following the one being deleted (either the first or one in the middle).
      This way, iothreadid's will be printed/saved.
      375c185c
  15. 13 5月, 2015 2 次提交
    • J
      conf: Remove source host name check for iSCSI · 4b2b53f6
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1171984
      https://bugzilla.redhat.com/show_bug.cgi?id=1188463
      
      Remove the check for the source host name for iSCSI source XML processing
      declaring duplicate sources when the source device path and if present the
      initiator of a proposed storage pool matches an existing storage pool.
      
      The backend iSCSI storage driver uses 'iscsiadm --mode session' to query
      available iscsid target sessions. The output displayed is the IP address
      and the IQN (target path) of known targets. The displayed IP address
      is a resolved address based on the session --login. Additionally, iscsid
      keeps track of the various ways to define the host name (IPv4 Address,
      IPv6 Address, /etc/hosts, etc.) for that IQN (see output of an 'iscsiadm
      --mode node'). If an incoming IQN matches and the host name provided by
      libvirt is resolved to the existing IQN, then iscsid will "reuse" the
      session. Although libvirt could do the same name resolution, if there
      is a difference, iscsid could still declare two seemingly different sources
      to be the same and not create a new session which means libvirt now has
      two storage pools looking at the same source. Thus to avoid any strange
      host name resolution issues, just rely on iscsid for that and do not
      allow multiple pools on the same host to use the same device path (IQN).
      4b2b53f6
    • J
      conf: Adjust duplicate source host port check · 6dd9297c
      John Ferlan 提交于
      Only perform the port number check if the incoming definition actually
      provides it. Since the port number is optional we could erroneously pass
      a duplicate source host check since some storage pool backends which fill
      in the default port number (e.g., iSCSI and sheepdog) for the started pool.
      6dd9297c
  16. 12 5月, 2015 2 次提交
  17. 11 5月, 2015 2 次提交