- 15 10月, 2013 37 次提交
-
-
由 Peter Krempa 提交于
These return boolean results.
-
由 Peter Krempa 提交于
Use virCPUx86DataIterator and virCPUx86DataIteratorInit.
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
This patch adds cpuDataFormat and cpuDataParse APIs to be used in unit tests for testing APIs that deal with virCPUData. In the x86 world, this means we can now store/load arbitrary CPUID data in the test suite to check correctness of CPU related APIs that could not be tested before. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
Use apostrophes to denote user provided option names when parsing the domain XML.
-
由 Peter Krempa 提交于
Change the RelaxNG schema option name so that it can be reused for non-hyperv feature flags.
-
由 Hongwei Bi 提交于
-
由 Daniel Hansel 提交于
Introduced by commit 3f029fb5 the RPM build was broken due to a missing LXC textcase. Signed-off-by: NDaniel Hansel <daniel.hansel@linux.vnet.ibm.com>
-
由 Chen Hanxiao 提交于
The range of valid values for cgroup tunables has changed in the past and may change again in future kernels. Avoid hardcoding range checks in libvirt code, delegating range checking to the kernel itself. Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
-
由 Chen Hanxiao 提交于
When EINVAL is returned while changing a cgroups value, tell user that what values are invalid for the field. Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
-
由 Chen Hanxiao 提交于
Since 2.6.39, kernel changed the minimum weight of device blkio. Update related docs. Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com> Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
-
由 Ryota Ozaki 提交于
VirtualBox has 'saved' state for VMs saved by the hypervisor. However, the state is treated as VIR_DOMAIN_NOSTATE by the vbox driver, resulting that virsh shows 'no state' for saved VMs. The fix treats the state as VIR_DOMAIN_SHUTOFF as same as other domains such as qemu. Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com>
-
由 Ryota Ozaki 提交于
The code for converting between virtualbox API states and libvirt states was duplicated in two places. Pull the code out into a shared helper method. Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com>
-
由 Geoff Hickey 提交于
The vmx file parsing code was reporting errors when parsing floppy.fileName entries if the filename didn't end in .flp. There is no such restriction in ESX; even using the GUI to configure floppy filenames you can specify any arbitrary file with any extension. Fix by changing the vmx parsing code so that it uses the floppy.fileType value to determine whether floppy.fileName refers to a block device or a regular file. Also remove code that would have generated an error if no floppy.fileName was specified. This is not an error either. Updated the floppy tests in vmx2xmltest.c and xml2vmxtest.c.
-
由 Daniel P. Berrange 提交于
Start a page describing some of the things that applications using libvirt need to bear in mind to ensure security of their systems. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Ján Tomko 提交于
Introduced by 1fa7946f. https://bugzilla.redhat.com/show_bug.cgi?id=1019023
-
由 Peter Krempa 提交于
In commit d2467709 the header of one of the post parse callbacks was changed, but the function used as the callback in the xenapi driver wasn't adapted. This resulted into: CC xenapi/libvirt_driver_xenapi_la-xenapi_utils.lo xenapi/xenapi_driver.c:63:5: error: initialization from incompatible pointer type [-Werror] xenapi/xenapi_driver.c:63:5: error: (near initialization for 'xenapiDomainDefParserConfig.devicesPostParseCallback') [-Werror]
-
由 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). Now that the code base has been cleaned, enforce it with a syntax checker. * cfg.mk (sc_forbid_const_pointer_typedef): New rule. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 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 all remaining offenders. * src/lxc/lxc_process.c (virLXCProcessSetupInterfaceBridged): Drop needless const. * src/uml/uml_driver.c (umlMonitorCommand): Use intended type. (umlMonitorAddress): Fix fallout. * src/xen/xm_internal.c (xenXMDomainSearchForUUID): Use intended type. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 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/qemu. * src/qemu/qemu_bridge_filter.h (networkAllowMacOnPort) (networkDisallowMacOnPort): Use intended type. * src/qemu/qemu_bridge_filter.c (networkAllowMacOnPort) (networkDisallowMacOnPort): Likewise. * src/qemu/qemu_command.c (qemuBuildTPMBackendStr) (qemuBuildTPMDevStr, qemuBuildCpuArgStr) (qemuBuildObsoleteAccelArg, qemuBuildMachineArgStr) (qemuBuildSmpArgStr, qemuBuildNumaArgStr): Likewise. * src/qemu/qemu_conf.c (qemuSharedDeviceEntryCopy): Likewise. * src/qemu/qemu_driver.c (qemuDomainSaveImageStartVM): Likewise. * src/qemu/qemu_hostdev.c (qemuDomainHostdevNetConfigVirtPortProfile): Likewise. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONAttachCharDevCommand): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 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/security. * src/security/security_apparmor.c (reload_profile) (AppArmorSetSecurityHostdevLabelHelper) (AppArmorReleaseSecurityLabel, AppArmorRestoreSecurityAllLabel) (AppArmorSetSecurityProcessLabel) (AppArmorSetSecurityChildProcessLabel) (AppArmorSetSecurityImageLabel, AppArmorSecurityVerify) (AppArmorSetSecurityHostdevLabel) (AppArmorRestoreSecurityHostdevLabel, AppArmorSetFDLabel): Drop needless const. * src/security/security_selinux.c (virSecuritySELinuxSetSecurityFileLabel): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 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/conf, and their fallout. * src/conf/snapshot_conf.h (virDomainSnapshotAssignDef) (virDomainSnapshotFindByName): Drop attempt at const. * src/conf/interface_conf.h (virInterfaceObjIsActive) (virInterfaceDefFormat): Use intended type. (virInterfaceFindByMACString, virInterfaceFindByName) (virInterfaceAssignDef, virInterfaceRemove): Drop attempt at const. * src/conf/network_conf.h (virNetworkObjIsActive) (virNetworkDefFormat, virNetworkDefForwardIf) (virNetworkDefGetIpByIndex, virNetworkIpDefPrefix) (virNetworkIpDefNetmask): Use intended type. (virNetworkFindByUUID, virNetworkFindByName, virNetworkAssignDef) (virNetworkObjAssignDef, virNetworkRemoveInactive) (virNetworkBridgeInUse, virNetworkSetBridgeName) (virNetworkAllocateBridge): Drop attempt at const. * src/conf/netdev_vlan_conf.h (virNetDevVlanFormat): Make const-correct. * src/conf/node_device_conf.h (virNodeDeviceHasCap) (virNodeDeviceDefFormat): Use intended type. (virNodeDeviceFindByName, virNodeDeviceFindBySysfsPath) (virNodeDeviceAssignDef, virNodeDeviceObjRemove) (virNodeDeviceGetParentHost): Drop attempt at const. * src/conf/secret_conf.h (virSecretDefFormat): Use intended type. * src/conf/snapshot_conf.c (virDomainSnapshotAssignDef) (virDomainSnapshotFindByName): Fix fallout. * src/conf/interface_conf.c (virInterfaceBridgeDefFormat) (virInterfaceBondDefFormat, virInterfaceVlanDefFormat) (virInterfaceProtocolDefFormat, virInterfaceDefDevFormat) (virInterfaceDefFormat, virInterfaceFindByMACString) (virInterfaceFindByName, virInterfaceAssignDef) (virInterfaceRemove): Likewise. * src/conf/network_conf.c (VIR_ENUM_IMPL, virNetworkFindByName, virNetworkObjAssignDef) (virNetworkAssignDef, virNetworkRemoveInactive) (virNetworkDefGetIpByIndex, virNetworkIpDefPrefix) (virNetworkIpDefNetmask, virNetworkDHCPHostDefParseXML) (virNetworkIpDefFormat, virNetworkRouteDefFormat) (virPortGroupDefFormat, virNetworkForwardNatDefFormat) (virNetworkDefFormatInternal, virNetworkBridgeInUse) (virNetworkAllocateBridge, virNetworkSetBridgeName) (virNetworkDNSDefFormat, virNetworkDefFormat): Likewise. * src/conf/netdev_vlan_conf.c (virNetDevVlanFormat): Likewise. * src/conf/node_device_conf.c (virNodeDeviceHasCap) (virNodeDeviceFindBySysfsPath, virNodeDeviceFindByName) (virNodeDeviceAssignDef, virNodeDeviceObjRemove) (virNodeDeviceDefFormat, virNodeDeviceGetParentHost): Likewise. * src/conf/secret_conf.c (virSecretDefFormatUsage) (virSecretDefFormat): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 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/conf/domain_conf, and their fallout. Several things to note: virObjectLock() requires a non-const argument; if this were C++, we could treat the locking field as 'mutable' and allow locking an otherwise 'const' object, but that is a more invasive change, so I instead dropped attempts to be const-correct on domain lookup. virXMLPropString and friends require a non-const xmlNodePtr - this is because libxml2 is not a const-correct library. We could make the src/util/virxml wrappers cast away const, but I figured it was easier to not try to mark xmlNodePtr as const. Finally, virDomainDeviceDefCopy was a rather hard conversion - it calls virDomainDeviceDefPostParse, which in turn in the xen driver was actually modifying the domain outside of the current device being visited. We should not be adding a device on the first per-device callback, but waiting until after all per-device callbacks are complete. * src/conf/domain_conf.h (virDomainObjListFindByID) (virDomainObjListFindByUUID, virDomainObjListFindByName) (virDomainObjAssignDef, virDomainObjListAdd): Drop attempt at const. (virDomainDeviceDefCopy): Use intended type. (virDomainDeviceDefParse, virDomainDeviceDefPostParseCallback) (virDomainVideoDefaultType, virDomainVideoDefaultRAM) (virDomainChrGetDomainPtrs): Make const-correct. * src/conf/domain_conf.c (virDomainObjListFindByID) (virDomainObjListFindByUUID, virDomainObjListFindByName) (virDomainDeviceDefCopy, virDomainObjListAdd) (virDomainObjAssignDef, virDomainHostdevSubsysUsbDefParseXML) (virDomainHostdevSubsysPciOrigStatesDefParseXML) (virDomainHostdevSubsysPciDefParseXML) (virDomainHostdevSubsysScsiDefParseXML) (virDomainControllerModelTypeFromString) (virDomainTPMDefParseXML, virDomainTimerDefParseXML) (virDomainSoundCodecDefParseXML, virDomainSoundDefParseXML) (virDomainWatchdogDefParseXML, virDomainRNGDefParseXML) (virDomainMemballoonDefParseXML, virDomainNVRAMDefParseXML) (virSysinfoParseXML, virDomainVideoAccelDefParseXML) (virDomainVideoDefParseXML, virDomainHostdevDefParseXML) (virDomainRedirdevDefParseXML) (virDomainRedirFilterUsbDevDefParseXML) (virDomainRedirFilterDefParseXML, virDomainIdMapEntrySort) (virDomainIdmapDefParseXML, virDomainVcpuPinDefParseXML) (virDiskNameToBusDeviceIndex, virDomainDeviceDefCopy) (virDomainVideoDefaultType, virDomainHostdevAssignAddress) (virDomainDeviceDefPostParseInternal, virDomainDeviceDefPostParse) (virDomainChrGetDomainPtrs, virDomainControllerSCSINextUnit) (virDomainSCSIDriveAddressIsUsed) (virDomainDriveAddressIsUsedByDisk) (virDomainDriveAddressIsUsedByHostdev): Fix fallout. * src/openvz/openvz_driver.c (openvzDomainDeviceDefPostParse): Likewise. * src/libxl/libxl_domain.c (libxlDomainDeviceDefPostParse): Likewise. * src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse) (qemuDomainDefaultNetModel): Likewise. * src/lxc/lxc_domain.c (virLXCDomainDeviceDefPostParse): Likewise. * src/uml/uml_driver.c (umlDomainDeviceDefPostParse): Likewise. * src/xen/xen_driver.c (xenDomainDeviceDefPostParse): Split... (xenDomainDefPostParse): ...since per-device callback is not the time to be adding a device. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 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>
-
由 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>
-
由 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>
-
由 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>
-
由 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>
-
由 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>
-
由 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>
-
由 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>
-
由 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.
-
- 14 10月, 2013 3 次提交
-
-
由 Daniel P. Berrange 提交于
Make the virLXCProcessReadLogOutputData method ignore the log lines about the container startup argv, ignore the generic error message from libvirt_lxc when lxcContainerMain fails and skip over blank lines. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The lxcContainerResolveSymlinks method merely logged some errors as debug messages, rather than reporting them as proper errors. This meant startup failures were not diagnosed at all. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Ensure the lxcContainerMain method reports any errors that occur during setup to stderr, where libvirtd will pick them up. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-