1. 15 10月, 2013 9 次提交
    • E
      maint: fix awkward typing of virDomainChrGetDomainPtrs · f8fa2b3e
      Eric Blake 提交于
      virDomainChrGetDomainPtrs() required 4 levels of pointers (taking
      a parameter that will be used as an output variable to return the
      address of another variable that contains an array of pointers).
      This is rather complex to reason about, especially when outside
      of the domain_conf file, no other caller should be modifying
      the resulting array of pointers directly.  Changing the public
      signature gives something is easier to reason with, and actually
      make const-correct; which is important as it was the only function
      that was blocking virDomainDeviceDefCopy from treating its source
      as const.
      
      * src/conf/domain_conf.h (virDomainChrGetDomainPtrs): Use simpler
      types, and make const-correct for external users.
      * src/conf/domain_conf.c (virDomainChrGetDomainPtrs): Split...
      (virDomainChrGetDomainPtrsInternal): ...into an internal version
      that lets us modify terms, vs. external form that is read-only.
      (virDomainDeviceDefPostParseInternal, virDomainChrFind)
      (virDomainChrInsert): Adjust callers.
      * src/qemu/qemu_command.c (qemuGetNextChrDevIndex): Adjust caller.
      (qemuDomainDeviceAliasIndex): Make const-correct.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f8fa2b3e
    • E
      maint: avoid 'const fooPtr' in python bindings · d3f9d851
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in the python bindings.
      
      * python/generator.py (py_types): Drop useless conversions.
      * python/libvirt-override.c (getPyVirTypedParameter)
      (setPyVirTypedParameter): Use intended type.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d3f9d851
    • E
      maint: avoid 'const fooPtr' in tests · b8984770
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in the testsuite.
      
      * tests/cputest.c (cpuTestCompareXML): Use intended type.
      * tests/qemucapabilitiestest.c (testQemuCaps): Likewise.
      * tests/qemumonitorjsontest.c: Drop const.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b8984770
    • E
      maint: avoid 'const fooPtr' in nwfilter files · 1b7ec657
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in nwfilter code.
      
      This patch does nothing about the stupidity evident in having
      __virNWFilterInstantiateFilter, _virNWFilterInstantiateFilter,
      and virNWFilterInstantiateFilter, which differ only by leading
      underscores, and which infringes on the namespace reserved to
      the implementation - that would need to be a separate cleanup.
      
      * src/nwfilter/nwfilter_dhcpsnoop.h (virNWFilterDHCPSnoopReq): Use
      intended type.
      * src/nwfilter/nwfilter_gentech_driver.h
      (virNWFilterInstantiateFilter)
      (virNWFilterUpdateInstantiateFilter)
      (virNWFilterInstantiataeFilterLate, virNWFilterTeardownFilter)
      (virNWFilterCreateVarHashmap): Likewise.
      * src/nwfilter/nwfilter_learnipaddr.h (virNWFilterLearnIPAddress):
      Likewise.
      * src/conf/nwfilter_conf.h (virNWFilterApplyBasicRules)
      (virNWFilterApplyDHCPOnlyRules): Likewise.
      (virNWFilterDefFormat): Make const-correct.
      * src/conf/nwfilter_params.h (virNWFilterVarValueCopy)
      (virNWFilterVarValueGetSimple, virNWFilterVarValueGetCardinality)
      (virNWFilterVarValueEqual, virNWFilterVarAccessEqual)
      (virNWFilterVarAccessGetVarName, virNWFilterVarAccessGetType)
      (virNWFilterVarAccessGetIterId, virNWFilterVarAccessGetIndex)
      (virNWFilterVarAccessIsAvailable)
      (virNWFilterVarCombIterGetVarValue): Use intended type.
      (virNWFilterVarValueGetNthValue): Make const-correct.
      * src/nwfilter/nwfilter_dhcpsnoop.c (virNWFilterSnoopReqLeaseDel)
      (virNWFilterSnoopIFKeyFMT, virNWFilterDHCPSnoopReq)
      (virNWFilterSnoopPruneIter, virNWFilterSnoopRemAllReqIter)
      (virNWFilterDHCPSnoopReq): Fix fallout.
      * src/nwfilter/nwfilter_gentech_driver.c
      (virNWFilterVarHashmapAddStdValues, virNWFilterCreateVarHashmap)
      (virNWFilterInstantiate, __virNWFilterInstantiateFilter)
      (_virNWFilterInstantiateFilter, virNWFilterInstantiateFilterLate)
      (virNWFilterInstantiateFilter)
      (virNWFilterUpdateInstantiateFilter)
      (virNWFilterRollbackUpdateFilter, virNWFilterTeardownFilter):
      Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnIPAddress):
      Likewise.
      * src/conf/nwfilter_params.c (virNWFilterVarValueCopy)
      (virNWFilterVarValueGetSimple)
      (virNWFilterVarValueGetCardinality, virNWFilterVarValueEqual)
      (virNWFilterVarCombIterAddVariable)
      (virNWFilterVarCombIterGetVarValue, virNWFilterVarValueCompare)
      (virNWFilterFormatParamAttributes, virNWFilterVarAccessEqual)
      (virNWFilterVarAccessGetVarName, virNWFilterVarAccessGetType)
      (virNWFilterVarAccessGetIterId, virNWFilterVarAccessGetIndex)
      (virNWFilterVarAccessGetIntIterId)
      (virNWFilterVarAccessIsAvailable)
      (virNWFilterVarValueGetNthValue): Likewise.
      * src/nwfilter/nwfilter_ebiptables_driver.c (ebtablesApplyBasicRules)
      (ebtablesApplyDHCPOnlyRules, ebiptablesRuleOrderSort)
      (ebiptablesRuleOrderSortPtr): Likewise.
      * src/conf/nwfilter_conf.c (virNWFilterDefEqual)
      (virNWFilterDefFormat): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1b7ec657
    • E
      maint: avoid 'const fooPtr' in cpu files · d694ae0c
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in src/cpu.
      
      * src/cpu/cpu.h (cpuArchDecode, cpuArchEncode, cpuArchUpdate)
      (cpuArchHasFeature, cpuDecode, cpuEncode, cpuUpdate)
      (cpuHasFeature): Use intended type.
      * src/conf/cpu_conf.h (virCPUDefCopyModel, virCPUDefCopy):
      Likewise.
      (virCPUDefParseXML): Drop const.
      * src/cpu/cpu.c (cpuDecode, cpuEncode, cpuUpdate, cpuHasFeature):
      Fix fallout.
      * src/cpu/cpu_x86.c (x86ModelFromCPU, x86ModelSubtractCPU)
      (x86DecodeCPUData, x86EncodePolicy, x86Encode, x86UpdateCustom)
      (x86UpdateHostModel, x86Update, x86HasFeature): Likewise.
      * src/cpu/cpu_s390.c (s390Decode): Likewise.
      * src/cpu/cpu_arm.c (ArmDecode): Likewise.
      * src/cpu/cpu_powerpc.c (ppcModelFromCPU, ppcCompute, ppcDecode)
      (ppcUpdate): Likewise.
      * src/conf/cpu_conf.c (virCPUDefCopyModel, virCPUDefCopy)
      (virCPUDefParseXML): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d694ae0c
    • E
      maint: avoid 'const fooPtr' in virnet files · 955af4d4
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up remaining offenders in src/util.
      
      * src/util/virnetdev.h (virNetDevSetMAC)
      (virNetDevReplaceMacAddress, virNetDevValidateConfig)
      (virNetDevReplaceNetConfig): Use intended type.
      * src/util/virnetdevbandwidth.h (virNetDevBandwidthCopy)
      (virNetDevBandwidthPlug): Likewise.
      * src/util/virnetdevmacvlan.h (virNetDevMacVLanCreate)
      (virNetDevMacVLanCreateWithVPortProfile)
      (virNetDevMacVLanDeleteWithVPortProfile)
      (virNetDevMacVLanRestartWithVPortProfile)
      (virNetDevMacVLanVPortProfileRegisterCallback): Likewise.
      * src/util/virnetdevopenvswitch.h (virNetDevOpenvswitchAddPort):
      Likewise.
      * src/util/virnetdevtap.h (virNetDevTapCreateInBridgePort):
      Likewise.
      * src/util/virnetdevvlan.h (virNetDevVlanEqual)
      (virNetDevVlanCopy): Likewise.
      * src/util/virnetdevvportprofile.h
      (virNetDevVPortProfileAssociate)
      (virNetDevVPortProfileDisassociate): Likewise.
      * src/util/virnetlink.h (virNetlinkEventRemoveCallback)
      (virNetlinkEventAddClient, virNetlinkEventRemoveClient):
      Likewise.
      * src/util/virnetdev.c (virNetDevSetMAC)
      (virNetDevReplaceMacAddress, virNetDevValidateConfig)
      (virNetDevReplaceNetConfig): Fix fallout.
      * src/util/virnetdevbandwidth.c (virNetDevBandwidthCopy)
      (virNetDevBandwidthPlug): Likewise.
      * src/util/virnetdevmacvlan.c (virNetDevMacVLanCreate)
      (virNetDevMacVLanCreateWithVPortProfile)
      (virNetDevMacVLanDeleteWithVPortProfile)
      (virNetDevMacVLanRestartWithVPortProfile)
      (virNetDevMacVLanVPortProfileRegisterCallback): Likewise.
      * src/util/virnetdevopenvswitch.c (virNetDevOpenvswitchAddPort):
      Likewise.
      * src/util/virnetdevtap.c (virNetDevTapCreateInBridgePort):
      Likewise.
      * src/util/virnetdevvlan.c (virNetDevVlanEqual)
      (virNetDevVlanCopy): Likewise.
      * src/util/virnetdevvportprofile.c
      (virNetDevVPortProfileAssociate)
      (virNetDevVPortProfileDisassociate)
      (virNetDevVPortProfileOpSetLink, virNetDevVPortProfileOpCommon)
      (virNetDevVPortProfileOp8021Qbg, virNetDevVPortProfileOp8021Qbh):
      Likewise.
      * src/util/virnetlink.c (virNetlinkEventRemoveCallback)
      (virNetlinkEventAddClient, virNetlinkEventRemoveClient):
      Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      955af4d4
    • E
      maint: avoid 'const fooPtr' in several util files · 1b0bc416
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in src/util outside of the virnet namespace.
      
      Also, make a few virSocketAddr functions const-correct, for easier
      conversions in future patches.
      
      * src/util/virbuffer.h (virBufferError, virBufferUse)
      (virBufferGetIndent): Use intended type.
      * src/util/virmacaddr.h (virMacAddrCmp, virMacAddrCmpRaw)
      (virMacAddrSet, virMcAddrFormat, virMacAddrIsUnicast)
      (virMacAddrIsMulticast): Likewise.
      * src/util/virebtables.h (ebtablesAddForwardAllowIn)
      (ebtablesRemoveForwardAllowIn): Likewise.
      * src/util/virsocketaddr.h (virSocketAddrSetIPv4Addr): Drop
      incorrect const.
      (virMacAddrGetRaw, virSocketAddrFormat, virSocketAddrFormatFull):
      Make const-correct.
      (virSocketAddrMask, virSocketAddrMaskByPrefix)
      (virSocketAddrBroadcast, virSocketAddrBroadcastByPrefix)
      (virSocketAddrGetNumNetmaskBits, virSocketAddrGetIpPrefix)
      (virSocketAddrEqual, virSocketAddrIsPrivate)
      (virSocketAddrIsWildcard): Use intended type.
      * src/util/virbuffer.c (virBufferError, virBufferUse)
      (virBufferGetIndent): Fix fallout.
      * src/util/virmacaddr.c (virMacAddrCmp, virMacAddrCmpRaw)
      (virMacAddrSet, virMcAddrFormat, virMacAddrIsUnicast)
      (virMacAddrIsMulticast): Likewise.
      * src/util/virebtables.c (ebtablesAddForwardAllowIn)
      (ebtablesRemoveForwardAllowIn): Likewise.
      * src/util/virsocketaddr.c (virSocketAddrMask, virMacAddrGetRaw)
      (virSocketAddrMaskByPrefix, virSocketAddrBroadcast)
      (virSocketAddrBroadcastByPrefix, virSocketAddrGetNumNetmaskBits)
      (virSocketAddrGetIpPrefix, virSocketAddrEqual)
      (virSocketAddrIsPrivate, virSocketAddrIsWildcard)
      (virSocketAddrGetIPv4Addr, virSocketAddrGetIPv6Addr)
      (virSocketAddrFormat, virSocketAddrFormatFull): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1b0bc416
    • E
      maint: avoid 'const fooPtr' in hashes · b43efdaa
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up virhash to provide a const-correct interface: all actions
      that don't modify the table take a const table.  Note that in
      one case (virHashSearch), we actually strip const away - we aren't
      modifying the contents of the table, so much as associated data
      for ensuring that the code uses the table correctly (if this were
      C++, it would be a case for the 'mutable' keyword).
      
      * src/util/virhash.h (virHashKeyComparator, virHashEqual): Use
      intended type.
      (virHashSize, virHashTableSize, virHashLookup, virHashSearch):
      Make const-correct.
      * src/util/virhash.c (virHashEqualData, virHashEqual)
      (virHashLookup, virHashSize, virHashTableSize, virHashSearch)
      (virHashComputeKey): Fix fallout.
      * src/conf/nwfilter_params.c
      (virNWFilterFormatParameterNameSorter): Likewise.
      * src/nwfilter/nwfilter_ebiptables_driver.c
      (ebiptablesFilterOrderSort): Likewise.
      * tests/virhashtest.c (testHashGetItemsCompKey)
      (testHashGetItemsCompValue): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b43efdaa
    • E
      maint: avoid 'const fooPtr' in public API · a5da5423
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in the public API.  Note that this is an API change;
      but see commit 6ac6f59c, where we first argued that this change is
      harmless (but with that commit not actually making the change that it
      claimed to be making):
      
          Although this is an API change (not ABI though), real callers won't be
          impacted. Why?
           1. these callback members are read-only, so it is less likely that
          someone is trying to assign into the struct members.
           2. The only way to register a virConnectDomainEventGraphicsCallback is
          to cast it through a call to virConnectDomainEventRegisterAny.  That is,
          even if the user's callback function leaves out the const, we never use
          the typedef as the direct type of any API parameter.  Since they are
          already casting their function pointer into a munged type before
          registering it, their code will continue to compile.
      
      * include/libvirt/libvirt.h.in
      (virConnectDomainEventGraphicsCallback): Use intended type.
      a5da5423
  2. 14 10月, 2013 16 次提交
  3. 11 10月, 2013 15 次提交
    • H
      nwfilter: fix a typo in nwfilter_gentech_driver.c · 3a49c34a
      Hongwei Bi 提交于
      s/occcurred/occurred
      3a49c34a
    • D
      rpc: Fix getsockopt on Snow Leopard and lower · 2f776d49
      Doug Goldstein 提交于
      Since 5a468b38 we use SOL_LOCAL for the 2nd argument of getsockopt()
      however Lion added the define SOL_LOCAL set to 0, which is the value to
      the 2nd argument of getsockopt() for Unix sockets on Mac OS X. So
      instead of using the define just pass 0 so we restore compatibility
      with Snow Leopard and Leopard.
      
      Reported at https://github.com/mxcl/homebrew/pull/23141
      2f776d49
    • D
      VMware: Do version detection earlier · fa23f9fc
      Doug Goldstein 提交于
      Do VMware version detection earlier as future patches will need the
      version information to populate capabilities correctly.
      fa23f9fc
    • D
      VMware: Simplify array walk for driver type · 9e7cfcb7
      Doug Goldstein 提交于
      Rather than walking the possible driver backends by handle, use a helper
      function. Additionally I've done a bit of refactoring in the code over
      the past few commits so add myself to the copyright line.
      9e7cfcb7
    • M
      qemu: Include listenAddress in debug prints · be651860
      Michal Privoznik 提交于
      After my patches, some functions gained one more argument
      (@listenAddress) which wasn't included in debug printing of
      arguments they were called with. Functions in question are:
      qemuMigrationPrepareDirect and qemuMigrationPerform.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      be651860
    • M
      qemu_migration: Avoid crashing if domain dies too quickly · c7ac2519
      Michal Privoznik 提交于
      I've noticed a SIGSEGV-ing libvirtd on the destination when the qemu
      died too quickly = in Prepare phase. What is happening here is:
      
      1) [Thread 3493] We are in qemuMigrationPrepareAny() and calling
      qemuProcessStart() which subsequently calls qemuProcessWaitForMonitor()
      and qemuConnectMonitor(). So far so good. The qemuMonitorOpen()
      succeeds, however switching monitor to QMP mode fails as qemu died
      meanwhile. That is qemuMonitorSetCapabilities() returns -1.
      
      2013-10-08 15:54:10.629+0000: 3493: debug : qemuMonitorSetCapabilities:1356 : mon=0x14a53da0
      2013-10-08 15:54:10.630+0000: 3493: debug : qemuMonitorJSONCommandWithFd:262 : Send command '{"execute":"qmp_capabilities","id":"libvirt-1"}' for write with FD -1
      2013-10-08 15:54:10.630+0000: 3493: debug : virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=17 events=13
      ...
      2013-10-08 15:54:10.631+0000: 3493: debug : qemuMonitorSend:956 : QEMU_MONITOR_SEND_MSG: mon=0x14a53da0 msg={"execute":"qmp_capabilities","id":"libvirt-1"}
       fd=-1
      2013-10-08 15:54:10.631+0000: 3262: debug : virEventPollRunOnce:641 : Poll got 1 event(s)
      
      2) [Thread 3262] The event loop is trying to do the talking to monitor.
      However, qemu is dead already, remember?
      
      2013-10-08 15:54:13.436+0000: 3262: error : qemuMonitorIORead:551 : Unable to read from monitor: Connection reset by peer
      2013-10-08 15:54:13.516+0000: 3262: debug : virFileClose:90 : Closed fd 25
      ...
      2013-10-08 15:54:13.533+0000: 3493: debug : qemuMonitorSend:968 : Send command resulted in error internal error: early end of file from monitor: possible problem:
      
      3) [Thread 3493] qemuProcessStart() failed. No big deal. Go to the
      'endjob' label and subsequently to the 'cleanup'. Since the domain is
      not persistent and ret is -1, the qemuDomainRemoveInactive() is called.
      This has an (unpleasant) effect of virObjectUnref()-in the @vm object.
      Unpleasant because the event loop which is about to trigger EOF callback
      still holds a pointer to the @vm (not the reference). See the valgrind
      output below.
      
      4) [Thread 3262] So the event loop starts triggering EOF:
      
      2013-10-08 15:54:13.542+0000: 3262: debug : qemuMonitorIO:729 : Triggering EOF callback
      2013-10-08 15:54:13.543+0000: 3262: debug : qemuProcessHandleMonitorEOF:294 : Received EOF on 0x14549110 'migt10'
      
      And the monitor is cleaned up. This results in calling
      qemuProcessHandleMonitorEOF with the @vm pointer passed. The pointer is
      kept in qemuMonitor struct.
      
      ==3262== Thread 1:
      ==3262== Invalid read of size 4
      ==3262==    at 0x77ECCAA: pthread_mutex_lock (in /lib64/libpthread-2.15.so)
      ==3262==    by 0x52FAA06: virMutexLock (virthreadpthread.c:85)
      ==3262==    by 0x52E3891: virObjectLock (virobject.c:320)
      ==3262==    by 0x11626743: qemuProcessHandleMonitorEOF (qemu_process.c:296)
      ==3262==    by 0x11642593: qemuMonitorIO (qemu_monitor.c:730)
      ==3262==    by 0x52BD526: virEventPollDispatchHandles (vireventpoll.c:501)
      ==3262==    by 0x52BDD49: virEventPollRunOnce (vireventpoll.c:648)
      ==3262==    by 0x52BBC68: virEventRunDefaultImpl (virevent.c:274)
      ==3262==    by 0x542D3D9: virNetServerRun (virnetserver.c:1112)
      ==3262==    by 0x11F368: main (libvirtd.c:1513)
      ==3262==  Address 0x14549128 is 24 bytes inside a block of size 136 free'd
      ==3262==    at 0x4C2AF5C: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==3262==    by 0x529B1FF: virFree (viralloc.c:580)
      ==3262==    by 0x52E3703: virObjectUnref (virobject.c:270)
      ==3262==    by 0x531557E: virDomainObjListRemove (domain_conf.c:2355)
      ==3262==    by 0x1160E899: qemuDomainRemoveInactive (qemu_domain.c:2061)
      ==3262==    by 0x1163A0C6: qemuMigrationPrepareAny (qemu_migration.c:2450)
      ==3262==    by 0x1163A923: qemuMigrationPrepareDirect (qemu_migration.c:2626)
      ==3262==    by 0x11682D71: qemuDomainMigratePrepare3Params (qemu_driver.c:10309)
      ==3262==    by 0x53B0976: virDomainMigratePrepare3Params (libvirt.c:7266)
      ==3262==    by 0x1502D3: remoteDispatchDomainMigratePrepare3Params (remote.c:4797)
      ==3262==    by 0x12DECA: remoteDispatchDomainMigratePrepare3ParamsHelper (remote_dispatch.h:5741)
      ==3262==    by 0x54322EB: virNetServerProgramDispatchCall (virnetserverprogram.c:435)
      
      The mon->vm is set in qemuMonitorOpenInternal() which is the correct
      place to increase @vm ref counter. The correct place to decrease the ref
      counter is then qemuMonitorDispose().
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c7ac2519
    • B
      util: fix two virCompareLimitUlong bugs · 19e7c04d
      Bing Bu Cao 提交于
      The helper function virCompareLimitUlong compares limit values,
      where value of 0 is equal to unlimited. If the latter parameter is 0,
      it should return -1 instead of 1, hence the user can only set hard_limit when
      swap_hard_limit currently is unlimited.
      
      Worse, all callers pass 2 64-bit values, but on 32-bit platforms,
      the second argument was silently truncated to 32 bits, which
      could lead to incorrect computations.
      Signed-off-by: NBing Bu Cao <mars@linux.vnet.ibm.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      19e7c04d
    • D
      Move virNetDevVPort enum impl into virnetdevvportprofile.c · 1fb4d892
      Daniel P. Berrange 提交于
      The enum for virNetDevVPort is declared in the header file
      virnetdevvportprofile.h, but for some reason the impl is
      in netdev_vport_profile_conf.c.
      
      This causes a dep from src/util onto src/conf which is not
      allowed. Move the enum impl into virnetdevvportprofile.c
      to break the circle.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1fb4d892
    • M
      qemu_conf: Introduce "migration_address" · 1606d89c
      Michal Privoznik 提交于
      This configuration knob is there to override default listen address for
      -incoming for all qemu domains.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1606d89c
    • M
    • M
      virsocket: Introduce virSocketAddrIsWildcard · 1f9546e3
      Michal Privoznik 提交于
      This function takes exactly one argument: an address to check.
      It returns true, if the address is an IPv4 or IPv6 address in numeric
      format, false otherwise (e.g. for "examplehost").
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1f9546e3
    • M
      Migration: Introduce VIR_MIGRATE_PARAM_LISTEN_ADDRESS · 72aafe9c
      Michal Privoznik 提交于
      The parameter allows overriding default listen address for '-incoming'
      cmd line argument on destination.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      72aafe9c
    • M
      qemu: Introduce qemuDomainDefCheckABIStability · 7d704812
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=994364
      
      Whenever we check for ABI stability, we have new xml (e.g. provided by
      user, or obtained from snapshot, whatever) which we compare to old xml
      and see if ABI won't break. However, if the new xml was produced via
      virDomainGetXMLDesc(..., VIR_DOMAIN_XML_MIGRATABLE) it lacks some
      devices, e.g. 'pci-root' controller. Hence, the ABI stability check
      fails even though it is stable. Moreover, we can't simply fix
      virDomainDefCheckABIStability because removing the correct devices is
      task for the driver. For instance, qemu driver wants to remove the usb
      controller too, while LXC driver doesn't. That's why we need special
      qemu wrapper over virDomainDefCheckABIStability which removes the
      correct devices from domain XML, produces MIGRATABLE xml and calls the
      check ABI stability function.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      7d704812
    • M
      c643b64e
    • M
      370a7a79