- 15 10月, 2013 24 次提交
-
-
由 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 16 次提交
-
-
由 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>
-
由 Doug Goldstein 提交于
Serial devices don't necessarily have to be attached to an output to be shown to the guest.
-
由 Doug Goldstein 提交于
This reverts commit dba04e7f. This change was unfortunately not correct. We should have been changing the boolean argument supplied.
-
由 Peter Krempa 提交于
The regular save image code has the support to compress images using a specified algorithm. This was not implemented for external checkpoints although it shares most of the backend code. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1017227
-
由 Peter Krempa 提交于
The regular save image code has the support to compress images using a specified algorithm. This was not implemented for managed save although it shares most of the backend code.
-
由 Daniel P. Berrange 提交于
In Fedora 20, libvirt_lxc crashes immediately at startup with a trace #0 0x00007f0cddb653ec in free () from /lib64/libc.so.6 #1 0x00007f0ce0e16f4a in virFree (ptrptr=ptrptr@entry=0x7f0ce1830058) at util/viralloc.c:580 #2 0x00007f0ce0e2764b in virResetError (err=0x7f0ce1830030) at util/virerror.c:354 #3 0x00007f0ce0e27a5a in virResetLastError () at util/virerror.c:387 #4 0x00007f0ce0e28858 in virEventRegisterDefaultImpl () at util/virevent.c:233 #5 0x00007f0ce0db47c6 in main (argc=11, argv=0x7fff4596c328) at lxc/lxc_controller.c:2352 Normally virInitialize calls virErrorInitialize and virThreadInitialize, but we don't link to libvirt.so in libvirt_lxc, and nor did we ever call the error or thread initializers. I have absolutely no idea how this has ever worked, let alone what caused it to stop working in Fedora 20. In addition not all code paths from virLogSetFromEnv will ensure virLogInitialize is called correctly, which is another possible crash scenario. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Previous commit commit 7ada155c Author: Gao feng <gaofeng@cn.fujitsu.com> Date: Wed Sep 11 11:15:02 2013 +0800 DBus: introduce virDBusIsServiceEnabled Made the cgroups code fallback to non-systemd based setup when dbus is not running. It was too big a hammer though, as it did not check what error code was received when the dbus connection failed. Thus it silently ignored serious errors from dbus such as "too many client connections", which should always be treated as fatal. We only want to ignore errors if the dbus unix socket does not exist, or if nothing is listening on it. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The LXC code would read the log file if an LXC guest failed to startup. There were a number of failure cases where the guest will not start and libvirtd never gets as far as looking at the log file. Fix this by replacing some earlier generic errors with messages from the log. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The LXC controller main() method initialized 'rc' to 1 rather than '-1'. In the cleanup path it will print any error to stderr, if-and-only-if rc < 0. Hence the incorrect initialization caused errors to be lost. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The log message regex has been [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}\+[0-9]{4}: [0-9]+: debug|info|warning|error : The precedence of '|' is high though, so this is equivalent to matching [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}\+[0-9]{4}: [0-9]+: debug Or info Or warning Or error : Which is clearly not what it should have done. This caused the code to skip over things which are not log messages. The solution is to simply add brackets. A test case is also added to validate correctness. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The LXC controller uses dbus to talk to systemd to create cgroups. This means that each LXC controller instance has a dbus connection. The DBus daemon is limited to 256 connections by default and we want to be able to run many 1000 of containers. While the dbus limit could be raised in the config files, it is simpler to make libvirt LXC controller close its dbus connection once everything is configured. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
If the dbus system bus connection is marked as private, then allow it to be closed. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The dbus_bus_get() function returns a shared bus connection that all libraries in a process can use. You are forbidden from calling close on this connection though, since you can never know if any other code might be using it. Add an option to use private dbus bus connections, if the app wants to be able to close the connection. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Chen Hanxiao 提交于
Fix the improper comment for the "release" hook. Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
-