1. 22 4月, 2014 1 次提交
  2. 18 4月, 2014 2 次提交
  3. 17 4月, 2014 1 次提交
  4. 14 4月, 2014 1 次提交
  5. 12 4月, 2014 2 次提交
    • E
      conf: drop redundant parameter to chain lookup · 74430fe3
      Eric Blake 提交于
      The original chain lookup code had to pass in the starting name,
      because it was not available in the chain.  But now that we have
      added fields to the struct, this parameter is redundant.
      
      * src/util/virstoragefile.h (virStorageFileChainLookup): Alter
      signature.
      * src/util/virstoragefile.c (virStorageFileChainLookup): Adjust
      handling of top of chain.
      * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Adjust caller.
      * tests/virstoragetest.c (testStorageLookup, mymain): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      74430fe3
    • E
      conf: report error on chain lookup failure · 6752bc2a
      Eric Blake 提交于
      The chain lookup function was inconsistent on whether it left
      a message in the log when looking up a name that is not found
      on the chain (leaving a message for OOM or if name was
      relative but not part of the chain), and could litter the log
      even when successful (when name was relative but deep in the
      chain, use of virFindBackingFile early in the chain would complain
      about a file not found).  It's easier to make the function
      consistently emit a message exactly once on failure, and to let
      all callers rely on the clean semantics.
      
      * src/util/virstoragefile.c (virStorageFileChainLookup): Always
      report error on failure.  Simplify relative lookups.
      * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Avoid
      overwriting error.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6752bc2a
  6. 09 4月, 2014 7 次提交
  7. 08 4月, 2014 3 次提交
  8. 07 4月, 2014 1 次提交
    • E
      hash: add common utility functions · 09567144
      Eric Blake 提交于
      I almost wrote a hash value free function that just called
      VIR_FREE, then realized I couldn't be the first person to
      do that.  Sure enough, it was worth factoring into a common
      helper routine.
      
      * src/util/virhash.h (virHashValueFree): New function.
      * src/util/virhash.c (virHashValueFree): Implement it.
      * src/util/virobject.h (virObjectFreeHashData): New function.
      * src/libvirt_private.syms (virhash.h, virobject.h): Export them.
      * src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit): Use
      common function.
      * src/qemu/qemu_capabilities.c (virQEMUCapsCacheNew): Likewise.
      * src/qemu/qemu_command.c (qemuDomainCCWAddressSetCreate):
      Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorGetBlockInfo): Likewise.
      * src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
      * src/util/virclosecallbacks.c (virCloseCallbacksNew): Likewise.
      * src/util/virkeyfile.c (virKeyFileParseGroup): Likewise.
      * tests/qemumonitorjsontest.c
      (testQemuMonitorJSONqemuMonitorJSONGetBlockInfo): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      09567144
  9. 05 4月, 2014 2 次提交
    • R
      bhyve: add console support through nmdm device · 6c91134d
      Roman Bogorodskiy 提交于
      nmdm is a FreeBSD driver which allows to create a pair of tty
      devices one of which is passed to the guest and second is used
      by the client.
      
      This patch adds new 'nmdm' character device type. Its definition
      looks this way:
      
      <serial type='nmdm'>
        <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/>
      </serial>
      
      Master is passed to the hypervisior and slave is used for client
      connection.
      
      Also implement domainOpenConsole() for bhyve driver based on that.
      6c91134d
    • E
      conf: track when storage type is still undetermined · 9673418c
      Eric Blake 提交于
      Right now, virStorageFileMetadata tracks bool backingStoreIsFile
      for whether the backing string specified in metadata can be
      resolved as a file (covering both block and regular file
      resources) or is treated as a network protocol.  But when
      merging this struct with virStorageSource, it will be easier
      to just actually track which type of resource it is, as well
      as have a reserved value for the case where the resource type
      is unknown (or had an error during probing).
      
      * src/util/virstoragefile.h (virStorageType): Add a placeholder
      value, swap order to match similar public enum.
      * src/util/virstoragefile.c (virStorage): Update string mapping.
      * src/conf/domain_conf.c (virDomainDiskSourceParse)
      (virDomainDiskDefParseXML, virDomainDiskDefFormat)
      (virDomainDiskSourceFormat): Adjust clients.
      * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML):
      Likewise.
      * src/qemu/qemu_driver.c
      (qemuDomainSnapshotPrepareDiskExternalBackingInactive)
      (qemuDomainSnapshotPrepareDiskExternalOverlayActive)
      (qemuDomainSnapshotPrepareDiskExternalOverlayInactive)
      (qemuDomainSnapshotPrepareDiskInternal)
      (qemuDomainSnapshotCreateSingleDiskActive): Likewise.
      * src/qemu/qemu_command.c (qemuGetDriveSourceString): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9673418c
  10. 03 4月, 2014 2 次提交
    • M
      qemu: make sure agent returns error when required data are missing · 736e017e
      Martin Kletzander 提交于
      Commit 5b3492fa aimed to fix this and caught one error but exposed
      another one.  When agent command is being executed and the thread
      waiting for the reply is woken up by an event (e.g. EOF in case of
      shutdown), the command finishes with no data (rxObject == NULL), but
      no error is reported, since this might be desired by the caller
      (e.g. suspend through agent).  However, in other situations, when the
      data are required (e.g. getting vCPUs), we proceed to getting desired
      data out of the reply, but none of the virJSON*() functions works well
      with NULLs.  I chose the way of a new parameter for qemuAgentCommand()
      function that specifies whether reply is required and behaves
      according to that.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1058149Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      736e017e
    • J
      Move error reporting into virDomainNetFindIdx · 2fbae1b2
      Ján Tomko 提交于
      Every caller checked the return value and logged an error
      - one if no device with the specified MAC was found,
      other if there were multiple devices matching the MAC address
      (except for qemuDomainUpdateDeviceConfig which logged the same
       message in both cases).
      
      Move the error reporting into virDomainNetFindIdx, since in both cases,
      we couldn't find one single match - it's just the error messages that
      differ.
      2fbae1b2
  11. 02 4月, 2014 11 次提交
    • M
      qemu: remove unneeded forward declaration · e9d09fe1
      Martin Kletzander 提交于
      by moving qemuAgentCommand() after qemuAgentCheckError().
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      e9d09fe1
    • M
      qemu: cleanup error checking on agent replies · 5b3492fa
      Martin Kletzander 提交于
      On all the places where qemuAgentComand() was called, we did a check
      for errors in the reply.  Unfortunately, some of the places called
      qemuAgentCheckError() without checking for non-null reply which might
      have resulted in a crash.
      
      So this patch makes the error-checking part of qemuAgentCommand()
      itself, which:
      
       a) makes it look better,
      
       b) makes the check mandatory and, most importantly,
      
       c) checks for the errors if and only if it is appropriate.
      
      This actually fixes a potential crashers when qemuAgentComand()
      returned 0, but reply was NULL.  Having said that, it *should* fix the
      following bug:
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1058149Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      5b3492fa
    • E
      conf: let snapshots share disk source struct · ca1ee0fd
      Eric Blake 提交于
      Now that we have a common struct, it's time to start using it!
      Since external snapshots make a longer backing chain, it is
      only natural to use the same struct for the file created by
      the snapshot as what we use for <domain> disks.
      
      * src/conf/snapshot_conf.h (_virDomainSnapshotDiskDef): Use common
      struct instead of open-coded duplicate fields.
      * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefClear)
      (virDomainSnapshotDiskDefParseXML, virDomainSnapshotAlignDisks)
      (virDomainSnapshotDiskDefFormat)
      (virDomainSnapshotDiskGetActualType): Adjust clients.
      * src/qemu/qemu_conf.c (qemuTranslateSnapshotDiskSourcePool):
      Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotDiskGetSourceString)
      (qemuDomainSnapshotCreateInactiveExternal)
      (qemuDomainSnapshotPrepareDiskExternalOverlayActive)
      (qemuDomainSnapshotPrepareDiskExternal)
      (qemuDomainSnapshotPrepare)
      (qemuDomainSnapshotCreateSingleDiskActive): Likewise.
      * src/storage/storage_driver.c
      (virStorageFileInitFromSnapshotDef): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ca1ee0fd
    • E
      conf: move common disk source functions · 7a4fd22b
      Eric Blake 提交于
      Move some functions out of domain_conf for use in the next
      patch where snapshot starts to directly use structs in
      virstoragefile.
      
      * src/conf/domain_conf.c (virDomainDiskDefFree)
      (virDomainDiskSourcePoolDefParse): Adjust callers.
      (virDomainDiskSourceDefClear, virDomainDiskSourcePoolDefFree)
      (virDomainDiskAuthClear): Move...
      * src/util/virstoragefile.c (virStorageSourceClear)
      (virStorageSourcePoolDefFree, virStorageSourceAuthClear): ...and
      rename.
      * src/conf/domain_conf.h (virDomainDiskAuthClear): Drop
      declaration.
      * src/qemu/qemu_conf.c (qemuTranslateDiskSourcePool): Adjust
      caller.
      * src/util/virstoragefile.h: Declare them.
      * src/libvirt_private.syms (virstoragefile.h): Export them.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7a4fd22b
    • E
      util: move detection of shared filesystems · 5160ab79
      Eric Blake 提交于
      The code in virstoragefile.c is getting more complex as I
      consolidate backing chain handling code.  But for the setuid
      virt-login-shell, we don't need to crawl backing chains.  It's
      easier to audit things for setuid security if there are fewer
      files involved, so this patch moves the one function that
      virFileOpen() was actually relying on to also live in virfile.c.
      
      * src/util/virstoragefile.c (virStorageFileIsSharedFS)
      (virStorageFileIsSharedFSType): Move...
      * src/util/virfile.c (virFileIsSharedFS, virFileIsSharedFSType):
      ...to here, and rename.
      (virFileOpenAs): Update caller.
      * src/security/security_selinux.c
      (virSecuritySELinuxSetFileconHelper)
      (virSecuritySELinuxSetSecurityAllLabel)
      (virSecuritySELinuxRestoreSecurityImageLabelInt): Likewise.
      * src/security/security_dac.c
      (virSecurityDACRestoreSecurityImageLabelInt): Likewise.
      * src/qemu/qemu_driver.c (qemuOpenFileAs): Likewise.
      * src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
      * src/util/virstoragefile.h: Adjust declarations.
      * src/util/virfile.h: Likewise.
      * src/libvirt_private.syms (virfile.h, virstoragefile.h): Move
      symbols as appropriate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      5160ab79
    • E
      conf: move storage secret type to util/ · c05d9dca
      Eric Blake 提交于
      This one is a relatively easy move.  We don't ever convert the
      enum to or from strings (it is inferred from other elements in
      the xml, rather than directly represented).
      
      * src/conf/domain_conf.h (virDomainDiskSecretType): Move...
      * src/util/virstoragefile.h (virStorageSecreteType): ...and
      rename.
      * src/conf/domain_conf.c (virDomainDiskSecretType): Drop unused
      enum conversion.
      (virDomainDiskAuthClear, virDomainDiskDefParseXML)
      (virDomainDiskDefFormat): Adjust clients.
      * src/qemu/qemu_command.c (qemuGetSecretString): Likewise.
      * src/qemu/qemu_conf.c (qemuTranslateDiskSourcePoolAuth):
      Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c05d9dca
    • E
      conf: move source pool type to util/ · b6edf2bf
      Eric Blake 提交于
      Another struct being moved to util.  This one doesn't have as
      much use yet, thankfully.
      
      * src/conf/domain_conf.h (virDomainDiskSourcePoolMode)
      (virDomainDiskSourcePoolDef): Move...
      * src/util/virstoragefile.h (virStorageSourcePoolMode)
      (virStorageSourcePoolDef): ...and rename.
      * src/conf/domain_conf.c (virDomainDiskSourcePoolDefFree)
      (virDomainDiskSourceDefClear, virDomainDiskSourcePoolDefParse)
      (virDomainDiskDefParseXML, virDomainDiskSourceDefParse)
      (virDomainDiskSourceDefFormatInternal)
      (virDomainDiskDefForeachPath, virDomainDiskSourceIsBlockType):
      Adjust clients.
      * src/qemu/qemu_conf.c (qemuTranslateDiskSourcePool): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virstoragefile.h): ...as appropriate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b6edf2bf
    • E
      conf: move network disk protocol type to util/ · 4220f76a
      Eric Blake 提交于
      Another enum moved to util/, this time the fallout from renaming
      is not quite as large.
      
      * src/conf/domain_conf.h (virDomainDiskProtocol): Move...
      * src/util/virstoragefile.h (virStorageNetProtocol): ...and
      rename.
      * src/conf/domain_conf.c: Update clients.
      * src/qemu/qemu_command.c: Likewise.
      * src/qemu/qemu_conf.c: Likewise.
      * src/qemu/qemu_driver.c: Likewise.
      * src/qemu/qemu_migration.c: Likewise.
      * src/storage/storage_backend.c: Likewise.
      * src/storage/storage_backend_gluster.c: Likewise.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virstoragefile.h): ...as appropriate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4220f76a
    • E
      conf: move host disk type to util/ · 16ac4c9d
      Eric Blake 提交于
      A continuation of the migration of disk details to virstoragefile.
      This patch moves a single enum, but converting the name has quite
      a bit of fallout.
      
      * src/conf/domain_conf.h (virDomainDiskType): Move...
      * src/util/virstoragefile.h (virStorageType): ...and rename.
      * src/bhyve/bhyve_command.c (bhyveBuildDiskArgStr)
      (virBhyveProcessBuildLoadCmd): Update clients.
      * src/conf/domain_conf.c (virDomainDiskSourceDefParse)
      (virDomainDiskDefParseXML, virDomainDiskSourceDefFormatInternal)
      (virDomainDiskDefFormat, virDomainDiskGetActualType)
      (virDomainDiskDefForeachPath, virDomainDiskSourceIsBlockType):
      Likewise.
      * src/conf/snapshot_conf.h (_virDomainSnapshotDiskDef): Likewise.
      * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML)
      (virDomainSnapshotAlignDisks, virDomainSnapshotDiskDefFormat):
      Likewise.
      * src/esx/esx_driver.c (esxAutodetectSCSIControllerModel)
      (esxDomainDefineXML): Likewise.
      * src/locking/domain_lock.c (virDomainLockManagerAddDisk):
      Likewise.
      * src/lxc/lxc_controller.c
      (virLXCControllerSetupLoopDeviceDisk)
      (virLXCControllerSetupNBDDeviceDisk)
      (virLXCControllerSetupLoopDevices, virLXCControllerSetupDisk):
      Likewise.
      * src/parallels/parallels_driver.c (parallelsGetHddInfo):
      Likewise.
      * src/phyp/phyp_driver.c (phypDiskType): Likewise.
      * src/qemu/qemu_command.c (qemuGetDriveSourceString)
      (qemuDomainDiskGetSourceString, qemuBuildDriveStr)
      (qemuBuildCommandLine, qemuParseCommandLineDisk)
      (qemuParseCommandLine): Likewise.
      * src/qemu/qemu_conf.c (qemuCheckSharedDevice)
      (qemuTranslateDiskSourcePool)
      (qemuTranslateSnapshotDiskSourcePool): Likewise.
      * src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse)
      (qemuDomainDetermineDiskChain): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo)
      (qemuDomainSnapshotPrepareDiskExternalBackingInactive)
      (qemuDomainSnapshotPrepareDiskExternalBackingActive)
      (qemuDomainSnapshotPrepareDiskExternalOverlayActive)
      (qemuDomainSnapshotPrepareDiskExternalOverlayInactive)
      (qemuDomainSnapshotPrepareDiskInternal)
      (qemuDomainSnapshotPrepare)
      (qemuDomainSnapshotCreateSingleDiskActive): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainChangeEjectableMedia):
      Likewise.
      * src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
      * src/security/security_apparmor.c
      (AppArmorRestoreSecurityImageLabel)
      (AppArmorSetSecurityImageLabel): Likewise.
      * src/security/security_dac.c (virSecurityDACSetSecurityImageLabel)
      (virSecurityDACRestoreSecurityImageLabelInt)
      (virSecurityDACSetSecurityAllLabel): Likewise.
      * src/security/security_selinux.c
      (virSecuritySELinuxRestoreSecurityImageLabelInt)
      (virSecuritySELinuxSetSecurityImageLabel)
      (virSecuritySELinuxSetSecurityAllLabel): Likewise.
      * src/storage/storage_backend.c (virStorageFileBackendForType):
      Likewise.
      * src/storage/storage_backend_fs.c (virStorageFileBackendFile)
      (virStorageFileBackendBlock): Likewise.
      * src/storage/storage_backend_gluster.c
      (virStorageFileBackendGluster): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc, vboxAttachDrives)
      (vboxDomainAttachDeviceImpl, vboxDomainDetachDevice): Likewise.
      * src/vmware/vmware_conf.c (vmwareVmxPath): Likewise.
      * src/vmx/vmx.c (virVMXParseDisk, virVMXFormatDisk)
      (virVMXFormatFloppy): Likewise.
      * src/xenxs/xen_sxpr.c (xenParseSxprDisks, xenParseSxpr)
      (xenFormatSxprDisk): Likewise.
      * src/xenxs/xen_xm.c (xenParseXM, xenFormatXMDisk): Likewise.
      * tests/securityselinuxlabeltest.c (testSELinuxLoadDef):
      Likewise.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virstoragefile.h): ...as appropriate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      16ac4c9d
    • E
      conf: split network host structs to util/ · 52fb5311
      Eric Blake 提交于
      Continuing the refactoring of host-side storage descriptions out
      of conf/domain_conf and into util/virstoragefile, this patch
      focuses on details about a host name/port/transport as used by
      a network storage volume.
      
      * src/conf/domain_conf.h (virDomainDiskProtocolTransport)
      (virDomainDiskHostDef, virDomainDiskHostDefClear)
      (virDomainDiskHostDefFree, virDomainDiskHostDefCopy): Move...
      * src/util/virstoragefile.h (virStorageNetHostTransport)
      (virStorageNetHostDef, virStorageNetHostDefClear)
      (virStorageNetHostDefFree, virStorageNetHostDefCopy): ...here,
      with better names.
      * src/util/virstoragefile.c (virStorageNetHostDefClear)
      (virStorageNetHostDefFree, virStorageNetHostDefCopy): Moved from...
      * src/conf/domain_conf.c (virDomainDiskHostDefClear)
      (virDomainDiskHostDefFree, virDomainDiskHostDefCopy): ...here.
      (virDomainDiskSourceDefClear, virDomainDiskSourceDefParse)
      (virDomainDiskSourceDefFormatInternal): Adjust callers.
      * src/conf/snapshot_conf.h (_virDomainSnapshotDiskDef): Likewise.
      * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefClear):
      Likewise.
      * src/qemu/qemu_command.c (qemuAddRBDHost)
      (qemuParseDriveURIString, qemuParseNBDString)
      (qemuBuildNetworkDriveURI, qemuParseCommandLineDisk)
      (qemuParseCommandLine, qemuGetDriveSourceString): Likewise.
      * src/qemu/qemu_command.h: Likewise.
      * src/qemu/qemu_conf.c (qemuAddISCSIPoolSourceHost)
      (qemuTranslateDiskSourcePool): Likewise.
      * src/qemu/qemu_driver.c
      (qemuDomainSnapshotCreateSingleDiskActive)
      (qemuDomainSnapshotUndoSingleDiskActive): Likewise.
      * src/storage/storage_backend_gluster.c
      (virStorageFileBackendGlusterInit): Likewise.
      * src/storage/storage_driver.c (virStorageFileFree)
      (virStorageFileInitInternal): Likewise.
      * src/storage/storage_driver.h (_virStorageFile): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virstoragefile.h): ...as appropriate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      52fb5311
    • E
      conf: split security label structs to util/ · 3e929386
      Eric Blake 提交于
      In order to reuse the newly-created host-side disk struct in
      the virstoragefile backing chain code, I first have to move
      it to util/.  This starts the process, by first moving the
      security label structures.
      
      * src/conf/domain_conf.h (virDomainDefGenSecurityLabelDef)
      (virDomainDiskDefGenSecurityLabelDef, virSecurityLabelDefFree)
      (virSecurityDeviceLabelDefFree, virSecurityLabelDef)
      (virSecurityDeviceLabelDef): Move...
      * src/util/virseclabel.h: ...to new file.
      (virSecurityLabelDefNew, virSecurityDeviceLabelDefNew): Rename the
      GenSecurity functions.
      * src/qemu/qemu_process.c (qemuProcessAttach): Adjust callers.
      * src/security/security_manager.c (virSecurityManagerGenLabel):
      Likewise.
      * src/security/security_selinux.c
      (virSecuritySELinuxSetSecurityFileLabel): Likewise.
      * src/util/virseclabel.c: New file.
      * src/conf/domain_conf.c: Move security code, and fix fallout.
      * src/Makefile.am (UTIL_SOURCES): Build new file.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virseclabel.h): ...to new section.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3e929386
  12. 27 3月, 2014 1 次提交
    • N
      Fix Memory Leak in virQEMUCapsInitGuestFromBinary() · faad5582
      Nehal J Wani 提交于
      While running qemucaps2xmltest, it was found that valgrind pointed out
      the following memory leaks:
      
      ==29896== 0 bytes in 1 blocks are definitely lost in loss record 1 of 65
      ==29896==    at 0x4A0577B: calloc (vg_replace_malloc.c:593)
      ==29896==    by 0x4C6B45E: virAllocN (viralloc.c:191)
      ==29896==    by 0x4232A9: virQEMUCapsGetMachineTypesCaps (qemu_capabilities.c:1999)
      ==29896==    by 0x4234E7: virQEMUCapsInitGuestFromBinary (qemu_capabilities.c:789)
      ==29896==    by 0x41F10B: testQemuCapsXML (qemucaps2xmltest.c:118)
      ==29896==    by 0x41FFD1: virtTestRun (testutils.c:201)
      ==29896==    by 0x41EE7A: mymain (qemucaps2xmltest.c:203)
      ==29896==    by 0x42074D: virtTestMain (testutils.c:789)
      ==29896==    by 0x3E6CE1ED1C: (below main) (libc-start.c:226)
      ==29896==
      ==29896== 0 bytes in 1 blocks are definitely lost in loss record 2 of 65
      ==29896==    at 0x4A0577B: calloc (vg_replace_malloc.c:593)
      ==29896==    by 0x4C6B45E: virAllocN (viralloc.c:191)
      ==29896==    by 0x4232A9: virQEMUCapsGetMachineTypesCaps (qemu_capabilities.c:1999)
      ==29896==    by 0x4234E7: virQEMUCapsInitGuestFromBinary (qemu_capabilities.c:789)
      ==29896==    by 0x41F10B: testQemuCapsXML (qemucaps2xmltest.c:118)
      ==29896==    by 0x41FFD1: virtTestRun (testutils.c:201)
      ==29896==    by 0x41EEA3: mymain (qemucaps2xmltest.c:204)
      ==29896==    by 0x42074D: virtTestMain (testutils.c:789)
      ==29896==    by 0x3E6CE1ED1C: (below main) (libc-start.c:226)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      faad5582
  13. 26 3月, 2014 6 次提交
    • M
      qemuDomainAttachDeviceFlags: Parse device xml as inactive · 220c0031
      Michal Privoznik 提交于
      In all other drivers we are doing so. Moreover, we don't want to parse
      runtime information in attach (even if the attach is meant as live)
      because we are generating the runtime info ourselves. We can't trust
      users they supply sane values anyway.
      
      ==1140== 9 bytes in 1 blocks are definitely lost in loss record 72 of 1,151
      ==1140==    at 0x4A06C2B: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==1140==    by 0x623C758: xmlStrndup (in /usr/lib64/libxml2.so.2.9.1)
      ==1140==    by 0x50FD763: virXMLPropString (virxml.c:483)
      ==1140==    by 0x510F8B7: virDomainDeviceInfoParseXML (domain_conf.c:3685)
      ==1140==    by 0x511ACFD: virDomainChrDefParseXML (domain_conf.c:7535)
      ==1140==    by 0x5121D13: virDomainDeviceDefParse (domain_conf.c:9918)
      ==1140==    by 0x13AE6313: qemuDomainAttachDeviceFlags (qemu_driver.c:6926)
      ==1140==    by 0x13AE65FA: qemuDomainAttachDevice (qemu_driver.c:7005)
      ==1140==    by 0x51C77DA: virDomainAttachDevice (libvirt.c:10231)
      ==1140==    by 0x127FDD: remoteDispatchDomainAttachDevice (remote_dispatch.h:2404)
      ==1140==    by 0x127EC5: remoteDispatchDomainAttachDeviceHelper (remote_dispatch.h:2382)
      ==1140==    by 0x5241F81: virNetServerProgramDispatchCall (virnetserverprogram.c:437)
      
      When doing live attach, we are passing the inactive definition anyway
      since we are passing the result of virDomainDeviceDefCopy() which does
      inactive copy by default.
      
      Moreover, we are doing the same mistake in qemuhotplugtest.
      
      Just a side note - it makes perfect sense to parse the runtime info
      like alias in qemuDomainDetachDevice and qemuDomainUpdateDeviceFlags()
      as in some cases the only difference to distinguish two devices can be
      just their alias.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      220c0031
    • F
      qemu: extract guest capabilities initialization · f35e89ff
      Francesco Romani 提交于
      This patch decouples the binary and the capabilities detection
      from the guest initialization.
      
      The purpose is to make testing easier.
      f35e89ff
    • F
      qemu: export disk snapshot support in capabilities · 85a3eb8a
      Francesco Romani 提交于
      This patch adds an element to QEMU's capability XML, to
      show if the underlying QEMU binary supports the live disk
      snapshotting or not.
      This allows any client to know ahead of time if the feature
      is available.
      
      Without this information available, the only way to check
      for the snapshot support is to request one and check for
      errors.
      Signed-off-by: NFrancesco Romani <fromani@redhat.com>
      85a3eb8a
    • J
      Show the real cpu shares value in live XML · 97814d8a
      Ján Tomko 提交于
      Currently, the Linux kernel treats values of '0' and '1' as
      the minimum of 2. Values larger than the maximum are changed
      to the maximum.
      
      Re-reading the shares value after setting it reflects this in
      the live domain XML.
      97814d8a
    • J
      Treat zero cpu shares as a valid value · bdffab0d
      Ján Tomko 提交于
      Currently, <cputune><shares>0</shares></cputune> is treated
      as if it were not specified.
      
      Treat is as a valid value if it was explicitly specified
      and write it to the cgroups.
      bdffab0d
    • T
      qemu: remove redundant virQEMUDriverGetConfig · ff436380
      Tomoki Sekiyama 提交于
      qemuDomainSetSchedulerParametersFlags() calls virQEMUDriverGetConfig() twice
      and makes the reference counter leak. This removes redundant call.
      
      Problem introduced in commit 45ad1adbSigned-off-by: NEric Blake <eblake@redhat.com>
      ff436380