1. 03 9月, 2015 1 次提交
    • M
      remoteClientCloseFunc: Don't mangle connection object refcount · 8630f8db
      Michal Privoznik 提交于
      Well, in 8ad126e6 we tried to fix a memory corruption problem.
      However, the fix was not as good as it could be. I mean, the
      commit has one line more than it should. I've noticed this output
      just recently:
      
        # ./run valgrind --leak-check=full --show-reachable=yes ./tools/virsh domblklist gentoo
        ==17019== Memcheck, a memory error detector
        ==17019== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
        ==17019== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
        ==17019== Command: /home/zippy/work/libvirt/libvirt.git/tools/.libs/virsh domblklist gentoo
        ==17019==
        Target     Source
        ------------------------------------------------
        fda        /var/lib/libvirt/images/fd.img
        vda        /var/lib/libvirt/images/gentoo.qcow2
        hdc        /home/zippy/tmp/install-amd64-minimal-20150402.iso
      
        ==17019== Thread 2:
        ==17019== Invalid read of size 4
        ==17019==    at 0x4EFF5B4: virObjectUnref (virobject.c:258)
        ==17019==    by 0x5038CFF: remoteClientCloseFunc (remote_driver.c:552)
        ==17019==    by 0x5069D57: virNetClientCloseLocked (virnetclient.c:685)
        ==17019==    by 0x506C848: virNetClientIncomingEvent (virnetclient.c:1852)
        ==17019==    by 0x5082136: virNetSocketEventHandle (virnetsocket.c:1913)
        ==17019==    by 0x4ECD64E: virEventPollDispatchHandles (vireventpoll.c:509)
        ==17019==    by 0x4ECDE02: virEventPollRunOnce (vireventpoll.c:658)
        ==17019==    by 0x4ECBF00: virEventRunDefaultImpl (virevent.c:308)
        ==17019==    by 0x130386: vshEventLoop (vsh.c:1864)
        ==17019==    by 0x4F1EB07: virThreadHelper (virthread.c:206)
        ==17019==    by 0xA8462D3: start_thread (in /lib64/libpthread-2.20.so)
        ==17019==    by 0xAB441FC: clone (in /lib64/libc-2.20.so)
        ==17019==  Address 0x139023f4 is 4 bytes inside a block of size 240 free'd
        ==17019==    at 0x4C2B1F0: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
        ==17019==    by 0x4EA8949: virFree (viralloc.c:582)
        ==17019==    by 0x4EFF6D0: virObjectUnref (virobject.c:273)
        ==17019==    by 0x4FE74D6: virConnectClose (libvirt.c:1390)
        ==17019==    by 0x13342A: virshDeinit (virsh.c:406)
        ==17019==    by 0x134A37: main (virsh.c:950)
      
      The problem is, when registering remoteClientCloseFunc(), it's
      conn->closeCallback which is ref'd. But in the function itself
      it's conn->closeCallback->conn what is unref'd. This is causing
      imbalance in reference counting. Moreover, there's no need for
      the remote driver to increase/decrease conn refcount since it's
      not used anywhere. It's just merely passed to client registered
      callback. And for that purpose it's correctly ref'd in
      virConnectRegisterCloseCallback() and then unref'd in
      virConnectUnregisterCloseCallback().
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      (cherry picked from commit e6893007)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      8630f8db
  2. 29 8月, 2015 1 次提交
  3. 17 6月, 2015 1 次提交
    • E
      lxc: set nosuid+nodev+noexec flags on /proc/sys mount · f773f547
      Eric W. Biederman 提交于
      Future kernels will mandate the use of nosuid+nodev+noexec
      flags when mounting the /proc/sys filesystem. Unconditionally
      add them now since they don't harm things regardless and could
      mitigate future security attacks.
      
      (cherry picked from commit 24710414)
      
      Conflicts:
          src/lxc/lxc_container.c
      f773f547
  4. 30 1月, 2015 1 次提交
    • M
      xend: Don't crash in virDomainXMLDevID · 4c0b3bf1
      Michal Privoznik 提交于
      The function is called from all {Attach,Update,Detach}Device APIs to
      create config strings that are later passed to the xend to perform the
      desired action. The function is intended to handle all supported
      devices. However, as of 5b05358a we
      are trying to get disk driver of the device without checking if the
      device really is a disk. This leads to an segmentation fault:
      
        #0 0x00007ffff7571815 in virDomainDiskGetDriver () from /usr/lib/libvirt.so.0
        #1 0x00007fffeb9ad471 in ?? () from /usr/lib/libvirt/connection-driver/libvirt_driver_xen.so
        #2 0x00007fffeb9b1062 in xenDaemonAttachDeviceFlags () from /usr/lib/libvirt/connection-driver/libvirt_driver_xen.so
        #3 0x00007fffeb9a8a86 in ?? () from /usr/lib/libvirt/connection-driver/libvirt_driver_xen.so
        #4 0x00007ffff7609266 in virDomainAttachDevice () from /usr/lib/libvirt.so.0
        #5 0x0000555555593c9d in ?? ()
        #6 0x00007ffff76743c9 in virNetServerProgramDispatch () from /usr/lib/libvirt.so.0
        #7 0x00005555555a678d in ?? ()
        #8 0x00007ffff755460e in ?? () from /usr/lib/libvirt.so.0
        #9 0x00007ffff7553b06 in ?? () from /usr/lib/libvirt.so.0
        #10 0x00007ffff4998b50 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
        #11 0x00007ffff46e30ed in clone () from /lib/x86_64-linux-gnu/libc.so.6
        #12 0x0000000000000000 in ?? ()
      Reported-by: NXiaolin Su <linxxnil@126.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      (cherry picked from commit cd7702d4)
      4c0b3bf1
  5. 23 1月, 2015 2 次提交
  6. 23 12月, 2014 1 次提交
  7. 13 11月, 2014 1 次提交
    • L
      util: eliminate "use after free" in callers of virNetDevLinkDump · 94be529b
      Laine Stump 提交于
      virNetDevLinkDump() gets a message from netlink into "resp", then
      calls nlmsg_parse() to fill the table "tb" with pointers into resp. It
      then returns tb to its caller, but not before freeing the buffer at
      resp. That means that all the callers of virNetDevLinkDump() are
      examining memory that has already been freed. This can be verified by
      filling the buffer at resp with garbage prior to freeing it (or, I
      suppose, just running libvirtd under valgrind) then performing some
      operation that calls virNetDevLinkDump().
      
      The upstream commit log incorrectly states that the code has been like
      this ever since virNetDevLinkDump() was written. In reality, the
      problem was introduced with commit e95de74d, first in libvirt-1.0.5,
      which was attempting to eliminate a typecast that caused compiler
      warnings. It has only been pure luck (or maybe a lack of heavy load,
      and/or maybe an allocation algorithm in malloc() that delays re-use of
      just-freed memory) that has kept this from causing errors, for example
      when configuring a PCI passthrough or macvtap passthrough network
      interface.
      
      The solution taken in this patch is the simplest - just return resp to
      the caller along with tb, then have the caller free it after they are
      finished using the data (pointers) in tb. I alternately could have
      made a cleaner interface by creating a new struct that put tb and resp
      together along with a vir*Free() function for it, but this function is
      only used in a couple places, and I'm not sure there will be
      additional new uses of virNetDevLinkDump(), so the value of adding a
      new type, extra APIs, etc. is dubious.
      
      (cherry picked from commit f9f9699f)
      94be529b
  8. 07 11月, 2014 1 次提交
    • E
      CVE-2014-7823: dumpxml: security hole with migratable flag · 0ea4cd2f
      Eric Blake 提交于
      Commit 28f8dfdc (v1.0.0) introduced a security hole: in at least
      the qemu implementation of virDomainGetXMLDesc, the use of the
      flag VIR_DOMAIN_XML_MIGRATABLE (which is usable from a read-only
      connection) triggers the implicit use of VIR_DOMAIN_XML_SECURE
      prior to calling qemuDomainFormatXML.  However, the use of
      VIR_DOMAIN_XML_SECURE is supposed to be restricted to read-write
      clients only.  This patch treats the migratable flag as requiring
      the same permissions, rather than analyzing what might break if
      migratable xml no longer includes secret information.
      
      Fortunately, the information leak is low-risk: all that is gated
      by the VIR_DOMAIN_XML_SECURE flag is the VNC connection password;
      but VNC passwords are already weak (FIPS forbids their use, and
      on a non-FIPS machine, anyone stupid enough to trust a max-8-byte
      password sent in plaintext over the network deserves what they
      get).  SPICE offers better security than VNC, and all other
      secrets are properly protected by use of virSecret associations
      rather than direct output in domain XML.
      
      * src/remote/remote_protocol.x (REMOTE_PROC_DOMAIN_GET_XML_DESC):
      Tighten rules on use of migratable flag.
      * src/libvirt-domain.c (virDomainGetXMLDesc): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      (cherry picked from commit b1674ad5)
      
      Conflicts:
      	src/libvirt-domain.c - file split from older src/libvirt.c
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0ea4cd2f
  9. 02 10月, 2014 1 次提交
  10. 18 9月, 2014 1 次提交
  11. 14 8月, 2014 1 次提交
  12. 08 8月, 2014 2 次提交
    • E
      blockjob: fix use-after-free in blockcopy · 9617e31b
      Eric Blake 提交于
      Commit febf84c2 tried to delay in-memory modification of the actual
      domain disk structure until after the qemu event was received.
      However, I missed that the code for block pivot had been temporarily
      setting disk->src = disk->mirror prior to the qemu command, in order
      to label the backing chain of a reused external blockcopy disk;
      and calls into qemu while still in that state before finally undoing
      things at the cleanup label.  Since the qemu event handler then does:
       virStorageSourceFree(disk->src);
       disk->src = disk->mirror;
      we have the sad race that a fast enough qemu event can cause a leak of
      the original disk->src, as well as a use-after-free of the disk->mirror
      contents, bad enough to crash libvirtd in some of my test runs, even
      though the common case of the qemu event being much later won't trip
      the race.
      
      I'll go wear the brown paper bag of shame, for introducing a crasher
      in between rc1 and rc2 of the freeze for 1.2.7 :(  My only
      consolation is that virDomainBlockJobAbort requires the domain:write
      ACL, so it is not a CVE.
      
      The valgrind report when the race occurs looks like:
      
      ==25612== Invalid read of size 4
      ==25612==    at 0x50E7C90: virStorageSourceGetActualType (virstoragefile.c:1948)
      ==25612==    by 0x209C0B18: qemuDomainDetermineDiskChain (qemu_domain.c:2473)
      ==25612==    by 0x209D7F6A: qemuProcessHandleBlockJob (qemu_process.c:1087)
      ==25612==    by 0x209F40C9: qemuMonitorEmitBlockJob (qemu_monitor.c:1357)
      ...
      ==25612==  Address 0xe4b5610 is 0 bytes inside a block of size 200 free'd
      ==25612==    at 0x4A07577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==25612==    by 0x50839E9: virFree (viralloc.c:582)
      ==25612==    by 0x50E7E51: virStorageSourceFree (virstoragefile.c:2015)
      ==25612==    by 0x209D7EFF: qemuProcessHandleBlockJob (qemu_process.c:1073)
      ==25612==    by 0x209F40C9: qemuMonitorEmitBlockJob (qemu_monitor.c:1357)
      
      * src/qemu/qemu_driver.c (qemuDomainBlockPivot): Don't corrupt
      disk->src, and only label chain for blockcopy.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      (cherry picked from commit 265680c5)
      9617e31b
    • E
      blockjob: avoid memory leak during block pivot · 7620b422
      Eric Blake 提交于
      Valgrind caught a memory leak:
      
      ==2018== 9 bytes in 1 blocks are definitely lost in loss record 143 of 927
      ==2018==    at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==2018==    by 0x8C42369: strdup (strdup.c:42)
      ==2018==    by 0x50EACC9: virStrdup (virstring.c:676)
      ==2018==    by 0x50E79E5: virStorageSourceCopy (virstoragefile.c:1845)
      ==2018==    by 0x20A3FAA7: qemuDomainBlockCommit (qemu_driver.c:15620)
      ==2018==    by 0x51DC6B2: virDomainBlockCommit (libvirt.c:20092)
      
      I traced it to the fact that blockcopy and blockcommit end up
      reparsing a backing chain on pivot, but the chain parsing code
      doesn't gracefully handle the case where the backing file is
      already known.
      
      I'm not exactly sure when this was introduced, but suspect that the
      refactoring in commit 9944b710 and friends that moved towards probing
      in-place rather than into a temporary structure are part of the cause.
      
      * src/util/virstoragefile.c (virStorageFileGetMetadataInternal):
      Don't leak any prior value.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      (cherry picked from commit a595a005)
      7620b422
  13. 06 8月, 2014 1 次提交
  14. 03 8月, 2014 3 次提交
    • D
      Release of libvirt-1.2.7 · 21b59b65
      Daniel Veillard 提交于
      * docs/news.html.in libvirt.spec.in: update for the release
      * po/*.po*: update localizations and regenerate
      21b59b65
    • E
      build: fix build on cygwin · 478d93ad
      Eric Blake 提交于
      Cygwin has getifaddrs(), but not AF_LINK, leading to:
      
      util/virstats.c: In function 'virNetInterfaceStats':
      util/virstats.c:138:41: error: 'AF_LINK' undeclared (first use in this function)
               if (ifa->ifa_addr->sa_family != AF_LINK)
      ...
      
      * src/util/virstats.c (virNetInterfaceStats): Only use getifaddrs
      if AF_LINK is present.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      478d93ad
    • L
      network: always set disable_ipv6, even when it should be 0 · c0788af0
      Laine Stump 提交于
      libvirt previously only touched an interface's disable_ipv6 setting in
      sysfs if it needed to be set to 1, assuming that 0 is the
      default. Apparently that isn't always the case though (kernel 3.15.7-1
      in Arch Linux reportedly defaults a new interface's disable_ipv6
      setting to 1) so this patch explicitly sets it to 0 or 1 as
      appropriate.
      c0788af0
  15. 01 8月, 2014 1 次提交
  16. 30 7月, 2014 7 次提交
    • R
      docs: bhyve: document recent changes · 221b1828
      Roman Bogorodskiy 提交于
       - mention that one disk and one network limitation
         is no longer current for 1.2.6 and newer
       - add 'cdrom' device to the sample domain XML
      221b1828
    • E
      blockcommit: turn on active commit · cfb16b8e
      Eric Blake 提交于
      With this in place, I can (finally!) now do:
      
      virsh blockcommit $dom vda --shallow --verbose --pivot
      
      and watch qemu shorten the backing chain by one, followed by
      libvirt automatically updating the dumpxml output, effectively
      undoing the work of virsh snapshot-commit --no-metadata --disk-only.
      Commit is SOOOO much faster than blockpull, when I'm still fairly
      close in time to when the temporary qcow2 wrapper file was created
      via a snapshot operation!
      
      * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Implement live
      commit.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      cfb16b8e
    • E
      blockcommit: track job type in xml · 232a31be
      Eric Blake 提交于
      A future patch is going to wire up qemu active block commit jobs;
      but as they have similar events and are canceled/pivoted in the
      same way as block copy jobs, it is easiest to track all bookkeeping
      for the commit job by reusing the <mirror> element.  This patch
      adds domain XML to track which job was responsible for creating a
      mirroring situation, and adds a job='copy' attribute to all
      existing uses of <mirror>.  Along the way, it also massages the
      qemu monitor backend to read the new field in order to generate
      the correct type of libvirt job (even though it requires a
      future patch to actually cause a qemu event that can be reported
      as an active commit).  It also prepares to update persistent XML
      to match changes made to live XML when a copy completes.
      
      * docs/schemas/domaincommon.rng: Enhance schema.
      * docs/formatdomain.html.in: Document it.
      * src/conf/domain_conf.h (_virDomainDiskDef): Add a field.
      * src/conf/domain_conf.c (virDomainBlockJobType): String conversion.
      (virDomainDiskDefParseXML): Parse job type.
      (virDomainDiskDefFormat): Output job type.
      * src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Distinguish
      active from regular commit.
      * src/qemu/qemu_driver.c (qemuDomainBlockCopy): Set job type.
      (qemuDomainBlockPivot, qemuDomainBlockJobImpl): Clean up job type
      on completion.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml:
      Update tests.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-active-commit.xml: New
      file.
      * tests/qemuxml2xmltest.c (mymain): Drive new test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      232a31be
    • C
      Domain config: write <features/> if some capabilities are set. · 251d75a8
      Cédric Bosdonnat 提交于
      If all features are set to default (including the capabilities policy),
      but some capabilities are toggled, we need to output the <features>
      element when formatting the config.
      251d75a8
    • C
      docs: fix an incorrect example for memoryBacking · 24c55ee0
      Chen Hanxiao 提交于
      commit 136ad497
      forgot to add an end-tags for hugepages.
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      24c55ee0
    • E
      blockjob: properly track blockcopy xml changes on disk · febf84c2
      Eric Blake 提交于
      We were not directly saving the domain XML to file after starting
      or finishing a blockcopy.  Without the startup write, a libvirtd
      restart in the middle of a copy job would forget that the job was
      underway.  Then at pivot, we were indirectly writing new XML in
      reaction to events that occur as we stop and restart the guest CPUs.
      But there was a race: since pivot is an async action, it is possible
      that libvirtd is restarted before the pivot completes, so if XML
      changes during the event, that change was not written.  The original
      blockcopy code cleared out the <mirror> element prior to restarting
      the CPUs, but this is also a race, observed if a user does an async
      pivot and a dumpxml before the event occurs.  Furthermore, this race
      will interfere with active commit in a future patch, because that
      code will rely on the <mirror> element at the time of the qemu event
      to determine whether to inform the user of a normal commit or an
      active commit.
      
      Fix things by saving state any time we modify live XML, while
      delaying XML disk modifications until after the event completes.  We
      still need a to teach libvirtd restarts to examine all existing
      <mirror> elements to see if the job completed in the meantime (that
      is, if libvirtd misses the event, the updated state still needs to be
      updated in live XML), but that will be a later patch, in part because
      we also need to to start taking advantage of newer qemu's ability to
      keep the job around after completion rather than the current usage
      where the job disappears both on error and on success.
      
      * src/qemu/qemu_driver.c (qemuDomainBlockCopy): Track XML change
      on disk.
      (qemuDomainBlockJobImpl, qemuDomainBlockPivot): Move job-end XML
      rewrites...
      * src/qemu/qemu_process.c (qemuProcessHandleBlockJob): ...here.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      febf84c2
    • E
      blockcopy: add more XML for state tracking · 9a212d67
      Eric Blake 提交于
      Doing a blockcopy operation across a libvirtd restart is not very
      robust at the moment.  In particular, we are clearing the <mirror>
      element prior to telling qemu to finish the job.  Also, thanks to the
      ability to request async completion, the user can easily regain
      control prior to qemu actually finishing the effort, and they should
      be able to poll the domain XML to see if the job is still going.
      
      A future patch will fix things to actually wait until qemu is done
      before modifying the XML to reflect the job completion.  But since
      qemu issues identical BLOCK_JOB_COMPLETE events regardless of whether
      the job was cancelled (kept the original disk) or completed (pivoted
      to the new disk), we have to track which of the two operations were
      used to end the job.  Furthermore, we'd like to avoid attempts to
      end a job where we are already waiting on an earlier request to qemu
      to end the job.  Likewise, if we miss the qemu event (perhaps because
      it arrived during a libvirtd restart), we still need enough state
      recorded to be able to determine how to modify the domain XML once
      we reconnect to qemu and manually learn whether the job still exists.
      
      Although this patch doesn't actually fix the problem, it is a
      preliminary step that makes it possible to track whether a job
      has already begun steps towards completion.
      
      * src/conf/domain_conf.h (virDomainDiskMirrorState): New enum.
      (_virDomainDiskDef): Convert bool mirroring to new enum.
      * src/conf/domain_conf.c (virDomainDiskDefParseXML)
      (virDomainDiskDefFormat): Handle new values.
      * src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Adjust
      client.
      * src/qemu/qemu_driver.c (qemuDomainBlockPivot)
      (qemuDomainBlockJobImpl): Likewise.
      * docs/schemas/domaincommon.rng (diskMirror): Expose new values.
      * docs/formatdomain.html.in (elementsDisks): Document it.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9a212d67
  17. 29 7月, 2014 12 次提交
    • H
      qemu: error out if PCI passthrough type is not supported · c5b02b67
      Hu Tao 提交于
      If PCI passthrough type is not supported, we should error out rather than
      continue building the command line.
      
      When starting a domain, the type has been already checked by
      qemuPrepareHostdevPCICheckSupport() before building qemu command line,
      so the problem doesn't emerge.
      
      But when coverting a domain xml without specifying passthrough type explictly
      to qemu arg, we will get a malformed command line.
      
      the xml:
      
          <hostdev mode='subsystem' type='pci' managed='yes'>
            <source>
              <address domain='0x0001' bus='0x03' slot='0x00' function='0x0'/>
            </source>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
          </hostdev>
      
      the converted command line:
      
        -device ,host=0001:03:00.0,id=hostdev0,bus=pci.0,addr=0x5
      
      After this patch, virsh gives an error message:
      
        virsh domxml-to-native qemu-argv /tmp/tmp.xml
        error: internal error: invalid PCI passthrough type 'default'
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      c5b02b67
    • M
    • M
      domain: Introduce ./hugepages/page/[@size, @unit, @nodeset] · 136ad497
      Michal Privoznik 提交于
        <memoryBacking>
          <hugepages>
            <page size="1" unit="G" nodeset="0-3,5"/>
            <page size="2" unit="M" nodeset="4"/>
          </hugepages>
        </memoryBacking>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      136ad497
    • M
      virbitmap: Introduce virBitmapOverlaps · 49baed2b
      Michal Privoznik 提交于
      This internal API just checks if two bitmaps intersect or not.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      49baed2b
    • M
      qemu: Utilize virFileFindHugeTLBFS · 725a211f
      Michal Privoznik 提交于
      Use better detection of hugetlbfs mount points. Yes, there can be
      multiple mount points each serving different huge page size.
      
      Since we already have ability to override the mount point in the
      qemu.conf file, this crazy backward compatibility code is brought in.
      Now we allow multiple mount points, so the "hugetlbfs_mount" option
      must take an list of strings (mount points). But previously, it was
      just a string, so we must accept both types now.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      725a211f
    • M
      Introduce virFileFindHugeTLBFS · be0782e1
      Michal Privoznik 提交于
      This should iterate over mount tab and search for hugetlbfs among with
      looking for the default value of huge pages.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      be0782e1
    • P
      storage: create: Create files with correct mode · f8cf4962
      Peter Krempa 提交于
      Use correct mode when pre-creating files (for snapshots). The refactor
      changing to storage driver usage caused a regression as some systems
      created the file with 000 permissions forbidding qemu to write the file.
      
      Pass mode to the creating functions to avoid the problem.
      
      Regression since 185e07a5.
      f8cf4962
    • R
      schema: bhyve and nmdm updates · 1281f4a1
      Roman Bogorodskiy 提交于
      * docs/schemas/domaincommon.rng: Add bhyve domain type, nmdm
        serial type and master and slave optional attributes for
        serial that are used by nmdm
      * tests/domainschematest: Add bhyvexml2argvdata directory
        to validate bhyve XMLs
      1281f4a1
    • C
      nodedev: fix a uninitialized variable build failure · 71ee25f5
      Chen Hanxiao 提交于
      Fix a -Werror=maybe-uninitialized warning
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      71ee25f5
    • E
      nodedev: fix pci express memory leak · c6a4d268
      Eric Blake 提交于
      Leak introduced in commit 16ebf10f (v1.2.6), detected by valgrind:
      
      ==9816== 216 (96 direct, 120 indirect) bytes in 6 blocks are definitely lost in loss record 665 of 821
      ==9816==    at 0x4A081D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==9816==    by 0x50836FB: virAlloc (viralloc.c:144)
      ==9816==    by 0x1DBDBE27: udevProcessPCI (node_device_udev.c:546)
      ==9816==    by 0x1DBDD79D: udevGetDeviceDetails (node_device_udev.c:1293)
      
      * src/util/virpci.h (virPCIEDeviceInfoFree): New prototype.
      * src/util/virpci.c (virPCIEDeviceInfoFree): New function.
      * src/conf/node_device_conf.c (virNodeDevCapsDefFree): Clear
      pci_express under pci case.
      (virNodeDevCapPCIDevParseXML): Avoid leak.
      * src/node_device/node_device_udev.c (udevProcessPCI): Likewise.
      * src/libvirt_private.syms (virpci.h): Export it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c6a4d268
    • E
      nodedev: move pci express types to virpci.h · be05c141
      Eric Blake 提交于
      Finding virPCIE* code is more intuitive if located in virpci.h
      instead of node_device_conf.h.
      
      * src/conf/node_device_conf.h (virPCIELinkSpeed, virPCIELink)
      (virPCIEDeviceInfo): Move...
      * src/util/virpci.h: ...here.
      * src/conf/node_device_conf.c (virPCIELinkSpeed): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      be05c141
    • E
      nodedev: let compiler help us on switches · 3261895a
      Eric Blake 提交于
      The compiler can alert us to places where we need to expand switch
      statements because we add a new enum value, but only if we don't
      have a default case.
      
      * src/conf/node_device_conf.c (virNodeDeviceDefFormat)
      (virNodeDevCapsDefParseXML, virNodeDevCapsDefFree): Drop default
      case.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3261895a
  18. 28 7月, 2014 2 次提交