1. 12 12月, 2017 1 次提交
    • M
      xenParseXLVnuma: Don't leak @tmp and @token · 747faf11
      Michal Privoznik 提交于
      ==30399== 180 (144 direct, 36 indirect) bytes in 3 blocks are definitely lost in loss record 91 of 111
      ==30399==    at 0x4C2E0FF: realloc (vg_replace_malloc.c:785)
      ==30399==    by 0x5574572: virReallocN (viralloc.c:245)
      ==30399==    by 0x5574668: virExpandN (viralloc.c:294)
      ==30399==    by 0x55747AB: virResizeN (viralloc.c:352)
      ==30399==    by 0x560074D: virStringSplitCount (virstring.c:115)
      ==30399==    by 0x137A59: xenParseXLVnuma (xen_xl.c:442)
      ==30399==    by 0x13952B: xenParseXL (xen_xl.c:1064)
      ==30399==    by 0x11884D: testCompareFormatXML (xlconfigtest.c:152)
      ==30399==    by 0x118A87: testCompareHelper (xlconfigtest.c:207)
      ==30399==    by 0x119E36: virTestRun (testutils.c:180)
      ==30399==    by 0x119186: mymain (xlconfigtest.c:274)
      ==30399==    by 0x11BEE3: virTestMain (testutils.c:1119)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      747faf11
  2. 25 11月, 2017 1 次提交
  3. 18 11月, 2017 1 次提交
  4. 13 11月, 2017 1 次提交
    • W
      xenconfig: add domxml conversions for xen-xl · 03d0959a
      Wim ten Have 提交于
      This patch converts NUMA configurations between the Xen libxl
      configuration file format and libvirt's XML format.
      
      XML HVM domain on a 4 node (2 cores/socket) configuration:
      
        <cpu>
          <numa>
            <cell id='0' cpus='0-1' memory='2097152' unit='KiB'>
              <distances>
                <sibling id='0' value='10'/>
                <sibling id='1' value='21'/>
                <sibling id='2' value='31'/>
                <sibling id='3' value='21'/>
              </distances>
            </cell>
            <cell id='1' cpus='2-3' memory='2097152' unit='KiB'>
              <distances>
                <sibling id='0' value='21'/>
                <sibling id='1' value='10'/>
                <sibling id='2' value='21'/>
                <sibling id='3' value='31'/>
              </distances>
            </cell>
            <cell id='2' cpus='3-4' memory='2097152' unit='KiB'>
              <distances>
                <sibling id='0' value='31'/>
                <sibling id='1' value='21'/>
                <sibling id='2' value='10'/>
                <sibling id='3' value='21'/>
              </distances>
            </cell>
            <cell id='3' cpus='5-6' memory='2097152' unit='KiB'>
              <distances>
                <sibling id='0' value='21'/>
                <sibling id='1' value='31'/>
                <sibling id='2' value='21'/>
                <sibling id='3' value='10'/>
              </distances>
            </cell>
          </numa>
        </cpu>
      
      Xen xl.cfg domain configuration:
      
        vnuma = [["pnode=0","size=2048","vcpus=0-1","vdistances=10,21,31,21"],
                 ["pnode=1","size=2048","vcpus=2-3","vdistances=21,10,21,31"],
                 ["pnode=2","size=2048","vcpus=4-5","vdistances=31,21,10,21"],
                 ["pnode=3","size=2048","vcpus=6-7","vdistances=21,31,21,10"]]
      
      If there is no XML <distances> description amongst the <cell> data the
      conversion schema from xml to native will generate 10 for local and 20
      for all remote instances.
      Signed-off-by: NWim ten Have <wim.ten.have@oracle.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      03d0959a
  5. 07 11月, 2017 1 次提交
  6. 20 9月, 2017 1 次提交
  7. 24 7月, 2017 1 次提交
  8. 21 7月, 2017 1 次提交
  9. 19 5月, 2017 1 次提交
  10. 28 4月, 2017 1 次提交
  11. 19 4月, 2017 1 次提交
    • J
      xenconfig: avoid double free on OOM testing · b2c12f57
      Jim Fehlig 提交于
      Fix xlconfig channel tests when OOM testing is enabled.
      
      TEST: xlconfigtest
      32) Xen XL-2-XML Format channel-unix                                  ... OK
          Test OOM for nalloc=55 ................................................*** Error in `/home/jfehlig/virt/upstream/libvirt/tests/.libs/xlconfigtest': double free or corruption (fasttop): 0x0000000000679550 ***
      ...
      (gdb) bt
      #0  0x00007ffff36875af in raise () from /lib64/libc.so.6
      #1  0x00007ffff36889aa in abort () from /lib64/libc.so.6
      #2  0x00007ffff36c5150 in __libc_message () from /lib64/libc.so.6
      #3  0x00007ffff36cb4f6 in malloc_printerr () from /lib64/libc.so.6
      #4  0x00007ffff36cbcee in _int_free () from /lib64/libc.so.6
      #5  0x00007ffff782babf in virFree (ptrptr=0x7fffffffdca8) at util/viralloc.c:582
      #6  0x000000000042f2f3 in xenParseXLChannel (conf=0x677350, def=0x6815b0) at xenconfig/xen_xl.c:788
      #7  0x000000000042f44e in xenParseXL (conf=0x677350, caps=0x6832b0, xmlopt=0x67f6e0) at xenconfig/xen_xl.c:828
      #8  0x00000000004105a3 in testCompareFormatXML (
          xlcfg=0x6811e0 "/home/jfehlig/virt/upstream/libvirt/tests/xlconfigdata/test-channel-unix.cfg",
          xml=0x681110 "/home/jfehlig/virt/upstream/libvirt/tests/xlconfigdata/test-channel-unix.xml", replaceVars=false)
          at xlconfigtest.c:152
      
      When a channel is successfully parsed and its path and name fields
      assigned from local variables, set the local variables to NULL to
      prevent a double free on error.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      b2c12f57
  12. 14 4月, 2017 1 次提交
    • W
      xenFormatXLDomainDisks: avoid double free on OOM testing · 2c1a31a3
      Wim ten Have 提交于
      Fix xlconfigtest runs build for --enable-test-oom on
              Xen XL-2-XML Parse  new-disk
      
          #0  0x00007ffff3bd791f in raise () from /lib64/libc.so.6
          #1  0x00007ffff3bd951a in abort () from /lib64/libc.so.6
          #2  0x00007ffff3c1b200 in __libc_message () from /lib64/libc.so.6
          #3  0x00007ffff3c2488a in _int_free () from /lib64/libc.so.6
          #4  0x00007ffff3c282bc in free () from /lib64/libc.so.6
          #5  0x00007ffff7864fcb in virFree (ptrptr=ptrptr@entry=0x7fffffffd868) at util/viralloc.c:582
          #6  0x00007ffff78776e5 in virConfFreeValue (val=<optimized out>) at util/virconf.c:178
      ==> #7  0x0000000000425759 in xenFormatXLDomainDisks (def=0x7fffffffd8c0, def=0x7fffffffd8c0, conf=0x658220)
              at xenconfig/xen_xl.c:1159
          #8  xenFormatXL (def=def@entry=0x66ec20, conn=conn@entry=0x668cf0) at xenconfig/xen_xl.c:1558
          #9  0x000000000040ea1d in testCompareParseXML (replaceVars=<optimized out>,
              xml=0x65f5e0 "/home/wtenhave/WORK/libvirt/history/libvirt/tests/xlconfigdata/test-fullvirt-ovmf.xml",
              xlcfg=0x65f6b0 "/home/wtenhave/WORK/libvirt/history/libvirt/tests/xlconfigdata/test-fullvirt-ovmf.cfg")
              at xlconfigtest.c:105
          #10 testCompareHelper (data=<optimized out>) at xlconfigtest.c:205
          #11 0x000000000041079a in virTestRun (title=title@entry=0x431cf0 "Xen XL-2-XML Parse  fullvirt-ovmf",
              body=body@entry=0x40e720 <testCompareHelper>, data=data@entry=0x7fffffffda50) at testutils.c:247
          #12 0x000000000040ebc2 in mymain () at xlconfigtest.c:256
          #13 0x0000000000411070 in virTestMain (argc=1, argv=0x7fffffffdc08, func=0x40f2c0 <mymain>) at testutils.c:992
          #14 0x00007ffff3bc2401 in __libc_start_main () from /lib64/libc.so.6
          #15 0x000000000040e5da in _start ()
      
      symmetry seems missing its sibbling coded functionality
      demonstrated under functions;
              xenFormatXLUSBController()
              xenFormatXLUSB()
              xenFormatXLDomainChannels()
              xenFormatXMDisks
      Signed-off-by: NWim ten Have <wim.ten.have@oracle.com>
      2c1a31a3
  13. 08 2月, 2017 1 次提交
  14. 07 2月, 2017 1 次提交
    • M
      xenFormatXLDisk: Don't leak @target · aaf0ac7e
      Michal Privoznik 提交于
      ==11260== 1,006 bytes in 1 blocks are definitely lost in loss record 106 of 111
      ==11260==    at 0x4C2AE5F: malloc (vg_replace_malloc.c:297)
      ==11260==    by 0x4C2BDFF: realloc (vg_replace_malloc.c:693)
      ==11260==    by 0x4EA430B: virReallocN (viralloc.c:245)
      ==11260==    by 0x4EA7C52: virBufferGrow (virbuffer.c:130)
      ==11260==    by 0x4EA7D28: virBufferAdd (virbuffer.c:165)
      ==11260==    by 0x4EA8E10: virBufferStrcat (virbuffer.c:718)
      ==11260==    by 0x42D263: xenFormatXLDiskSrcNet (xen_xl.c:960)
      ==11260==    by 0x42D4EB: xenFormatXLDiskSrc (xen_xl.c:1015)
      ==11260==    by 0x42D870: xenFormatXLDisk (xen_xl.c:1101)
      ==11260==    by 0x42DA89: xenFormatXLDomainDisks (xen_xl.c:1148)
      ==11260==    by 0x42EAF8: xenFormatXL (xen_xl.c:1558)
      ==11260==    by 0x40E85F: testCompareParseXML (xlconfigtest.c:105)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      aaf0ac7e
  15. 21 12月, 2016 1 次提交
  16. 15 12月, 2016 2 次提交
  17. 24 10月, 2016 1 次提交
  18. 22 10月, 2016 1 次提交
  19. 20 10月, 2016 2 次提交
    • J
      qemu: Introduce qemuDomainChardevPrivatePtr · 5f2a1327
      John Ferlan 提交于
      Modeled after the qemuDomainHostdevPrivatePtr (commit id '27726d8c'),
      create a privateData pointer in the _virDomainChardevDef to allow storage
      of private data for a hypervisor in order to at least temporarily store
      secret data for usage during qemuBuildCommandLine.
      
      NB: Since the qemu_parse_command (qemuParseCommandLine) code is not
      expecting to restore the secret data, there's no need to add code
      code to handle this new structure there.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      5f2a1327
    • C
      xl: fix 8126d870 broken test · 710d875f
      Cédric Bosdonnat 提交于
      xlconfigtest expects the comma, don't clean it up even if there is
      no target to write.
      710d875f
  20. 19 10月, 2016 1 次提交
  21. 28 9月, 2016 1 次提交
  22. 26 9月, 2016 1 次提交
  23. 02 8月, 2016 1 次提交
  24. 27 7月, 2016 1 次提交
  25. 11 7月, 2016 1 次提交
    • P
      conf: Add private data for virDomainVcpuDef · 5fe0b6b0
      Peter Krempa 提交于
      Allow to store driver specific data on a per-vcpu basis.
      
      Move of the virDomainDef*Vcpus* functions was necessary as
      virDomainXMLOptionPtr was declared below this block and I didn't want to
      split the function headers.
      5fe0b6b0
  26. 17 6月, 2016 1 次提交
    • J
      xenconfig: fix conversion of <driver> to backendtype · e33cd67a
      Jim Fehlig 提交于
      When converting domXML to xen xl.cfg, backendtype should
      not be emitted if <driver> is not specified. Moreover,
      <driver name='file'/> should be converted to backendtype
      qdisk, similar to handling of <driver> in libxlMakeDisk()
      in libxl_conf.c.
      
      Prior to this change, connectDomainXMLToNative would
      produce incorrect xl.cfg when the input domXML contained
      <driver name='file'/>
      
      domXML:
      
        <disk type="file" device="disk">
          <driver name="file"/>
          <source file="/image/file/path"/>
          <target dev="xvda" bus="xen"/>
        </disk>
      
      virsh domxml-to-native xen-xl domXML
      
      disk = [ "format=raw,vdev=xvda,access=rw,backendtype=target=/image/file/path" ]
      
      xl create xl.cfg
      config parsing error in disk specification: unknown value
      for backendtype: near `target=/image/file/path' in
      `format=raw,vdev=xvda,access=rw,backendtype=target=/image/file/path'
      e33cd67a
  27. 15 6月, 2016 1 次提交
  28. 14 6月, 2016 1 次提交
    • J
      xenconfig: support bios=ovmf xl.cfg · 53d98cce
      Jim Fehlig 提交于
      Add support to xenconfig for conversion of xl.cfg(5) bios config
      to/from libvirt domXml <loader> config. SeaBIOS is the default
      for HVM guests using upstream QEMU. ROMBIOS is the default when
      using the old qemu-dm. This patch allows specifying OVMF as an
      alternate firmware.
      
      Example xl.cfg:
        bios = "ovmf"
      
      Example domXML:
        <os>
          ...
          <loader readonly='yes' type='pflash'>/usr/lib/xen/boot/ovmf.bin</loader>
        </os>
      
      Note that currently Xen does not support a separate nvram for
      non-volatile variables.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      53d98cce
  29. 20 5月, 2016 1 次提交
  30. 18 5月, 2016 1 次提交
    • C
      xenFormatNet: correct `type=netfront' to 'type=vif' to match libxl · 03f8bba2
      Chunyan Liu 提交于
      According to current xl.cfg docs and xl codes, it uses type=vif
      instead of type=netfront.
      
      Currently after domxml-to-native, libvirt xml model=netfront will be
      converted to xl type=netfront. This has no problem before, xen codes
      for a long time just check type=ioemu, if not, set type to _VIF.
      
      Since libxl uses parse_nic_config to avoid duplicate codes, it
      compares 'type=vif' and 'type=ioemu' for valid parameters, others
      are considered as invalid, thus we have problem with type=netfront
      in xl config file.
       #xl create sles12gm-hvm.orig
       Parsing config from sles12gm-hvm.orig
       Invalid parameter `type'.
      
      Correct the conversion in libvirt, so that it matchs libxl codes
      and also xl.cfg.
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      03f8bba2
  31. 17 5月, 2016 1 次提交
  32. 16 4月, 2016 1 次提交
    • J
      Resolve a couple of memory leaks · 727a3c58
      John Ferlan 提交于
      Commit id '4b75237f' seems to have triggered Coverity into finding
      at least one memory leak in xen_xl.c for error path for cleanup where
      the listenAddr would be leaked. Reviewing other callers, it seems that
      qemu_parse_command.c would have the same issue, so just it too.
      727a3c58
  33. 13 4月, 2016 3 次提交
  34. 23 2月, 2016 3 次提交
    • M
      xen: Check return value of virStringReplace · e0392f5a
      Michal Privoznik 提交于
      After 6604a3dd in which new helper function has been
      introduced, the code calls virStringReplace and dereference the
      result immediately. The string function can, however, return NULL
      so this would SIGSEGV right away. Check for the return value of
      the string function.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e0392f5a
    • J
      xenconfig: support xl<->xml conversion of rbd disk devices · 6604a3dd
      Jim Fehlig 提交于
      The target= setting in xl disk configuration can be used to encode
      meta info that is meaningful to a backend. Leverage this fact to
      support qdisk network disk types such as rbd. E.g. <disk> config
      such as
      
         <disk type='network' device='disk'>
           <driver name='qemu' type='raw'/>
           <source protocol='rbd' name='pool/image'>
             <host name='mon1.example.org' port='6321'/>
             <host name='mon2.example.org' port='6322'/>
             <host name='mon3.example.org' port='6322'/>
           </source>
           <target dev='hdb' bus='ide'/>
           <address type='drive' controller='0' bus='0' target='0' unit='1'/>
         </disk>
      
      can be converted to the following xl config (and vice versa)
      
        disk = [ "format=raw,vdev=hdb,access=rw,backendtype=qdisk,
                  target=rbd:pool/image:auth_supported=none:mon_host=mon1.example.org\\:6321\\;mon2.example.org\\:6322\\;mon3.example.org\\:6322"
               ]
      
      Note that in xl disk config, a literal backslash in target= must
      be escaped with a backslash. Conversion of <auth> config is not
      handled in this patch, but can be done in a follow-up patch.
      
      Also add a test for the conversions.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      6604a3dd
    • J
      xenconfig: produce key=value disk config syntax in xl formatter · a44f1f85
      Jim Fehlig 提交于
      The most formal form of xl disk configuration uses key=value
      syntax to define each configuration item, e.g.
      
      format=raw, vdev=xvda, access=rw, backendtype=phy, target=disksrc
      
      Change the xl disk formatter to produce this syntax, which allows
      target= to contain meta info needed to setup a network-based
      disksrc (e.g. rbd, nbd, iscsi). For details on xl disk config
      format, see  $xen-src/docs/misc/xl-disk-configuration.txt
      
      Update the disk config in the tests to use the formal syntax.
      But add tests to ensure disks specified with the positional
      parameter syntax are correctly converted to <disk> XML.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      a44f1f85