1. 20 2月, 2018 2 次提交
    • M
      virDomainDiskSourceFormatInternal: Avoid leaking @childBuf · 4e657f2a
      Michal Privoznik 提交于
      If formatting of storage encryption or private data fails we must
      jump to the error label instead of returning immediately
      otherwise @attrBuf and @childBuf might be leaked.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      4e657f2a
    • L
      conf: move 'generated' member from virMacAddr to virDomainNetDef · e62cb4a9
      Laine Stump 提交于
      Commit 7e62c4cd (first appearing in libvirt-3.9.0 as a resolution
      to rhbz #1343919) added a "generated" attribute to virMacAddr that was
      set whenever a mac address was auto-generated by libvirt. This
      knowledge was used in a single place - when trying to match a NetDef
      from the Domain to Delete with user-provided XML. Since the XML parser
      always auto-generates a MAC address for NetDefs when none is provided,
      it was previously impossible to make a search where the MAC address
      isn't significant, but the addition of the "generated" attribute made
      it possible for the search function to ignore auto-generated MACs.
      
      This implementation had a problem though - it was adding a field to a
      "low level" struct - virMacAddr - which is used in other places with
      the assumption that it contains exactly a 6 byte MAC address and
      nothing else. In particular, virNWFilterSnoopEthHdr uses virMacAddr as
      part of the definition of an ethernet packet header, whose layout must
      of course match an actual ethernet packet. Adding the extra bools into
      virNWFilterSnoopEthHdr caused the nwfilter driver's "IP discovery via
      DHCP packet snooping" functionality to mysteriously stop working.
      
      In order to fix that behavior, and prevent potential future similar
      odd behavior, this patch moves the "generated" member out of
      virMacAddr (so that it is again really is just a MAC address) into
      virDomainNetDef, and sets it only when virDomainNetGenerateMAC() is
      called from virDomainNetDefParseXML() (which is the only time we care
      about it).
      
      Resolves: https://bugzilla.redhat.com/1529338
      
      (It should also be applied to any maintenance branch that applies
      commit 7e62c4cd and friends to resolve
      https://bugzilla.redhat.com/1343919)
      Signed-off-by: NLaine Stump <laine@laine.org>
      e62cb4a9
  2. 19 2月, 2018 2 次提交
  3. 17 2月, 2018 1 次提交
    • Z
      conf: Add support for setting Chassis SMBIOS data fields · c8fec256
      Zhuang Yanying 提交于
      This type of information defines attributes of a system
      chassis, such as SMBIOS Chassis Asset Tag.
      
      access inside VM (for example)
      Linux:   /sys/class/dmi/id/chassis_asset_tag.
      Windows: (Get-WmiObject Win32_SystemEnclosure).SMBIOSAssetTag
                wirhin Windows PowerShell.
      
      As an example, add the following to the guest XML
      
          <chassis>
            <entry name='manufacturer'>Dell Inc.</entry>
            <entry name='version'>2.12</entry>
            <entry name='serial'>65X0XF2</entry>
            <entry name='asset'>40000101</entry>
            <entry name='sku'>Type3Sku1</entry>
          </chassis>
      Signed-off-by: NZhuang Yanying <ann.zhuangyanying@huawei.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      c8fec256
  4. 13 2月, 2018 5 次提交
  5. 09 2月, 2018 4 次提交
  6. 05 2月, 2018 1 次提交
    • P
      util: bitmap: Use VIR_SHRINK_N in virBitmapShrink · e88a08e8
      Peter Krempa 提交于
      The function only reduces the size of the bitmap thus we can use the
      appropriate shrinking function which also does not have any return
      value.
      
      Since virBitmapShrink now does not return any value callers need to be
      fixed as well.
      e88a08e8
  7. 02 2月, 2018 1 次提交
  8. 01 2月, 2018 4 次提交
  9. 31 1月, 2018 1 次提交
  10. 26 1月, 2018 2 次提交
  11. 25 1月, 2018 1 次提交
  12. 04 1月, 2018 2 次提交
    • J
      conf: Fix generating addresses for SCSI hostdev · 8d424f1b
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1519130
      
      Commit id 'dc692438' reverted the automagic addition of a SCSI
      controller attempt during virDomainHostdevAssignAddress; however,
      the logic to determine where to place the next_unit depended upon
      the "new" controller being added.  Without the new controller the
      the next time through the call for the next SCSI hostdev found
      would result in the "next_unit" never changing from 0 (zero) and
      as a result the addition of the device will fail due to being a
      duplicate unit number of the first with the error message:
      
        virDomainDefCheckDuplicateDriveAddresses:$line : unsupported
            configuration: SCSI host address controller='0' bus='1'
            target='0' unit='0' in use by another SCSI host device
      
      So instead of walking the controller list looking for SCSI
      controllers, all we can do is "pretend" that they exist and
      allow other code to create them later as necessary.
      8d424f1b
    • J
      conf: Use existing SCSI hostdev model to create new · c52dbafe
      John Ferlan 提交于
      In virDomainDefMaybeAddHostdevSCSIcontroller when we add a new
      controller because someone neglected to add one or we're adding
      one because the existing one is full, we should copy over the
      model number from the existing controller since whatever we
      create should at least have the same characteristics as the one
      we cannot use because it's full.
      
      NB: This affects the existing hostdev-scsi-autogen-address test
      which would add a default ('lsi') SCSI controller for the various
      scsi_host's that would create a controller for the hostdev.
      c52dbafe
  13. 14 12月, 2017 1 次提交
    • P
      conf: Add infrastructure for disk source private data XML · aed3d038
      Peter Krempa 提交于
      VM drivers may need to store additional private data to the status XML
      so that it can be restored after libvirtd restart. Since not everything
      is needed add a callback infrastructure, where VM drivers can add only
      stuff they need.
      
      Note that the private data is formatted as a <privateData> sub-element
      of the <disk> or <backingStore> <source> sub-element. This is done since
      storing it out of band (in the VM private data) would require a complex
      matching process to allow to put the data into correct place.
      aed3d038
  14. 01 12月, 2017 3 次提交
    • M
      virDomainDiskBackingStoreParse: Don't leak @idx · 0fd85b98
      Michal Privoznik 提交于
      ==1277== 8 bytes in 4 blocks are definitely lost in loss record 39 of 131
      ==1277==    at 0x4C2AEDF: malloc (vg_replace_malloc.c:299)
      ==1277==    by 0x68BBBC8: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
      ==1277==    by 0x53B1DC2: virXMLPropString (virxml.c:510)
      ==1277==    by 0x53D696A: virDomainDiskBackingStoreParse (domain_conf.c:8639)
      ==1277==    by 0x53DA684: virDomainDiskDefParseXML (domain_conf.c:9590)
      ==1277==    by 0x53F619F: virDomainDefParseXML (domain_conf.c:19233)
      ==1277==    by 0x53F96EE: virDomainDefParseNode (domain_conf.c:20083)
      ==1277==    by 0x53F9540: virDomainDefParse (domain_conf.c:20027)
      ==1277==    by 0x53F95E6: virDomainDefParseFile (domain_conf.c:20053)
      ==1277==    by 0x44D1D4: testCompareDomXML2XMLFiles (testutils.c:1265)
      ==1277==    by 0x42FC7C: testXML2XMLActive (qemuxml2xmltest.c:71)
      ==1277==    by 0x44AD20: virTestRun (testutils.c:180)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0fd85b98
    • M
      virDomainDiskSourceNetworkParse: Don't leak @tlsCfg or @haveTLS · 7d7c01b4
      Michal Privoznik 提交于
      ==861== 3 bytes in 1 blocks are definitely lost in loss record 3 of 168
      ==861==    at 0x4C2AEDF: malloc (vg_replace_malloc.c:299)
      ==861==    by 0x8C7FBC8: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
      ==861==    by 0x5DCCDC2: virXMLPropString (virxml.c:510)
      ==861==    by 0x5DF1232: virDomainDiskSourceNetworkParse (domain_conf.c:8445)
      ==861==    by 0x5DF1728: virDomainDiskSourceParse (domain_conf.c:8576)
      ==861==    by 0x5DF41A5: virDomainDiskDefParseXML (domain_conf.c:9238)
      ==861==    by 0x5E1119F: virDomainDefParseXML (domain_conf.c:19233)
      ==861==    by 0x5E146EE: virDomainDefParseNode (domain_conf.c:20083)
      ==861==    by 0x5E14540: virDomainDefParse (domain_conf.c:20027)
      ==861==    by 0x5E145E6: virDomainDefParseFile (domain_conf.c:20053)
      ==861==    by 0x4053CC: testCompareXMLToArgv (qemuxml2argvtest.c:455)
      ==861==    by 0x41F135: virTestRun (testutils.c:180)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      7d7c01b4
    • P
      conf: fix migratable XML for graphics if socket is generated based on config · cb06ea57
      Pavel Hrdina 提交于
      The graphics code is complex and there are a lot of exceptions and
      backward compatible combinations.  One of them is the possibility
      to configure "spice_auto_unix_socket" in qemu.conf which will convert
      all spice graphics with listen type "address" without any address
      specified to listen type "socket" when the guest is started.
      
      We don't format this generated socket into migratable XML to make
      migration work with older libvirt.  However, spice has another
      exception that if autoport='no' and there is no port configured
      it is converted to listen type "none".  Because of this we need
      to format autoport='yes' to make sure that the listen type will
      be the same as the offline XML.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511407Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      cb06ea57
  15. 30 11月, 2017 1 次提交
  16. 28 11月, 2017 9 次提交