libvirt/src/libvirt_private.syms

2428 lines
55 KiB
Plaintext
Raw Normal View History

#
# General private symbols. Add symbols here, and see Makefile.am for
# more details.
#
# Keep this file sorted by header name, then by symbols with each header.
#
# access/viraccessmanager.h
virAccessManagerCheckConnect;
virAccessManagerCheckDomain;
virAccessManagerCheckInterface;
virAccessManagerCheckNetwork;
virAccessManagerCheckNodeDevice;
virAccessManagerCheckNWFilter;
virAccessManagerCheckSecret;
virAccessManagerCheckStoragePool;
virAccessManagerCheckStorageVol;
virAccessManagerGetDefault;
virAccessManagerNew;
virAccessManagerNewStack;
virAccessManagerSetDefault;
# access/viraccessperm.h
virAccessPermConnectTypeFromString;
virAccessPermConnectTypeToString;
virAccessPermDomainTypeFromString;
virAccessPermDomainTypeToString;
virAccessPermInterfaceTypeFromString;
virAccessPermInterfaceTypeToString;
virAccessPermNetworkTypeFromString;
virAccessPermNetworkTypeToString;
virAccessPermNodeDeviceTypeFromString;
virAccessPermNodeDeviceTypeToString;
virAccessPermNWFilterTypeFromString;
virAccessPermNWFilterTypeToString;
virAccessPermSecretTypeFromString;
virAccessPermSecretTypeToString;
virAccessPermStoragePoolTypeFromString;
virAccessPermStoragePoolTypeToString;
virAccessPermStorageVolTypeFromString;
virAccessPermStorageVolTypeToString;
# conf/capabilities.h
virCapabilitiesAddGuest;
virCapabilitiesAddGuestDomain;
virCapabilitiesAddGuestFeature;
virCapabilitiesAddHostFeature;
virCapabilitiesAddHostMigrateTransport;
virCapabilitiesAddHostNUMACell;
virCapabilitiesAllocMachines;
virCapabilitiesClearHostNUMACellCPUTopology;
virCapabilitiesDomainDataLookup;
virCapabilitiesFormatXML;
virCapabilitiesFreeMachines;
virCapabilitiesFreeNUMAInfo;
virCapabilitiesGetCpusForNodemask;
virCapabilitiesHostSecModelAddBaseLabel;
virCapabilitiesNew;
virCapabilitiesSetHostCPU;
# conf/cpu_conf.h
virCPUDefAddFeature;
virCPUDefCopy;
virCPUDefCopyModel;
virCPUDefFormat;
virCPUDefFormatBuf;
virCPUDefFree;
virCPUDefFreeModel;
virCPUDefParseXML;
virCPUDefUpdateFeature;
virCPUModeTypeToString;
# conf/device_conf.h
virDevicePCIAddressEqual;
virDevicePCIAddressFormat;
virDevicePCIAddressIsValid;
virDevicePCIAddressParseXML;
virInterfaceLinkFormat;
virInterfaceLinkParseXML;
virInterfaceStateTypeFromString;
virInterfaceStateTypeToString;
# conf/domain_addr.h
virDomainCCWAddressAllocate;
virDomainCCWAddressAssign;
virDomainCCWAddressReleaseAddr;
virDomainCCWAddressSetCreate;
virDomainCCWAddressSetFree;
virDomainCCWAddressValidate;
virDomainPCIAddressAsString;
virDomainPCIAddressBusSetModel;
virDomainPCIAddressEnsureAddr;
virDomainPCIAddressFlagsCompatible;
virDomainPCIAddressGetNextSlot;
virDomainPCIAddressReleaseSlot;
virDomainPCIAddressReserveAddr;
virDomainPCIAddressReserveNextSlot;
virDomainPCIAddressReserveSlot;
virDomainPCIAddressSetAlloc;
virDomainPCIAddressSetFree;
virDomainPCIAddressSetGrow;
virDomainPCIAddressSlotInUse;
virDomainPCIAddressValidate;
virDomainVirtioSerialAddrAssign;
virDomainVirtioSerialAddrAutoAssign;
virDomainVirtioSerialAddrIsComplete;
virDomainVirtioSerialAddrRelease;
virDomainVirtioSerialAddrReserve;
virDomainVirtioSerialAddrSetAddController;
virDomainVirtioSerialAddrSetAddControllers;
virDomainVirtioSerialAddrSetCreate;
virDomainVirtioSerialAddrSetFree;
virDomainVirtioSerialAddrSetRemoveController;
# conf/domain_audit.h
virDomainAuditCgroup;
virDomainAuditCgroupMajor;
virDomainAuditCgroupPath;
virDomainAuditChardev;
virDomainAuditDisk;
virDomainAuditFS;
virDomainAuditHostdev;
virDomainAuditInit;
virDomainAuditIOThread;
virDomainAuditMemory;
virDomainAuditNet;
virDomainAuditNetDevice;
virDomainAuditRedirdev;
virDomainAuditRNG;
virDomainAuditSecurityLabel;
virDomainAuditStart;
virDomainAuditStop;
virDomainAuditVcpu;
# conf/domain_capabilities.h
virDomainCapsEnumClear;
virDomainCapsEnumSet;
virDomainCapsFormat;
virDomainCapsNew;
# conf/domain_conf.h
virBlkioDeviceArrayClear;
virDiskNameToBusDeviceIndex;
virDiskNameToIndex;
virDomainActualNetDefFree;
virDomainBlockedReasonTypeFromString;
virDomainBlockedReasonTypeToString;
virDomainCapabilitiesPolicyTypeToString;
virDomainCapsFeatureTypeToString;
virDomainChrConsoleTargetTypeFromString;
virDomainChrConsoleTargetTypeToString;
virDomainChrDefForeach;
virDomainChrDefFree;
virDomainChrDefNew;
virDomainChrEquals;
virDomainChrFind;
virDomainChrGetDomainPtrs;
virDomainChrInsertPreAlloced;
virDomainChrPreAlloc;
virDomainChrRemove;
virDomainChrSerialTargetTypeFromString;
virDomainChrSerialTargetTypeToString;
virDomainChrSourceDefClear;
virDomainChrSourceDefCopy;
domain_conf: split source data out from ChrDef This opens up the possibility of reusing the smaller ChrSourceDef for both qemu monitor and a passthrough smartcard device. * src/conf/domain_conf.h (_virDomainChrDef): Factor host details... (_virDomainChrSourceDef): ...into new struct. (virDomainChrSourceDefFree): New prototype. * src/conf/domain_conf.c (virDomainChrDefFree) (virDomainChrDefParseXML, virDomainChrDefFormat): Split... (virDomainChrSourceDefClear, virDomainChrSourceDefFree) (virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat): ...into new functions. (virDomainChrDefParseTargetXML): Update clients to reflect type split. * src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel) (virVMXFormatSerial, virVMXFormatParallel): Likewise. * src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise. * src/xen/xend_internal.c (xenDaemonParseSxprChar) (xenDaemonFormatSxprChr): Likewise. * src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial) (vboxAttachParallel): Likewise. * src/security/security_dac.c (virSecurityDACSetChardevLabel) (virSecurityDACSetChardevCallback) (virSecurityDACRestoreChardevLabel) (virSecurityDACRestoreChardevCallback): Likewise. * src/security/security_selinux.c (SELinuxSetSecurityChardevLabel) (SELinuxSetSecurityChardevCallback) (SELinuxRestoreSecurityChardevLabel) (SELinuxSetSecurityChardevCallback): Likewise. * src/security/virt-aa-helper.c (get_files): Likewise. * src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole): Likewise. * src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise. * src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY) (umlDomainOpenConsole): Likewise. * src/qemu/qemu_command.c (qemuBuildChrChardevStr) (qemuBuildChrArgStr, qemuBuildCommandLine) (qemuParseCommandLineChr): Likewise. * src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat) (qemuDomainObjPrivateXMLParse): Likewise. * src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise. * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise. * src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor) (qemudFindCharDevicePTYs, qemuPrepareChardevDevice) (qemuPrepareMonitorChr, qemudShutdownVMDaemon) (qemuDomainOpenConsole): Likewise. * src/qemu/qemu_command.h (qemuBuildChrChardevStr) (qemuBuildChrArgStr): Delete, now that they are static. * src/libvirt_private.syms (domain_conf.h): New exports. * cfg.mk (useless_free_options): Update list. * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update tests.
2011-01-07 22:45:01 +00:00
virDomainChrSourceDefFree;
virDomainChrSpicevmcTypeFromString;
virDomainChrSpicevmcTypeToString;
virDomainChrTcpProtocolTypeFromString;
virDomainChrTcpProtocolTypeToString;
virDomainChrTypeFromString;
virDomainChrTypeToString;
virDomainClockBasisTypeToString;
virDomainClockOffsetTypeFromString;
virDomainClockOffsetTypeToString;
virDomainConfigFile;
virDomainControllerAliasFind;
virDomainControllerDefFree;
virDomainControllerFind;
virDomainControllerFindByType;
virDomainControllerInsert;
virDomainControllerInsertPreAlloced;
qemu: set/validate slot/connection type when assigning slots for PCI devices Since PCI bridges, PCIe bridges, PCIe switches, and PCIe root ports all share the same namespace, they are all defined as controllers of type='pci' in libvirt (but with a differing model attribute). Each of these controllers has a certain connection type upstream, allows certain connection types downstream, and each can either allow a single downstream connection at slot 0, or connections from slot 1 - 31. Right now, we only support the pci-root and pci-bridge devices, both of which only allow PCI devices to connect, and both which have usable slots 1 - 31. In preparation for adding other types of controllers that have different capabilities, this patch 1) adds info to the qemuDomainPCIAddressBus object to indicate the capabilities, 2) sets those capabilities appropriately for pci-root and pci-bridge devices, and 3) validates that the controller being connected to is the proper type when allocating slots or validating that a user-selected slot is appropriate for a device.. Having this infrastructure in place will make it much easier to add support for the other PCI controller types. While it would be possible to do all the necessary checking by just storing the controller model in the qemyuDomainPCIAddressBus, it greatly simplifies all the validation code to also keep a "flags", "minSlot" and "maxSlot" for each - that way we can just check those attributes rather than requiring a nearly identical switch statement everywhere we need to validate compatibility. You may notice many places where the flags are seemingly hard-coded to QEMU_PCI_CONNECT_HOTPLUGGABLE | QEMU_PCI_CONNECT_TYPE_PCI This is currently the correct value for all PCI devices, and in the future will be the default, with small bits of code added to change to the flags for the few devices which are the exceptions to this rule. Finally, there are a few places with "FIXME" comments. Note that these aren't indicating places that are broken according to the currently supported devices, they are places that will need fixing when support for new PCI controller models is added. To assure that there was no regression in the auto-allocation of PCI addresses or auto-creation of integrated pci-root, ide, and usb controllers, a new test case (pci-bridge-many-disks) has been added to both the qemuxml2argv and qemuxml2xml tests. This new test defines a domain with several dozen virtio disks but no pci-root or pci-bridges. The .args file of the new test case was created using libvirt sources from before this patch, and the test still passes after this patch has been applied.
2013-07-15 00:09:44 +00:00
virDomainControllerModelPCITypeToString;
virDomainControllerModelSCSITypeFromString;
virDomainControllerModelSCSITypeToString;
virDomainControllerModelUSBTypeFromString;
virDomainControllerModelUSBTypeToString;
virDomainControllerRemove;
virDomainControllerTypeToString;
virDomainCpuPlacementModeTypeFromString;
virDomainCpuPlacementModeTypeToString;
virDomainDefAddImplicitControllers;
virDomainDefCheckABIStability;
virDomainDefCheckDuplicateDiskWWN;
virDomainDefCheckUnsupportedMemoryHotplug;
virDomainDefClearCCWAddresses;
virDomainDefClearDeviceAliases;
virDomainDefClearPCIAddresses;
virDomainDefCompatibleDevice;
virDomainDefCopy;
virDomainDefFindDevice;
virDomainDefFormat;
virDomainDefFormatConvertXMLFlags;
virDomainDefFormatInternal;
virDomainDefFree;
virDomainDefGetDefaultEmulator;
virDomainDefGetMemoryActual;
virDomainDefGetMemoryInitial;
virDomainDefGetSecurityLabelDef;
virDomainDefHasDeviceAddress;
virDomainDefMaybeAddController;
virDomainDefMaybeAddInput;
virDomainDefNeedsPlacementAdvice;
virDomainDefNew;
virDomainDefNewFull;
virDomainDefParseFile;
virDomainDefParseNode;
virDomainDefParseString;
virDomainDefPostParse;
virDomainDefSetMemoryInitial;
virDomainDeleteConfig;
virDomainDeviceAddressIsValid;
virDomainDeviceAddressTypeToString;
virDomainDeviceDefCheckUnsupportedMemoryDevice;
virDomainDeviceDefCopy;
virDomainDeviceDefFree;
virDomainDeviceDefParse;
virDomainDeviceFindControllerModel;
virDomainDeviceGetInfo;
virDomainDeviceInfoCopy;
virDomainDeviceInfoIterate;
virDomainDeviceTypeToString;
virDomainDiskBusTypeToString;
virDomainDiskByAddress;
virDomainDiskByName;
virDomainDiskCacheTypeFromString;
virDomainDiskCacheTypeToString;
virDomainDiskDefAssignAddress;
disk: Disallow duplicated target 'dev' values https://bugzilla.redhat.com/show_bug.cgi?id=1142631 This patch resolves a situation where the same "<target dev='$name'...>" can be used for multiple disks in the domain. While the $name is "mostly" advisory regarding the expected order that the disk is added to the domain and not guaranteed to map to the device name in the guest OS, it still should be unique enough such that other domblk* type operations can be performed. Without the patch, the domblklist will list the same Target twice: $ virsh domblklist $dom Target Source ------------------------------------------------ sda /var/lib/libvirt/images/file.qcow2 sda /var/lib/libvirt/images/file.img Additionally, getting domblkstat, domblkerror, domblkinfo, and other block* type calls will not be able to reference the second target. Fortunately, hotplug disallows adding a "third" sda value: $ qemu-img create -f raw /var/lib/libvirt/images/file2.img 10M $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sda error: Failed to attach disk error: operation failed: target sda already exists $ BUT, it since 'sdb' doesn't exist one would get the following on the same hotplug attempt, but changing to use 'sdb' instead of 'sda' $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sdb error: Failed to attach disk error: internal error: unable to execute QEMU command 'device_add': Duplicate ID 'scsi0-0-1' for device $ Since we cannot fix this issue at parsing time, the best that can be done so as to not "lose" a domain is to make the check prior to starting the guest with the results as follows: $ virsh start $dom error: Failed to start domain $dom error: XML error: target 'sda' duplicated for disk sources '/var/lib/libvirt/images/file.qcow2' and '/var/lib/libvirt/images/file.img' $ Running 'make check' found a few more instances in the tests where this duplicated target dev value was being used. These also exhibited some duplicated 'id=' values (negating the uniqueness argument of aliases) in the corresponding .args file and of course the *xmlout version of a few input XML files.
2015-02-26 17:20:01 +00:00
virDomainDiskDefDstDuplicates;
virDomainDiskDefForeachPath;
virDomainDiskDefFree;
virDomainDiskDefNew;
virDomainDiskDefSourceParse;
virDomainDiskDeviceTypeToString;
virDomainDiskDiffersSourceOnly;
virDomainDiskDiscardTypeToString;
virDomainDiskErrorPolicyTypeFromString;
virDomainDiskErrorPolicyTypeToString;
virDomainDiskFindByBusAndDst;
virDomainDiskGeometryTransTypeFromString;
virDomainDiskGeometryTransTypeToString;
virDomainDiskGetDriver;
virDomainDiskGetFormat;
virDomainDiskGetSource;
virDomainDiskGetType;
virDomainDiskIndexByAddress;
virDomainDiskIndexByName;
virDomainDiskInsert;
virDomainDiskInsertPreAlloced;
virDomainDiskIoTypeFromString;
virDomainDiskIoTypeToString;
virDomainDiskMirrorStateTypeFromString;
virDomainDiskMirrorStateTypeToString;
snapshot: also support disks by path I got confused when 'virsh domblkinfo dom disk' required the path to a disk (which can be ambiguous, since a single file can back multiple disks), rather than the unambiguous target device name that I was using in disk snapshots. So, in true developer fashion, I went for the best of both worlds - all interfaces that operate on a disk (aka block) now accept either the target name or the unambiguous path to the backing file used by the disk. * src/conf/domain_conf.h (virDomainDiskIndexByName): Add parameter. (virDomainDiskPathByName): New prototype. * src/libvirt_private.syms (domain_conf.h): Export it. * src/conf/domain_conf.c (virDomainDiskIndexByName): Also allow searching by path, and decide whether ambiguity is okay. (virDomainDiskPathByName): New function. (virDomainDiskRemoveByName, virDomainSnapshotAlignDisks): Update callers. * src/qemu/qemu_driver.c (qemudDomainBlockPeek) (qemuDomainAttachDeviceConfig, qemuDomainUpdateDeviceConfig) (qemuDomainGetBlockInfo, qemuDiskPathToAlias): Likewise. * src/qemu/qemu_process.c (qemuProcessFindDomainDiskByPath): Likewise. * src/libxl/libxl_driver.c (libxlDomainAttachDeviceDiskLive) (libxlDomainDetachDeviceDiskLive, libxlDomainAttachDeviceConfig) (libxlDomainUpdateDeviceConfig): Likewise. * src/uml/uml_driver.c (umlDomainBlockPeek): Likewise. * src/xen/xend_internal.c (xenDaemonDomainBlockPeek): Likewise. * docs/formatsnapshot.html.in: Update documentation. * tools/virsh.pod (domblkstat, domblkinfo): Likewise. * docs/schemas/domaincommon.rng (diskTarget): Tighten pattern on disk targets. * docs/schemas/domainsnapshot.rng (disksnapshot): Update to match. * tests/domainsnapshotxml2xmlin/disk_snapshot.xml: Update test.
2011-08-20 02:38:36 +00:00
virDomainDiskPathByName;
virDomainDiskRemove;
virDomainDiskRemoveByName;
virDomainDiskSetDriver;
virDomainDiskSetFormat;
virDomainDiskSetSource;
virDomainDiskSetType;
virDomainDiskSourceIsBlockType;
virDomainFSDefFree;
virDomainFSIndexByName;
virDomainFSInsert;
virDomainFSRemove;
virDomainFSTypeFromString;
virDomainFSTypeToString;
virDomainFSWrpolicyTypeFromString;
virDomainFSWrpolicyTypeToString;
virDomainGetFilesystemForTarget;
virDomainGraphicsAuthConnectedTypeFromString;
virDomainGraphicsAuthConnectedTypeToString;
virDomainGraphicsDefFree;
conf: add <listen> subelement to domain <graphics> element Once it's plugged in, the <listen> element will be an optional replacement for the "listen" attribute that graphics elements already have. If the <listen> element is type='address', it will have an attribute called 'address' which will contain an IP address or dns name that the guest's display server should listen on. If, however, type='network', the <listen> element should have an attribute called 'network' that will be set to the name of a network configuration to get the IP address from. * docs/schemas/domain.rng: updated to allow the <listen> element * docs/formatdomain.html.in: document the <listen> element and its attributes. * src/conf/domain_conf.[hc]: 1) The domain parser, formatter, and data structure are modified to support 0 or more <listen> subelements to each <graphics> element. The old style "legacy" listen attribute is also still accepted, and will be stored internally just as if it were a separate <listen> element. On output (i.e. format), the address attribute of the first <listen> element of type 'address' will be duplicated in the legacy "listen" attribute of the <graphic> element. 2) The "listenAddr" attribute has been removed from the unions in virDomainGRaphicsDef for graphics types vnc, rdp, and spice. This attribute is now in the <listen> subelement (aka virDomainGraphicsListenDef) 3) Helper functions were written to provide simple access (both Get and Set) to the listen elements and their attributes. * src/libvirt_private.syms: export the listen helper functions * src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c, src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c, src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c Modify all these files to use the listen helper functions rather than directly referencing the (now missing) listenAddr attribute. There can be multiple <listen> elements to a single <graphics>, but the drivers all currently only support one, so all replacements of direct access with a helper function indicate index "0". * tests/* - only 3 of these are new files added explicitly to test the new <listen> element. All the others have been modified to reflect the fact that any legacy "listen" attributes passed in to the domain parse will be saved in a <listen> element (i.e. one of the virDomainGraphicsListenDefs), and during the domain format function, both the <listen> element as well as the legacy attributes will be output.
2011-07-07 04:20:28 +00:00
virDomainGraphicsListenGetAddress;
virDomainGraphicsListenGetNetwork;
virDomainGraphicsListenGetType;
virDomainGraphicsListenSetAddress;
virDomainGraphicsListenSetNetwork;
virDomainGraphicsListenSetType;
virDomainGraphicsSpiceChannelModeTypeFromString;
virDomainGraphicsSpiceChannelModeTypeToString;
virDomainGraphicsSpiceChannelNameTypeFromString;
virDomainGraphicsSpiceChannelNameTypeToString;
virDomainGraphicsSpiceImageCompressionTypeFromString;
virDomainGraphicsSpiceImageCompressionTypeToString;
virDomainGraphicsSpiceJpegCompressionTypeFromString;
virDomainGraphicsSpiceJpegCompressionTypeToString;
virDomainGraphicsSpiceMouseModeTypeFromString;
virDomainGraphicsSpiceMouseModeTypeToString;
virDomainGraphicsSpiceStreamingModeTypeFromString;
virDomainGraphicsSpiceStreamingModeTypeToString;
virDomainGraphicsSpiceZlibCompressionTypeFromString;
virDomainGraphicsSpiceZlibCompressionTypeToString;
virDomainGraphicsTypeFromString;
virDomainGraphicsTypeToString;
virDomainGraphicsVNCSharePolicyTypeFromString;
virDomainGraphicsVNCSharePolicyTypeToString;
virDomainHasNet;
virDomainHostdevCapsTypeToString;
virDomainHostdevDefAlloc;
virDomainHostdevDefClear;
2009-04-24 12:19:00 +00:00
virDomainHostdevDefFree;
virDomainHostdevFind;
virDomainHostdevInsert;
virDomainHostdevModeTypeToString;
virDomainHostdevRemove;
virDomainHostdevSubsysPCIBackendTypeToString;
virDomainHostdevSubsysTypeToString;
virDomainHubTypeFromString;
virDomainHubTypeToString;
virDomainHypervTypeFromString;
virDomainHypervTypeToString;
virDomainInputDefFree;
virDomainIOThreadIDAdd;
virDomainIOThreadIDDefFree;
virDomainIOThreadIDDel;
virDomainIOThreadIDFind;
virDomainIOThreadSchedDelId;
virDomainKeyWrapCipherNameTypeFromString;
virDomainKeyWrapCipherNameTypeToString;
virDomainLeaseDefFree;
virDomainLeaseIndex;
virDomainLeaseInsert;
virDomainLeaseInsertPreAlloc;
virDomainLeaseInsertPreAlloced;
virDomainLeaseRemove;
virDomainLeaseRemoveAt;
virDomainLifecycleCrashTypeFromString;
virDomainLifecycleCrashTypeToString;
virDomainLifecycleTypeFromString;
virDomainLifecycleTypeToString;
virDomainLiveConfigHelperMethod;
virDomainLoaderDefFree;
virDomainLoaderTypeFromString;
virDomainLoaderTypeToString;
virDomainLockFailureTypeFromString;
virDomainLockFailureTypeToString;
virDomainMemballoonModelTypeFromString;
virDomainMemballoonModelTypeToString;
virDomainMemoryDefFree;
virDomainMemoryFindByDef;
virDomainMemoryFindInactiveByDef;
virDomainMemoryInsert;
virDomainMemoryRemove;
virDomainNetAppendIpAddress;
virDomainNetDefFormat;
virDomainNetDefFree;
virDomainNetFind;
qemu: fix attach/detach of netdevs with matching mac addrs This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=862515 which describes inconsistencies in dealing with duplicate mac addresses on network devices in a domain. (at any rate, it resolves *almost* everything, and prints out an informative error message for the one problem that isn't solved, but has a workaround.) A synopsis of the problems: 1) you can't do a persistent attach-interface of a device with a mac address that matches an existing device. 2) you *can* do a live attach-interface of such a device. 3) you *can* directly edit a domain and put in two devices with matching mac addresses. 4) When running virsh detach-device (live or config), only MAC address is checked when matching the device to remove, so the first device with the desired mac address will be removed. This isn't always the one that's wanted. 5) when running virsh detach-interface (live or config), the only two items that can be specified to match against are mac address and model type (virtio, etc) - if multiple netdevs match both of those attributes, it again just finds the first one added and assumes that is the only match. Since it is completely valid to have multiple network devices with the same MAC address (although it can cause problems in many cases, there *are* valid use cases), what is needed is: 1) remove the restriction that prohibits doing a persistent add of a netdev with a duplicate mac address. 2) enhance the backend of virDomainDetachDeviceFlags to check for something that *is* guaranteed unique (but still work with just mac address, as long as it yields only a single results. This patch does three things: 1) removes the check for duplicate mac address during a persistent netdev attach. 2) unifies the searching for both live and config detach of netdevices in the subordinate functions of qemuDomainModifyDeviceFlags() to use the new function virDomainNetFindIdx (which matches mac address and PCI address if available, checking for duplicates if only mac address was specified). This function returns -2 if multiple matches are found, allowing the callers to print out an appropriate message. Steps 1 & 2 are enough to fully fix the problem when using virsh attach-device and detach-device (which require an XML description of the device rather than a bunch of commandline args) 3) modifies the virsh detach-interface command to check for multiple matches of mac address and show an error message suggesting use of the detach-device command in cases where there are multiple matching mac addresses. Later we should decide how we want to input a PCI address on the virsh commandline, and enhance detach-interface to take a --address option, eliminating the need to use detach-device * src/conf/domain_conf.c * src/conf/domain_conf.h * src/libvirt_private.syms * added new virDomainNetFindIdx function * removed now unused virDomainNetIndexByMac and virDomainNetRemoveByMac * src/qemu/qemu_driver.c * remove check for duplicate max from qemuDomainAttachDeviceConfig * use virDomainNetFindIdx/virDomainNetRemove instead of virDomainNetRemoveByMac in qemuDomainDetachDeviceConfig * use virDomainNetFindIdx instead of virDomainIndexByMac in qemuDomainUpdateDeviceConfig * src/qemu/qemu_hotplug.c * use virDomainNetFindIdx instead of a homespun loop in qemuDomainDetachNetDevice. * tools/virsh-domain.c: modified detach-interface command as described above
2012-10-25 20:03:35 +00:00
virDomainNetFindIdx;
virDomainNetGenerateMAC;
virDomainNetGetActualBandwidth;
virDomainNetGetActualBridgeMACTableManager;
virDomainNetGetActualBridgeName;
virDomainNetGetActualDirectDev;
virDomainNetGetActualDirectMode;
conf: parse/format type='hostdev' network interfaces This is the new interface type that sets up an SR-IOV PCI network device to be assigned to the guest with PCI passthrough after initializing some network device-specific things from the config (e.g. MAC address, virtualport profile parameters). Here is an example of the syntax: <interface type='hostdev' managed='yes'> <source> <address type='pci' domain='0' bus='0' slot='4' function='3'/> </source> <mac address='00:11:22:33:44:55'/> <address type='pci' domain='0' bus='0' slot='7' function='0'/> </interface> This would assign the PCI card from bus 0 slot 4 function 3 on the host, to bus 0 slot 7 function 0 on the guest, but would first set the MAC address of the card to 00:11:22:33:44:55. NB: The parser and formatter don't care if the PCI card being specified is a standard single function network adapter, or a virtual function (VF) of an SR-IOV capable network adapter, but the upcoming code that implements the back end of this config will work *only* with SR-IOV VFs. This is because modifying the mac address of a standard network adapter prior to assigning it to a guest is pointless - part of the device reset that occurs during that process will reset the MAC address to the value programmed into the card's firmware. Although it's not supported by any of libvirt's hypervisor drivers, usb network hostdevs are also supported in the parser and formatter for completeness and consistency. <source> syntax is identical to that for plain <hostdev> devices, except that the <address> element should have "type='usb'" added if bus/device are specified: <interface type='hostdev'> <source> <address type='usb' bus='0' device='4'/> </source> <mac address='00:11:22:33:44:55'/> </interface> If the vendor/product form of usb specification is used, type='usb' is implied: <interface type='hostdev'> <source> <vendor id='0x0012'/> <product id='0x24dd'/> </source> <mac address='00:11:22:33:44:55'/> </interface> Again, the upcoming patch to fill in the backend of this functionality will log an error and fail with "Unsupported Config" if you actually try to assign a USB network adapter to a guest using <interface type='hostdev'> - just use a standard <hostdev> entry in that case (and also for single-port PCI adapters).
2012-02-15 17:37:15 +00:00
virDomainNetGetActualHostdev;
virDomainNetGetActualTrustGuestRxFilters;
virDomainNetGetActualType;
virDomainNetGetActualVirtPortProfile;
conf: add <vlan> element to network and domain interface elements The following config elements now support a <vlan> subelements: within a domain: <interface>, and the <actual> subelement of <interface> within a network: the toplevel, as well as any <portgroup> Each vlan element must have one or more <tag id='n'/> subelements. If there is more than one tag, it is assumed that vlan trunking is being requested. If trunking is required with only a single tag, the attribute "trunk='yes'" should be added to the toplevel <vlan> element. Some examples: <interface type='hostdev'/> <vlan> <tag id='42'/> </vlan> <mac address='52:54:00:12:34:56'/> ... </interface> <network> <name>vlan-net</name> <vlan trunk='yes'> <tag id='30'/> </vlan> <virtualport type='openvswitch'/> </network> <interface type='network'/> <source network='vlan-net'/> ... </interface> <network> <name>trunk-vlan</name> <vlan> <tag id='42'/> <tag id='43'/> </vlan> ... </network> <network> <name>multi</name> ... <portgroup name='production'/> <vlan> <tag id='42'/> </vlan> </portgroup> <portgroup name='test'/> <vlan> <tag id='666'/> </vlan> </portgroup> </network> <interface type='network'/> <source network='multi' portgroup='test'/> ... </interface> IMPORTANT NOTE: As of this patch there is no backend support for the vlan element for *any* network device type. When support is added in later patches, it will only be for those select network types that support setting up a vlan on the host side, without the guest's involvement. (For example, it will be possible to configure a vlan for a guest connected to an openvswitch bridge, but it won't be possible to do that for one that is connected to a standard Linux host bridge.)
2012-08-12 07:51:30 +00:00
virDomainNetGetActualVlan;
virDomainNetInsert;
virDomainNetRemove;
virDomainNetRemoveHostdev;
virDomainNetTypeFromString;
virDomainNetTypeToString;
virDomainNostateReasonTypeFromString;
virDomainNostateReasonTypeToString;
virDomainObjAssignDef;
virDomainObjBroadcast;
virDomainObjCopyPersistentDef;
virDomainObjEndAPI;
virDomainObjFormat;
virDomainObjGetDefs;
virDomainObjGetMetadata;
virDomainObjGetOneDef;
virDomainObjGetPersistentDef;
virDomainObjGetState;
virDomainObjListAdd;
virDomainObjListCollect;
virDomainObjListConvert;
virDomainObjListExport;
virDomainObjListFindByID;
virDomainObjListFindByName;
virDomainObjListFindByUUID;
virDomainObjListFindByUUIDRef;
virDomainObjListForEach;
virDomainObjListGetActiveIDs;
virDomainObjListGetInactiveNames;
virDomainObjListLoadAllConfigs;
virDomainObjListNew;
virDomainObjListNumOfDomains;
virDomainObjListRemove;
virDomainObjListRemoveLocked;
virDomainObjNew;
virDomainObjParseNode;
virDomainObjSetDefTransient;
virDomainObjSetMetadata;
virDomainObjSetState;
virDomainObjTaint;
virDomainObjUpdateModificationImpact;
virDomainObjWait;
virDomainObjWaitUntil;
virDomainOSTypeFromString;
virDomainOSTypeToString;
virDomainParseMemory;
virDomainPausedReasonTypeFromString;
virDomainPausedReasonTypeToString;
virDomainPinAdd;
virDomainPinDefArrayFree;
virDomainPinDefCopy;
virDomainPinDefFree;
virDomainPinDel;
virDomainPinFind;
virDomainPMSuspendedReasonTypeFromString;
virDomainPMSuspendedReasonTypeToString;
virDomainRedirdevBusTypeFromString;
virDomainRedirdevBusTypeToString;
virDomainRNGBackendTypeToString;
virDomainRNGDefFree;
virDomainRNGFind;
virDomainRNGInsert;
virDomainRNGModelTypeToString;
virDomainRNGRemove;
virDomainRunningReasonTypeFromString;
virDomainRunningReasonTypeToString;
virDomainSaveConfig;
virDomainSaveStatus;
virDomainSaveXML;
virDomainSeclabelTypeFromString;
virDomainSeclabelTypeToString;
virDomainShutdownReasonTypeFromString;
virDomainShutdownReasonTypeToString;
virDomainShutoffReasonTypeFromString;
virDomainShutoffReasonTypeToString;
virDomainSmartcardDefForeach;
virDomainSmartcardDefFree;
virDomainSmartcardTypeFromString;
virDomainSmartcardTypeToString;
virDomainSmbiosModeTypeFromString;
virDomainSmbiosModeTypeToString;
virDomainSoundDefFree;
virDomainSoundModelTypeFromString;
virDomainSoundModelTypeToString;
virDomainStartupPolicyTypeFromString;
virDomainStartupPolicyTypeToString;
virDomainStateReasonFromString;
virDomainStateReasonToString;
virDomainStateTypeFromString;
virDomainStateTypeToString;
virDomainTaintTypeFromString;
virDomainTaintTypeToString;
virDomainTimerModeTypeFromString;
virDomainTimerModeTypeToString;
virDomainTimerNameTypeFromString;
virDomainTimerNameTypeToString;
virDomainTimerTickpolicyTypeFromString;
virDomainTimerTickpolicyTypeToString;
virDomainTimerTrackTypeFromString;
virDomainTimerTrackTypeToString;
virDomainTPMBackendTypeFromString;
virDomainTPMBackendTypeToString;
virDomainTPMDefFree;
virDomainTPMModelTypeFromString;
virDomainTPMModelTypeToString;
virDomainVideoDefaultRAM;
virDomainVideoDefaultType;
virDomainVideoDefFree;
virDomainVideoTypeFromString;
virDomainVideoTypeToString;
virDomainVirtTypeFromString;
virDomainVirtTypeToString;
virDomainWatchdogActionTypeFromString;
virDomainWatchdogActionTypeToString;
virDomainWatchdogModelTypeFromString;
virDomainWatchdogModelTypeToString;
virDomainXMLOptionGetNamespace;
virDomainXMLOptionNew;
# conf/domain_event.h
virDomainEventAgentLifecycleNewFromDom;
virDomainEventAgentLifecycleNewFromObj;
virDomainEventBalloonChangeNewFromDom;
virDomainEventBalloonChangeNewFromObj;
blockjob: use stable disk string in job event When the block job event was first added, it was for block pull, where the active layer of the disk remains the same name. It was also in a day where we only cared about local files, and so we always had a canonical absolute file name. But two things have changed since then: we now have network disks, where determining a single absolute string does not really make sense; and we have two-phase jobs (copy and active commit) where the name of the active layer changes between the first event (ready, on the old name) and second (complete, on the pivoted name). Adam Litke reported that having an unstable string between events makes life harder for clients. Furthermore, all of our API that operate on a particular disk of a domain accept multiple strings: not only the absolute name of the active layer, but also the destination device name (such as 'vda'). As this latter name is stable, even for network sources, it serves as a better string to supply in block job events. But backwards-compatibility demands that we should not change the name handed to users unless they explicitly request it. Therefore, this patch adds a new event, BLOCK_JOB_2 (alas, I couldn't think of any nicer name - but at least Migrate2 and Migrate3 are precedent for a number suffix). We must double up on emitting both old-style and new-style events according to what clients have registered for (see also how IOError and IOErrorReason emits double events, but there the difference was a larger struct rather than changed meaning of one of the struct members). Unfortunately, adding a new event isn't something that can easily be broken into pieces, so the commit is rather large. * include/libvirt/libvirt.h.in (virDomainEventID): Add a new id for VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2. (virConnectDomainEventBlockJobCallback): Document new semantics. * src/conf/domain_event.c (_virDomainEventBlockJob): Rename field, to ensure we catch all clients. (virDomainEventBlockJobNew): Add parameter. (virDomainEventBlockJobDispose) (virDomainEventBlockJobNewFromObj) (virDomainEventBlockJobNewFromDom) (virDomainEventDispatchDefaultFunc): Adjust clients. (virDomainEventBlockJob2NewFromObj) (virDomainEventBlockJob2NewFromDom): New functions. * src/conf/domain_event.h: Add new prototypes. * src/libvirt_private.syms (domain_event.h): Export new functions. * src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Generate two different events. * src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Likewise. * src/remote/remote_protocol.x (remote_domain_event_block_job_2_msg): New struct. (REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB_2): New RPC. * src/remote/remote_driver.c (remoteDomainBuildEventBlockJob2): New handler. (remoteEvents): Register new event. * daemon/remote.c (remoteRelayDomainEventBlockJob2): New handler. (domainEventCallbacks): Register new event. * tools/virsh-domain.c (vshEventCallbacks): Likewise. (vshEventBlockJobPrint): Adjust client. * src/remote_protocol-structs: Regenerate. Signed-off-by: Eric Blake <eblake@redhat.com>
2014-06-14 13:18:04 +00:00
virDomainEventBlockJob2NewFromDom;
virDomainEventBlockJob2NewFromObj;
virDomainEventBlockJobNewFromDom;
virDomainEventBlockJobNewFromObj;
virDomainEventControlErrorNewFromDom;
virDomainEventControlErrorNewFromObj;
virDomainEventDeviceAddedNewFromDom;
virDomainEventDeviceAddedNewFromObj;
virDomainEventDeviceRemovedNewFromDom;
virDomainEventDeviceRemovedNewFromObj;
virDomainEventDiskChangeNewFromDom;
virDomainEventDiskChangeNewFromObj;
virDomainEventGraphicsNewFromDom;
virDomainEventGraphicsNewFromObj;
virDomainEventIOErrorNewFromDom;
virDomainEventIOErrorNewFromObj;
virDomainEventIOErrorReasonNewFromDom;
virDomainEventIOErrorReasonNewFromObj;
virDomainEventLifecycleNew;
virDomainEventLifecycleNewFromDef;
virDomainEventLifecycleNewFromDom;
virDomainEventLifecycleNewFromObj;
virDomainEventPMSuspendDiskNewFromDom;
virDomainEventPMSuspendDiskNewFromObj;
virDomainEventPMSuspendNewFromDom;
virDomainEventPMSuspendNewFromObj;
virDomainEventPMWakeupNewFromDom;
virDomainEventPMWakeupNewFromObj;
virDomainEventRebootNew;
virDomainEventRebootNewFromDom;
virDomainEventRebootNewFromObj;
virDomainEventRTCChangeNewFromDom;
virDomainEventRTCChangeNewFromObj;
virDomainEventStateDeregister;
virDomainEventStateRegister;
virDomainEventStateRegisterID;
virDomainEventTrayChangeNewFromDom;
virDomainEventTrayChangeNewFromObj;
virDomainEventTunableNewFromDom;
virDomainEventTunableNewFromObj;
virDomainEventWatchdogNewFromDom;
virDomainEventWatchdogNewFromObj;
virDomainQemuMonitorEventNew;
virDomainQemuMonitorEventStateRegisterID;
# conf/domain_nwfilter.h
virDomainConfNWFilterInstantiate;
virDomainConfNWFilterRegister;
virDomainConfNWFilterTeardown;
virDomainConfVMNWFilterTeardown;
# conf/interface_conf.h
virInterfaceAssignDef;
virInterfaceDefFormat;
virInterfaceDefFree;
virInterfaceDefParseFile;
virInterfaceDefParseNode;
virInterfaceDefParseString;
virInterfaceFindByMACString;
virInterfaceFindByName;
virInterfaceObjListClone;
virInterfaceObjListFree;
virInterfaceObjLock;
virInterfaceObjUnlock;
virInterfaceRemove;
# conf/netdev_bandwidth_conf.h
virDomainClearNetBandwidth;
virNetDevBandwidthFormat;
virNetDevBandwidthParse;
# conf/netdev_vlan_conf.h
conf: add <vlan> element to network and domain interface elements The following config elements now support a <vlan> subelements: within a domain: <interface>, and the <actual> subelement of <interface> within a network: the toplevel, as well as any <portgroup> Each vlan element must have one or more <tag id='n'/> subelements. If there is more than one tag, it is assumed that vlan trunking is being requested. If trunking is required with only a single tag, the attribute "trunk='yes'" should be added to the toplevel <vlan> element. Some examples: <interface type='hostdev'/> <vlan> <tag id='42'/> </vlan> <mac address='52:54:00:12:34:56'/> ... </interface> <network> <name>vlan-net</name> <vlan trunk='yes'> <tag id='30'/> </vlan> <virtualport type='openvswitch'/> </network> <interface type='network'/> <source network='vlan-net'/> ... </interface> <network> <name>trunk-vlan</name> <vlan> <tag id='42'/> <tag id='43'/> </vlan> ... </network> <network> <name>multi</name> ... <portgroup name='production'/> <vlan> <tag id='42'/> </vlan> </portgroup> <portgroup name='test'/> <vlan> <tag id='666'/> </vlan> </portgroup> </network> <interface type='network'/> <source network='multi' portgroup='test'/> ... </interface> IMPORTANT NOTE: As of this patch there is no backend support for the vlan element for *any* network device type. When support is added in later patches, it will only be for those select network types that support setting up a vlan on the host side, without the guest's involvement. (For example, it will be possible to configure a vlan for a guest connected to an openvswitch bridge, but it won't be possible to do that for one that is connected to a standard Linux host bridge.)
2012-08-12 07:51:30 +00:00
virNetDevVlanFormat;
virNetDevVlanParse;
# conf/netdev_vport_profile_conf.h
virNetDevVPortProfileFormat;
virNetDevVPortProfileParse;
virNetDevVPortTypeFromString;
virNetDevVPortTypeToString;
# conf/network_conf.h
virNetworkAssignDef;
network: move auto-assign of bridge name from XML parser to net driver We already check that any auto-assigned bridge device name for a virtual network (e.g. "virbr1") doesn't conflict with the bridge name for any existing libvirt network (via virNetworkSetBridgeName() in conf/network_conf.c). We also want to check that the name doesn't conflict with any bridge device created on the host system outside the control of libvirt (history: possibly due to the ploriferation of references to libvirt's bridge devices in HOWTO documents all around the web, it is not uncommon for an admin to manually create a bridge in their host's system network config and name it "virbrX"). To add such a check to virNetworkBridgeInUse() (which is called by virNetworkSetBridgeName()) we would have to call virNetDevExists() (from util/virnetdev.c); this function calls ioctl(SIOCGIFFLAGS), which everyone on the mailing list agreed should not be done from an XML parsing function in the conf directory. To remedy that problem, this patch removes virNetworkSetBridgeName() from conf/network_conf.c and puts an identically functioning networkBridgeNameValidate() in network/bridge_driver.c (because it's reasonable for the bridge driver to call virNetDevExists(), although we don't do that yet because I wanted this patch to have as close to 0 effect on function as possible). There are a couple of inevitable changes though: 1) We no longer check the bridge name during virNetworkLoadConfig(). Close examination of the code shows that this wasn't necessary anyway - the only *correct* way to get XML into the config files is via networkDefine(), and networkDefine() will always call networkValidate(), which previously called virNetworkSetBridgeName() (and now calls networkBridgeNameValidate()). This means that the only way the bridge name can be unset during virNetworkLoadConfig() is if someone edited the config file on disk by hand (which we explicitly prohibit). 2) Just on the off chance that somebody *has* edited the file by hand, rather than crashing when they try to start their malformed network, a check for non-NULL bridge name has been added to networkStartNetworkVirtual(). (For those wondering why I don't instead call networkValidateBridgeName() there to set a bridge name if one wasn't present - the problem is that during networkStartNetworkVirtual(), the lock for the network being started has already been acquired, but the lock for the network list itself *has not* (because we aren't adding/removing a network). But virNetworkBridgeInuse() iterates through *all* networks (including this one) and locks each network as it is checked for a duplicate entry; it is necessary to lock each network even before checking if it is the designated "skip" network because otherwise some other thread might acquire the list lock and delete the very entry we're examining. In the end, permitting a setting of the bridge name during network start would require that we lock the entire network list during any networkStartNetwork(), which eliminates a *lot* of parallelism that we've worked so hard to achieve (it can make a huge difference during libvirtd startup). So rather than try to adjust for someone playing against the rules, I choose to instead give them the error they deserve.) 3) virNetworkAllocateBridge() (now removed) would leak any "template" string set as the bridge name. Its replacement networkFindUnusedBridgeName() doesn't leak the template string - it is properly freed.
2015-04-23 16:49:59 +00:00
virNetworkBridgeInUse;
conf: new network bridge device attribute macTableManager The macTableManager attribute of a network's bridge subelement tells libvirt how the bridge's MAC address table (used to determine the egress port for packets) is managed. In the default mode, "kernel", management is left to the kernel, which usually determines entries in part by turning on promiscuous mode on all ports of the bridge, flooding packets to all ports when the correct destination is unknown, and adding/removing entries to the fdb as it sees incoming traffic from particular MAC addresses. In "libvirt" mode, libvirt turns off learning and flooding on all the bridge ports connected to guest domain interfaces, and adds/removes entries according to the MAC addresses in the domain interface configurations. A side effect of turning off learning and unicast_flood on the ports of a bridge is that (with Linux kernel 3.17 and newer), the kernel can automatically turn off promiscuous mode on one or more of the bridge's ports (usually only the one interface that is used to connect the bridge to the physical network). The result is better performance (because packets aren't being flooded to all ports, and can be dropped earlier when they are of no interest) and slightly better security (a guest can still send out packets with a spoofed source MAC address, but will only receive traffic intended for the guest interface's configured MAC address). The attribute looks like this in the configuration: <network> <name>test</name> <bridge name='br0' macTableManager='libvirt'/> ... This patch only adds the config knob, documentation, and test cases. The functionality behind this knob is added in later patches.
2014-11-20 17:40:33 +00:00
virNetworkBridgeMACTableManagerTypeFromString;
virNetworkBridgeMACTableManagerTypeToString;
virNetworkConfigChangeSetup;
virNetworkConfigFile;
virNetworkDefCopy;
virNetworkDefFormat;
virNetworkDefFormatBuf;
virNetworkDefFree;
virNetworkDefGetIpByIndex;
virNetworkDefGetRouteByIndex;
virNetworkDefParseFile;
virNetworkDefParseNode;
virNetworkDefParseString;
virNetworkDefUpdateSection;
virNetworkDeleteConfig;
virNetworkForwardTypeToString;
virNetworkIpDefNetmask;
virNetworkIpDefPrefix;
virNetworkLoadAllConfigs;
virNetworkLoadAllState;
virNetworkObjAssignDef;
virNetworkObjEndAPI;
virNetworkObjFindByName;
virNetworkObjFindByNameLocked;
virNetworkObjFindByUUID;
virNetworkObjFindByUUIDLocked;
virNetworkObjGetPersistentDef;
virNetworkObjListExport;
virNetworkObjListForEach;
virNetworkObjListGetNames;
virNetworkObjListNew;
virNetworkObjListNumOfNetworks;
virNetworkObjListPrune;
virNetworkObjNew;
virNetworkObjReplacePersistentDef;
virNetworkObjSetDefTransient;
virNetworkObjTaint;
network: free/null newDef if network fails to start https://bugzilla.redhat.com/show_bug.cgi?id=866364 pointed out a crash due to virNetworkObjAssignDef free'ing network->newDef without NULLing it afterward. A fix for this is in upstream commit b7e9202401ebaa039b8f05acdefda8c24081537a. While the NULLing of newDef was a legitimate fix, newDef should have already been empty (NULL) anyway (as indicated in the comment that was deleted by that commit). The reason that newDef had a non-NULL value (i.e. the root cause) was that networkStartNetwork() had failed after populating network->newDef, but then neglected to free/NULL newDef in the cleanup. (A bit of background here: network->newDef should contain the persistent config of a network when a network is active (and of course only when it is persisten), and NULL at all other times. There is also a network->def which should contain the persistent definition of the network when it is inactive, and the current live state at all other times. The idea is that you can make changes to network->newDef which will take effect the next time the network is restarted, but won't mess with the current state of the network (virDomainObj has a similar pair of virDomainDefs that behave in the same fashion). Personally I think there should be a network->live and network->config, and the location of the persistent config should *always* be in network->config, but that's for a later cleanup). Since I love things to be symmetric, I created a new function called virNetworkObjUnsetDefTransient(), which reverses the effects of virNetworkObjSetDefTransient(). I don't really like the name of the new function, but then I also didn't really like the name of the old one either (it's just named that way to match a similar function in the domain conf code).
2012-10-19 16:13:49 +00:00
virNetworkObjUnsetDefTransient;
virNetworkObjUpdate;
virNetworkRemoveInactive;
virNetworkSaveConfig;
virNetworkSaveStatus;
Give each virtual network bridge its own fixed MAC address This fixes https://bugzilla.redhat.com/show_bug.cgi?id=609463 The problem was that, since a bridge always acquires the MAC address of the connected interface with the numerically lowest MAC, as guests are started and stopped, it was possible for the MAC address to change over time, and this change in the network was being detected by Windows 7 (it sees the MAC of the default route change), so on each reboot it would bring up a dialog box asking about this "new network". The solution is to create a dummy tap interface with a MAC guaranteed to be lower than any guest interface's MAC, and attach that tap to the bridge as soon as it's created. Since all guest MAC addresses start with 0xFE, we can just generate a MAC with the standard "0x52, 0x54, 0" prefix, and it's guaranteed to always win (physical interfaces are never connected to these bridges, so we don't need to worry about competing numerically with them). Note that the dummy tap is never set to IFF_UP state - that's not necessary in order for the bridge to take its MAC, and not setting it to UP eliminates the clutter of having an (eg) "virbr0-nic" displayed in the output of the ifconfig command. I chose to not auto-generate the MAC address in the network XML parser, as there are likely to be consumers of that API that don't need or want to have a MAC address associated with the bridge. Instead, in bridge_driver.c when the network is being defined, if there is no MAC, one is generated. To account for virtual network configs that already exist when upgrading from an older version of libvirt, I've added a %post script to the specfile that searches for all network definitions in both the config directory (/etc/libvirt/qemu/networks) and the state directory (/var/lib/libvirt/network) that are missing a mac address, generates a random address, and adds it to the config (and a matching address to the state file, if there is one). docs/formatnetwork.html.in: document <mac address.../> docs/schemas/network.rng: add nac address to schema libvirt.spec.in: %post script to update existing networks src/conf/network_conf.[ch]: parse and format <mac address.../> src/libvirt_private.syms: export a couple private symbols we need src/network/bridge_driver.c: auto-generate mac address when needed, create dummy interface if mac address is present. tests/networkxml2xmlin/isolated-network.xml tests/networkxml2xmlin/routed-network.xml tests/networkxml2xmlout/isolated-network.xml tests/networkxml2xmlout/routed-network.xml: add mac address to some tests
2011-02-09 08:28:12 +00:00
virNetworkSetBridgeMacAddr;
virNetworkTaintTypeFromString;
virNetworkTaintTypeToString;
conf: support abstracted interface info in network XML The network XML is updated in the following ways: 1) The <forward> element can now contain a list of forward interfaces: <forward .... > <interface dev='eth10'/> <interface dev='eth11'/> <interface dev='eth12'/> <interface dev='eth13'/> </forward> The first of these takes the place of the dev attribute that is normally in <forward> - when defining a network you can specify either one, and on output both will be present. If you specify both on input, they must match. 2) In addition to forward modes of 'nat' and 'route', these new modes are supported: private, passthrough, vepa - when this network is referenced by a domain's interface, it will have the same effect as if the interface had been defined as type='direct', e.g.: <interface type='direct'> <source mode='${mode}' dev='${dev}> ... </interface> where ${mode} is one of the three new modes, and ${dev} is an interface selected from the list given in <forward>. bridge - if a <forward> dev (or multiple devs) is defined, and forward mode is 'bridge' this is just like the modes 'private', 'passthrough', and 'vepa' above. If there is no forward dev specified but a bridge name is given (e.g. "<bridge name='br0'/>"), then guest interfaces using this network will use libvirt's "host bridge" mode, equivalent to this: <interface type='bridge'> <source bridge='${bridge-name}'/> ... </interface> 3) A network can have multiple <portgroup> elements, which may be selected by the guest interface definition (by adding "portgroup='${name}'" in the <source> element along with the network name). Currently a portgroup can only contain a virtportprofile, but the intent is that other configuration items may be put there int the future (e.g. bandwidth config). When building a guest's interface, if the <interface> XML itself has no virtportprofile, and if the requested network has a portgroup with a name matching the name given in the <interface> (or if one of the network's portgroups is marked with the "default='yes'" attribute), the virtportprofile from that portgroup will be used by the interface. 4) A network can have a virtportprofile defined at the top level, which will be used by a guest interface when connecting in one of the 'direct' modes if the guest interface XML itself hasn't specified any virtportprofile, and if there are also no matching portgroups on the network.
2011-07-20 03:01:09 +00:00
virPortGroupFindByName;
# conf/network_event.h
virNetworkEventLifecycleNew;
virNetworkEventStateRegisterID;
# conf/networkcommon_conf.h
virNetworkRouteDefCreate;
virNetworkRouteDefFormat;
virNetworkRouteDefFree;
virNetworkRouteDefGetAddress;
virNetworkRouteDefGetGateway;
virNetworkRouteDefGetMetric;
virNetworkRouteDefGetPrefix;
virNetworkRouteDefParseXML;
# conf/node_device_conf.h
virNodeDevCapsDefFree;
virNodeDevCapTypeFromString;
virNodeDevCapTypeToString;
virNodeDeviceAssignDef;
virNodeDeviceDefFormat;
virNodeDeviceDefFree;
virNodeDeviceDefParseFile;
virNodeDeviceDefParseNode;
virNodeDeviceDefParseString;
virNodeDeviceFindByName;
virNodeDeviceFindBySysfsPath;
virNodeDeviceGetParentHost;
virNodeDeviceGetWWNs;
virNodeDeviceHasCap;
virNodeDeviceObjListExport;
virNodeDeviceObjListFree;
virNodeDeviceObjLock;
virNodeDeviceObjRemove;
virNodeDeviceObjUnlock;
# conf/numa_conf.h
virDomainNumaCheckABIStability;
virDomainNumaEquals;
virDomainNumaFree;
virDomainNumaGetMemorySize;
virDomainNumaGetNodeCount;
virDomainNumaGetNodeCpumask;
virDomainNumaGetNodeMemoryAccessMode;
virDomainNumaGetNodeMemorySize;
virDomainNumaNew;
virDomainNumaSetNodeMemorySize;
virDomainNumatuneFormatNodeset;
virDomainNumatuneFormatXML;
virDomainNumatuneGetMode;
virDomainNumatuneGetNodeset;
virDomainNumatuneHasPerNodeBinding;
virDomainNumatuneHasPlacementAuto;
virDomainNumatuneMaybeFormatNodeset;
virDomainNumatuneMaybeGetNodeset;
virDomainNumatuneMemModeTypeFromString;
virDomainNumatuneMemModeTypeToString;
virDomainNumatuneNodesetIsAvailable;
virDomainNumatuneNodeSpecified;
virDomainNumatuneParseXML;
virDomainNumatunePlacementTypeFromString;
virDomainNumatunePlacementTypeToString;
virDomainNumatuneSet;
virDomainNumatuneSpecifiedMaxNode;
# conf/nwfilter_conf.h
virNWFilterCallbackDriversLock;
virNWFilterCallbackDriversUnlock;
virNWFilterChainSuffixTypeToString;
virNWFilterConfLayerInit;
virNWFilterConfLayerShutdown;
virNWFilterDefFormat;
virNWFilterDefFree;
virNWFilterDefParseFile;
virNWFilterDefParseString;
virNWFilterInstFiltersOnAllVMs;
virNWFilterJumpTargetTypeToString;
virNWFilterLoadAllConfigs;
virNWFilterObjAssignDef;
virNWFilterObjDeleteDef;
virNWFilterObjFindByName;
virNWFilterObjFindByUUID;
virNWFilterObjListFree;
virNWFilterObjLock;
virNWFilterObjRemove;
virNWFilterObjSaveDef;
virNWFilterObjUnlock;
virNWFilterPrintStateMatchFlags;
virNWFilterPrintTCPFlags;
Push nwfilter update locking up to top level The NWFilter code has as a deadlock race condition between the virNWFilter{Define,Undefine} APIs and starting of guest VMs due to mis-matched lock ordering. In the virNWFilter{Define,Undefine} codepaths the lock ordering is 1. nwfilter driver lock 2. virt driver lock 3. nwfilter update lock 4. domain object lock In the VM guest startup paths the lock ordering is 1. virt driver lock 2. domain object lock 3. nwfilter update lock As can be seen the domain object and nwfilter update locks are not acquired in a consistent order. The fix used is to push the nwfilter update lock upto the top level resulting in a lock ordering for virNWFilter{Define,Undefine} of 1. nwfilter driver lock 2. nwfilter update lock 3. virt driver lock 4. domain object lock and VM start using 1. nwfilter update lock 2. virt driver lock 3. domain object lock This has the effect of serializing VM startup once again, even if no nwfilters are applied to the guest. There is also the possibility of deadlock due to a call graph loop via virNWFilterInstantiate and virNWFilterInstantiateFilterLate. These two problems mean the lock must be turned into a read/write lock instead of a plain mutex at the same time. The lock is used to serialize changes to the "driver->nwfilters" hash, so the write lock only needs to be held by the define/undefine methods. All other methods can rely on a read lock which allows good concurrency. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-01-22 17:28:29 +00:00
virNWFilterReadLockFilterUpdates;
virNWFilterRegisterCallbackDriver;
virNWFilterRuleActionTypeToString;
virNWFilterRuleDirectionTypeToString;
virNWFilterRuleIsProtocolEthernet;
virNWFilterRuleIsProtocolIPv4;
virNWFilterRuleIsProtocolIPv6;
virNWFilterRuleProtocolTypeToString;
virNWFilterTestUnassignDef;
nwfilter: Support for learning a VM's IP address This patch implements support for learning a VM's IP address. It uses the pcap library to listen on the VM's backend network interface (tap) or the physical ethernet device (macvtap) and tries to capture packets with source or destination MAC address of the VM and learn from DHCP Offers, ARP traffic, or first-sent IPv4 packet what the IP address of the VM's interface is. This then allows to instantiate the network traffic filtering rules without the user having to provide the IP parameter somewhere in the filter description or in the interface description as a parameter. This only supports to detect the parameter IP, which is for the assumed single IPv4 address of a VM. There is not support for interfaces that may have multiple IP addresses (IP aliasing) or IPv6 that may then require more than one valid IP address to be detected. A VM can have multiple independent interfaces that each uses a different IP address and in that case it will be attempted to detect each one of the address independently. So, when for example an interface description in the domain XML has looked like this up to now: <interface type='bridge'> <source bridge='mybridge'/> <model type='virtio'/> <filterref filter='clean-traffic'> <parameter name='IP' value='10.2.3.4'/> </filterref> </interface> you may omit the IP parameter: <interface type='bridge'> <source bridge='mybridge'/> <model type='virtio'/> <filterref filter='clean-traffic'/> </interface> Internally I am walking the 'tree' of a VM's referenced network filters and determine with the given variables which variables are missing. Now, the above IP parameter may be missing and this causes a libvirt-internal thread to be started that uses the pcap library's API to listen to the backend interface (in case of macvtap to the physical interface) in an attempt to determine the missing IP parameter. If the backend interface disappears the thread terminates assuming the VM was brought down. In case of a macvtap device a timeout is being used to wait for packets from the given VM (filtering by VM's interface MAC address). If the VM's macvtap device disappeared the thread also terminates. In all other cases it tries to determine the IP address of the VM and will then apply the rules late on the given interface, which would have happened immediately if the IP parameter had been explicitly given. In case an error happens while the firewall rules are applied, the VM's backend interface is 'down'ed preventing it to communicate. Reasons for failure for applying the network firewall rules may that an ebtables/iptables command failes or OOM errors. Essentially the same failure reasons may occur as when the firewall rules are applied immediately on VM start, except that due to the late application of the filtering rules the VM now is already running and cannot be hindered anymore from starting. Bringing down the whole VM would probably be considered too drastic. While a VM's IP address is attempted to be determined only limited updates to network filters are allowed. In particular it is prevented that filters are modified in such a way that they would introduce new variables. A caveat: The algorithm does not know which one is the appropriate IP address of a VM. If the VM spoofs an IP address in its first ARP traffic or IPv4 packets its filtering rules will be instantiated for this IP address, thus 'locking' it to the found IP address. So, it's still 'safer' to explicitly provide the IP address of a VM's interface in the filter description if it is known beforehand. * configure.ac: detect libpcap * libvirt.spec.in: require libpcap[-devel] if qemu is built * src/internal.h: add the new ATTRIBUTE_PACKED define * src/Makefile.am src/libvirt_private.syms: add the new modules and symbols * src/nwfilter/nwfilter_learnipaddr.[ch]: new module being added * src/nwfilter/nwfilter_driver.c src/conf/nwfilter_conf.[ch] src/nwfilter/nwfilter_ebiptables_driver.[ch] src/nwfilter/nwfilter_gentech_driver.[ch]: plu the new functionality in * tests/nwfilterxml2xmltest: extend testing
2010-04-07 21:02:18 +00:00
virNWFilterUnlockFilterUpdates;
virNWFilterUnRegisterCallbackDriver;
Push nwfilter update locking up to top level The NWFilter code has as a deadlock race condition between the virNWFilter{Define,Undefine} APIs and starting of guest VMs due to mis-matched lock ordering. In the virNWFilter{Define,Undefine} codepaths the lock ordering is 1. nwfilter driver lock 2. virt driver lock 3. nwfilter update lock 4. domain object lock In the VM guest startup paths the lock ordering is 1. virt driver lock 2. domain object lock 3. nwfilter update lock As can be seen the domain object and nwfilter update locks are not acquired in a consistent order. The fix used is to push the nwfilter update lock upto the top level resulting in a lock ordering for virNWFilter{Define,Undefine} of 1. nwfilter driver lock 2. nwfilter update lock 3. virt driver lock 4. domain object lock and VM start using 1. nwfilter update lock 2. virt driver lock 3. domain object lock This has the effect of serializing VM startup once again, even if no nwfilters are applied to the guest. There is also the possibility of deadlock due to a call graph loop via virNWFilterInstantiate and virNWFilterInstantiateFilterLate. These two problems mean the lock must be turned into a read/write lock instead of a plain mutex at the same time. The lock is used to serialize changes to the "driver->nwfilters" hash, so the write lock only needs to be held by the define/undefine methods. All other methods can rely on a read lock which allows good concurrency. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-01-22 17:28:29 +00:00
virNWFilterWriteLockFilterUpdates;
# conf/nwfilter_ipaddrmap.h
virNWFilterIPAddrMapAddIPAddr;
virNWFilterIPAddrMapDelIPAddr;
virNWFilterIPAddrMapGetIPAddr;
virNWFilterIPAddrMapInit;
virNWFilterIPAddrMapShutdown;
# conf/nwfilter_params.h
virNWFilterHashTableCreate;
virNWFilterHashTableEqual;
virNWFilterHashTableFree;
virNWFilterHashTablePut;
virNWFilterHashTablePutAll;
virNWFilterHashTableRemoveEntry;
virNWFilterVarAccessGetVarName;
virNWFilterVarAccessIsAvailable;
virNWFilterVarAccessPrint;
virNWFilterVarCombIterCreate;
virNWFilterVarCombIterFree;
virNWFilterVarCombIterGetVarValue;
virNWFilterVarCombIterNext;
virNWFilterVarValueAddValue;
virNWFilterVarValueAddValueCopy;
virNWFilterVarValueCopy;
virNWFilterVarValueCreateSimple;
virNWFilterVarValueCreateSimpleCopyValue;
virNWFilterVarValueDelValue;
virNWFilterVarValueEqual;
virNWFilterVarValueFree;
virNWFilterVarValueGetCardinality;
virNWFilterVarValueGetNthValue;
virNWFilterVarValueGetSimple;
# conf/object_event.h
virObjectEventStateDeregisterID;
virObjectEventStateEventID;
virObjectEventStateFree;
virObjectEventStateNew;
virObjectEventStateQueue;
# conf/secret_conf.h
virSecretDefFormat;
virSecretDefFree;
virSecretDefParseFile;
virSecretDefParseString;
virSecretUsageTypeFromString;
virSecretUsageTypeToString;
# conf/snapshot_conf.h
virDomainListSnapshots;
virDomainSnapshotAlignDisks;
virDomainSnapshotAssignDef;
virDomainSnapshotDefFormat;
virDomainSnapshotDefFree;
virDomainSnapshotDefIsExternal;
virDomainSnapshotDefParseString;
virDomainSnapshotDropParent;
virDomainSnapshotFindByName;
virDomainSnapshotForEach;
virDomainSnapshotForEachChild;
virDomainSnapshotForEachDescendant;
virDomainSnapshotIsExternal;
virDomainSnapshotLocationTypeFromString;
virDomainSnapshotLocationTypeToString;
virDomainSnapshotObjListGetNames;
virDomainSnapshotObjListNum;
virDomainSnapshotObjListRemove;
virDomainSnapshotRedefinePrep;
virDomainSnapshotStateTypeFromString;
virDomainSnapshotStateTypeToString;
virDomainSnapshotUpdateRelations;
# conf/storage_conf.h
virStoragePartedFsTypeToString;
virStoragePoolDefFormat;
virStoragePoolDefFree;
virStoragePoolDefParseFile;
virStoragePoolDefParseNode;
virStoragePoolDefParseSourceString;
virStoragePoolDefParseString;
virStoragePoolFormatDiskTypeToString;
virStoragePoolFormatFileSystemNetTypeToString;
virStoragePoolFormatFileSystemTypeToString;
virStoragePoolGetVhbaSCSIHostParent;
virStoragePoolLoadAllConfigs;
virStoragePoolLoadAllState;
virStoragePoolObjAssignDef;
virStoragePoolObjClearVols;
virStoragePoolObjDeleteDef;
virStoragePoolObjFindByName;
virStoragePoolObjFindByUUID;
virStoragePoolObjIsDuplicate;
virStoragePoolObjListExport;
virStoragePoolObjListFree;
virStoragePoolObjLock;
virStoragePoolObjRemove;
virStoragePoolObjSaveDef;
virStoragePoolObjUnlock;
virStoragePoolSaveConfig;
virStoragePoolSaveState;
virStoragePoolSourceAdapterTypeFromString;
virStoragePoolSourceAdapterTypeToString;
virStoragePoolSourceClear;
virStoragePoolSourceDeviceClear;
virStoragePoolSourceFindDuplicate;
virStoragePoolSourceFindDuplicateDevices;
virStoragePoolSourceFree;
virStoragePoolSourceListFormat;
virStoragePoolSourceListNewSource;
virStoragePoolTypeFromString;
virStoragePoolTypeToString;
virStorageVolDefFindByKey;
virStorageVolDefFindByName;
virStorageVolDefFindByPath;
virStorageVolDefFormat;
virStorageVolDefFree;
virStorageVolDefParseFile;
virStorageVolDefParseNode;
virStorageVolDefParseString;
virStorageVolTypeFromString;
virStorageVolTypeToString;
# conf/virchrdev.h
virChrdevAlloc;
virChrdevFree;
virChrdevOpen;
# cpu/cpu.h
cpuBaseline;
cpuBaselineXML;
cpuCompare;
cpuCompareXML;
cpuDataFormat;
cpuDataFree;
cpuDataParse;
cpuDecode;
cpuEncode;
cpuGetModels;
cpuGuestData;
cpuHasFeature;
cpuNodeData;
cpuUpdate;
# cpu/cpu_x86.h
virCPUx86DataAddCPUID;
virCPUx86DataFree;
virCPUx86MakeData;
# datatypes.h
virConnectClass;
virDomainClass;
virDomainSnapshotClass;
virGetConnect;
virGetDomain;
virGetDomainSnapshot;
virGetInterface;
virGetNetwork;
virGetNodeDevice;
virGetNWFilter;
virGetSecret;
virGetStoragePool;
virGetStorageVol;
virGetStream;
virInterfaceClass;
virNetworkClass;
virNodeDeviceClass;
virNWFilterClass;
virSecretClass;
virStoragePoolClass;
virStorageVolClass;
virStreamClass;
# fdstream.h
virFDStreamConnectUNIX;
virFDStreamCreateFile;
virFDStreamOpen;
virFDStreamOpenBlockDevice;
virFDStreamOpenFile;
virFDStreamOpenPTY;
virFDStreamSetInternalCloseCb;
2009-01-15 19:56:05 +00:00
# libvirt_internal.h
virConnectSupportsFeature;
virDomainMigrateBegin3;
virDomainMigrateBegin3Params;
virDomainMigrateConfirm3;
virDomainMigrateConfirm3Params;
virDomainMigrateFinish;
virDomainMigrateFinish2;
virDomainMigrateFinish3;
virDomainMigrateFinish3Params;
virDomainMigratePerform;
virDomainMigratePerform3;
virDomainMigratePerform3Params;
virDomainMigratePrepare;
virDomainMigratePrepare2;
virDomainMigratePrepare3;
virDomainMigratePrepare3Params;
virDomainMigratePrepareTunnel;
virDomainMigratePrepareTunnel3;
virDomainMigratePrepareTunnel3Params;
virRegisterConnectDriver;
virRegisterStateDriver;
virSetSharedInterfaceDriver;
virSetSharedNetworkDriver;
virSetSharedNodeDeviceDriver;
virSetSharedNWFilterDriver;
virSetSharedSecretDriver;
virSetSharedStorageDriver;
virStateCleanup;
virStateInitialize;
virStateReload;
virStateStop;
2009-01-15 19:56:05 +00:00
# locking/domain_lock.h
virDomainLockDiskAttach;
virDomainLockDiskDetach;
virDomainLockImageAttach;
virDomainLockImageDetach;
virDomainLockLeaseAttach;
virDomainLockLeaseDetach;
virDomainLockProcessInquire;
virDomainLockProcessPause;
virDomainLockProcessResume;
virDomainLockProcessStart;
# locking/lock_manager.h
virLockManagerAcquire;
virLockManagerAddResource;
virLockManagerFree;
virLockManagerInquire;
virLockManagerNew;
virLockManagerPluginGetName;
virLockManagerPluginNew;
virLockManagerPluginRef;
virLockManagerPluginUnref;
virLockManagerPluginUsesState;
virLockManagerRelease;
# nodeinfo.h
nodeAllocPages;
nodeCapsInitNUMA;
nodeGetCellsFreeMemory;
nodeGetCPUCount;
nodeGetCPUMap;
nodeGetCPUStats;
nodeGetFreePages;
nodeGetInfo;
nodeGetMemory;
nodeGetMemoryParameters;
nodeGetMemoryStats;
nodeGetOnlineCPUBitmap;
nodeGetPresentCPUBitmap;
nodeSetMemoryParameters;
# security/security_driver.h
virSecurityDriverLookup;
# security/security_manager.h
virSecurityManagerCheckAllLabel;
virSecurityManagerClearSocketLabel;
virSecurityManagerGenLabel;
virSecurityManagerGetBaseLabel;
virSecurityManagerGetDOI;
virSecurityManagerGetModel;
virSecurityManagerGetMountOptions;
virSecurityManagerGetNested;
virSecurityManagerGetProcessLabel;
virSecurityManagerNew;
virSecurityManagerNewDAC;
virSecurityManagerNewStack;
virSecurityManagerPostFork;
virSecurityManagerPreFork;
virSecurityManagerReleaseLabel;
virSecurityManagerReserveLabel;
virSecurityManagerRestoreAllLabel;
virSecurityManagerRestoreDiskLabel;
virSecurityManagerRestoreHostdevLabel;
virSecurityManagerRestoreImageLabel;
virSecurityManagerRestoreSavedStateLabel;
virSecurityManagerSetAllLabel;
virSecurityManagerSetChildProcessLabel;
virSecurityManagerSetDaemonSocketLabel;
virSecurityManagerSetDiskLabel;
virSecurityManagerSetHostdevLabel;
virSecurityManagerSetHugepages;
virSecurityManagerSetImageFDLabel;
virSecurityManagerSetImageLabel;
virSecurityManagerSetProcessLabel;
virSecurityManagerSetSavedStateLabel;
virSecurityManagerSetSocketLabel;
virSecurityManagerSetTapFDLabel;
virSecurityManagerStackAddNested;
virSecurityManagerVerify;
# util/viralloc.h
virAlloc;
virAllocN;
virAllocTestCount;
virAllocTestHook;
virAllocTestInit;
virAllocTestOOM;
virAllocVar;
virDeleteElementsN;
virExpandN;
virFree;
virInsertElementsN;
virReallocN;
virResizeN;
virShrinkN;
# util/virarch.h
virArchFromHost;
virArchFromString;
virArchGetEndian;
virArchGetWordSize;
virArchToString;
# util/viraudit.h
virAuditClose;
virAuditEncode;
virAuditLog;
virAuditOpen;
virAuditSend;
# util/virauth.h
virAuthGetConfigFilePath;
virAuthGetConfigFilePathURI;
virAuthGetPassword;
virAuthGetPasswordPath;
virAuthGetUsername;
virAuthGetUsernamePath;
# util/virauthconfig.h
virAuthConfigFree;
virAuthConfigLookup;
virAuthConfigNew;
virAuthConfigNewData;
# util/virbitmap.h
virBitmapClearAll;
virBitmapClearBit;
virBitmapCopy;
virBitmapCountBits;
virBitmapDataToString;
virBitmapEqual;
virBitmapFormat;
virBitmapFree;
virBitmapGetBit;
virBitmapIsAllClear;
virBitmapIsAllSet;
virBitmapIsBitSet;
virBitmapLastSetBit;
virBitmapNew;
virBitmapNewCopy;
virBitmapNewData;
virBitmapNewQuiet;
virBitmapNextClearBit;
virBitmapNextSetBit;
virBitmapOverlaps;
virBitmapParse;
virBitmapSetAll;
virBitmapSetBit;
virBitmapSize;
virBitmapString;
virBitmapToData;
virBitmapToDataBuf;
# util/virbuffer.h
virBufferAdd;
virBufferAddBuffer;
virBufferAddChar;
virBufferAddStr;
virBufferAdjustIndent;
virBufferAsprintf;
virBufferCheckErrorInternal;
virBufferContentAndReset;
virBufferCurrentContent;
virBufferError;
virBufferEscape;
virBufferEscapeSexpr;
virBufferEscapeShell;
virBufferEscapeString;
virBufferFreeAndReset;
virBufferGetIndent;
virBufferStrcat;
virBufferTrim;
virBufferURIEncodeString;
virBufferUse;
virBufferVasprintf;
# util/vircgroup.h
virCgroupAddTask;
virCgroupAddTaskController;
virCgroupAllowAllDevices;
virCgroupAllowDevice;
virCgroupAllowDeviceMajor;
virCgroupAllowDevicePath;
virCgroupAvailable;
virCgroupControllerAvailable;
virCgroupControllerTypeFromString;
virCgroupControllerTypeToString;
virCgroupDenyAllDevices;
virCgroupDenyDevice;
virCgroupDenyDeviceMajor;
virCgroupDenyDevicePath;
virCgroupDetectMountsFromFile;
virCgroupFree;
virCgroupGetBlkioIoDeviceServiced;
virCgroupGetBlkioIoServiced;
virCgroupGetBlkioWeight;
virCgroupGetCpuacctPercpuUsage;
virCgroupGetCpuacctStat;
virCgroupGetCpuacctUsage;
virCgroupGetCpuCfsPeriod;
virCgroupGetCpuCfsQuota;
virCgroupGetCpusetCpus;
virCgroupGetCpusetMemoryMigrate;
virCgroupGetCpusetMems;
virCgroupGetCpuShares;
virCgroupGetDevicePermsString;
virCgroupGetDomainTotalCpuStats;
virCgroupGetFreezerState;
virCgroupGetMemoryHardLimit;
virCgroupGetMemorySoftLimit;
virCgroupGetMemoryUsage;
virCgroupGetMemSwapHardLimit;
virCgroupGetMemSwapUsage;
virCgroupGetPercpuStats;
virCgroupHasController;
virCgroupHasEmptyTasks;
virCgroupIsolateMount;
virCgroupKill;
virCgroupKillPainfully;
virCgroupKillRecursive;
virCgroupMoveTask;
virCgroupNewDetect;
virCgroupNewDetectMachine;
virCgroupNewDomainPartition;
virCgroupNewIgnoreError;
virCgroupNewMachine;
virCgroupNewPartition;
virCgroupNewSelf;
virCgroupNewThread;
virCgroupPathOfController;
virCgroupRemove;
virCgroupRemoveRecursively;
virCgroupSetBlkioDeviceReadBps;
virCgroupSetBlkioDeviceReadIops;
virCgroupSetBlkioDeviceWeight;
virCgroupSetBlkioDeviceWriteBps;
virCgroupSetBlkioDeviceWriteIops;
virCgroupSetBlkioWeight;
virCgroupSetCpuCfsPeriod;
virCgroupSetCpuCfsQuota;
virCgroupSetCpusetCpus;
virCgroupSetCpusetMemoryMigrate;
virCgroupSetCpusetMems;
virCgroupSetCpuShares;
virCgroupSetFreezerState;
virCgroupSetMemory;
virCgroupSetMemoryHardLimit;
virCgroupSetMemorySoftLimit;
virCgroupSetMemSwapHardLimit;
virCgroupSetOwner;
virCgroupSupportsCpuBW;
virCgroupTerminateMachine;
# util/virclosecallbacks.h
virCloseCallbacksGet;
2013-07-15 17:08:11 +00:00
virCloseCallbacksGetConn;
virCloseCallbacksNew;
virCloseCallbacksRun;
virCloseCallbacksSet;
virCloseCallbacksUnset;
# util/vircommand.h
virCommandAbort;
virCommandAddArg;
virCommandAddArgBuffer;
virCommandAddArgFormat;
virCommandAddArgList;
virCommandAddArgPair;
virCommandAddArgSet;
virCommandAddEnvBuffer;
virCommandAddEnvFormat;
virCommandAddEnvPair;
virCommandAddEnvPassAllowSUID;
virCommandAddEnvPassBlockSUID;
virCommandAddEnvPassCommon;
virCommandAddEnvString;
virCommandAllowCap;
virCommandClearCaps;
virCommandDaemonize;
virCommandDoAsyncIO;
virCommandExec;
virCommandFree;
virCommandHandshakeNotify;
virCommandHandshakeWait;
virCommandNew;
virCommandNewArgList;
virCommandNewArgs;
virCommandNonblockingFDs;
virCommandPassFD;
virCommandPassFDGetFDIndex;
virCommandPassListenFDs;
util: make it easier to grab only regular command exit Auditing all callers of virCommandRun and virCommandWait that passed a non-NULL pointer for exit status turned up some interesting observations. Many callers were merely passing a pointer to avoid the overall command dying, but without caring what the exit status was - but these callers would be better off treating a child death by signal as an abnormal exit. Other callers were actually acting on the status, but not all of them remembered to filter by WIFEXITED and convert with WEXITSTATUS; depending on the platform, this can result in a status being reported as 256 times too big. And among those that correctly parse the output, it gets rather verbose. Finally, there were the callers that explicitly checked that the status was 0, and gave their own message, but with fewer details than what virCommand gives for free. So the best idea is to move the complexity out of callers and into virCommand - by default, we return the actual exit status already cleaned through WEXITSTATUS and treat signals as a failed command; but the few callers that care can ask for raw status and act on it themselves. * src/util/vircommand.h (virCommandRawStatus): New prototype. * src/libvirt_private.syms (util/command.h): Export it. * docs/internals/command.html.in: Document it. * src/util/vircommand.c (virCommandRawStatus): New function. (virCommandWait): Adjust semantics. * tests/commandtest.c (test1): Test it. * daemon/remote.c (remoteDispatchAuthPolkit): Adjust callers. * src/access/viraccessdriverpolkit.c (virAccessDriverPolkitCheck): Likewise. * src/fdstream.c (virFDStreamCloseInt): Likewise. * src/lxc/lxc_process.c (virLXCProcessStart): Likewise. * src/qemu/qemu_command.c (qemuCreateInBridgePortWithHelper): Likewise. * src/xen/xen_driver.c (xenUnifiedXendProbe): Simplify. * tests/reconnect.c (mymain): Likewise. * tests/statstest.c (mymain): Likewise. * src/bhyve/bhyve_process.c (virBhyveProcessStart) (virBhyveProcessStop): Don't overwrite virCommand error. * src/libvirt.c (virConnectAuthGainPolkit): Likewise. * src/openvz/openvz_driver.c (openvzDomainGetBarrierLimit) (openvzDomainSetBarrierLimit): Likewise. * src/util/virebtables.c (virEbTablesOnceInit): Likewise. * src/util/viriptables.c (virIpTablesOnceInit): Likewise. * src/util/virnetdevveth.c (virNetDevVethCreate): Fix debug message. * src/qemu/qemu_capabilities.c (virQEMUCapsInitQMP): Add comment. * src/storage/storage_backend_iscsi.c (virStorageBackendISCSINodeUpdate): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
2014-02-20 00:32:19 +00:00
virCommandRawStatus;
virCommandRequireHandshake;
virCommandRun;
virCommandRunAsync;
virCommandRunNul;
virCommandRunRegex;
virCommandSetAppArmorProfile;
virCommandSetDryRun;
virCommandSetErrorBuffer;
virCommandSetErrorFD;
virCommandSetGID;
virCommandSetInputBuffer;
virCommandSetInputFD;
virCommandSetMaxFiles;
virCommandSetMaxMemLock;
virCommandSetMaxProcesses;
virCommandSetOutputBuffer;
virCommandSetOutputFD;
virCommandSetPidFile;
virCommandSetPreExecHook;
virCommandSetSELinuxLabel;
virCommandSetUID;
virCommandSetUmask;
virCommandSetWorkingDirectory;
virCommandToString;
virCommandWait;
virCommandWriteArgLog;
virFork;
virRun;
# util/virconf.h
virConfFree;
virConfFreeValue;
virConfGetValue;
virConfNew;
virConfReadFile;
virConfReadMem;
virConfSetValue;
virConfTypeFromString;
virConfTypeToString;
virConfWalk;
virConfWriteFile;
virConfWriteMem;
# util/vircrypto.h
virCryptoHashString;
# util/virdbus.h
virDBusCallMethod;
virDBusCloseSystemBus;
virDBusCreateMethod;
virDBusCreateMethodV;
virDBusCreateReply;
virDBusCreateReplyV;
virDBusErrorIsUnknownMethod;
virDBusGetSessionBus;
virDBusGetSystemBus;
virDBusHasSystemBus;
virDBusMessageDecode;
virDBusMessageEncode;
virDBusMessageRead;
virDBusSetSharedBus;
# util/virdnsmasq.h
dnsmasqAddDhcpHost;
dnsmasqAddHost;
dnsmasqCapsGet;
dnsmasqCapsGetBinaryPath;
dnsmasqCapsGetVersion;
dnsmasqCapsNewFromBinary;
dnsmasqCapsNewFromBuffer;
dnsmasqCapsNewFromFile;
dnsmasqCapsRefresh;
dnsmasqContextFree;
dnsmasqContextNew;
dnsmasqDelete;
dnsmasqReload;
dnsmasqSave;
# util/virebtables.h
ebtablesAddForwardAllowIn;
ebtablesAddForwardPolicyReject;
ebtablesContextFree;
ebtablesContextNew;
ebtablesRemoveForwardAllowIn;
# util/virerror.h
virDispatchError;
virErrorCopyNew;
virErrorInitialize;
virErrorSetErrnoFromLastError;
virLastErrorIsSystemErrno;
virRaiseErrorFull;
virRaiseErrorObject;
virReportErrorHelper;
virReportOOMErrorFull;
virReportSystemErrorFull;
virSetError;
virSetErrorLogPriorityFunc;
virStrerror;
# util/vireventpoll.h
virEventPollAddHandle;
virEventPollAddTimeout;
virEventPollFromNativeEvents;
virEventPollInit;
virEventPollRemoveHandle;
virEventPollRemoveTimeout;
virEventPollRunOnce;
virEventPollToNativeEvents;
virEventPollUpdateHandle;
virEventPollUpdateTimeout;
# util/virfile.h
saferead;
safewrite;
safezero;
virBuildPathInternal;
virDirCreate;
virDirRead;
virFileAbsPath;
virFileAccessibleAs;
virFileActivateDirOverride;
virFileBuildPath;
virFileClose;
virFileDeleteTree;
virFileDirectFdFlag;
virFileExists;
virFileFclose;
virFileFdopen;
virFileFindHugeTLBFS;
virFileFindMountPoint;
virFileFindResource;
virFileFindResourceFull;
virFileGetHugepageSize;
virFileGetMountReverseSubtree;
virFileGetMountSubtree;
virFileHasSuffix;
virFileIsAbsPath;
virFileIsDir;
virFileIsExecutable;
virFileIsLink;
virFileIsMountPoint;
virFileIsSharedFS;
virFileIsSharedFSType;
virFileLinkPointsTo;
virFileLock;
virFileLoopDeviceAssociate;
virFileMakeParentPath;
virFileMakePath;
virFileMakePathWithMode;
virFileMatchesNameSuffix;
virFileNBDDeviceAssociate;
virFileOpenAs;
virFileOpenTty;
virFilePrintf;
virFileReadAll;
virFileReadAllQuiet;
virFileReadHeaderFD;
virFileReadLimFD;
virFileRelLinkPointsTo;
virFileResolveAllLinks;
virFileResolveLink;
virFileRewrite;
virFileSanitizePath;
virFileSkipRoot;
virFileStripSuffix;
virFileTouch;
virFileUnlock;
virFileUpdatePerm;
virFileWaitForDevices;
virFileWrapperFdClose;
virFileWrapperFdFree;
virFileWrapperFdNew;
virFileWriteStr;
virFindFileInPath;
# util/virfirewall.h
virFirewallAddRule;
virFirewallAddRuleFull;
virFirewallApply;
virFirewallFree;
virFirewallNew;
virFirewallRemoveRule;
virFirewallRuleAddArg;
virFirewallRuleAddArgFormat;
virFirewallRuleAddArgList;
virFirewallRuleAddArgSet;
virFirewallRuleGetArgCount;
virFirewallSetBackend;
virFirewallSetLockOverride;
virFirewallStartRollback;
virFirewallStartTransaction;
# util/virhash.h
virHashAddEntry;
virHashAtomicNew;
virHashAtomicSteal;
virHashAtomicUpdate;
virHashCreate;
virHashEqual;
virHashForEach;
virHashFree;
virHashGetItems;
virHashLookup;
virHashRemoveAll;
virHashRemoveEntry;
virHashRemoveSet;
virHashSearch;
virHashSize;
virHashSteal;
virHashTableSize;
virHashUpdateEntry;
virHashValueFree;
# util/virhook.h
virHookCall;
virHookInitialize;
virHookPresent;
# util/virhostdev.h
virHostdevManagerGetDefault;
virHostdevPCINodeDeviceDetach;
virHostdevPCINodeDeviceReAttach;
virHostdevPCINodeDeviceReset;
virHostdevPrepareDomainDevices;
virHostdevPreparePCIDevices;
virHostdevPrepareSCSIDevices;
virHostdevPrepareUSBDevices;
virHostdevReAttachDomainDevices;
virHostdevReAttachPCIDevices;
virHostdevReAttachSCSIDevices;
virHostdevReAttachUSBDevices;
virHostdevUpdateActivePCIDevices;
virHostdevUpdateActiveSCSIDevices;
virHostdevUpdateActiveUSBDevices;
virHostdevUpdateDomainActiveDevices;
# util/viridentity.h
virIdentityGetAttr;
virIdentityGetCurrent;
virIdentityGetSASLUserName;
virIdentityGetSELinuxContext;
virIdentityGetSystem;
virIdentityGetUNIXGroupID;
virIdentityGetUNIXGroupName;
virIdentityGetUNIXProcessID;
virIdentityGetUNIXProcessTime;
virIdentityGetUNIXUserID;
virIdentityGetUNIXUserName;
virIdentityGetX509DName;
virIdentityIsEqual;
virIdentityNew;
virIdentitySetAttr;
virIdentitySetCurrent;
virIdentitySetSASLUserName;
virIdentitySetSELinuxContext;
virIdentitySetUNIXGroupID;
virIdentitySetUNIXGroupName;
virIdentitySetUNIXProcessID;
virIdentitySetUNIXProcessTime;
virIdentitySetUNIXUserID;
virIdentitySetUNIXUserName;
virIdentitySetX509DName;
# util/virinitctl.h
virInitctlSetRunLevel;
# util/viriptables.h
iptablesAddDontMasquerade;
iptablesAddForwardAllowCross;
iptablesAddForwardAllowIn;
iptablesAddForwardAllowOut;
iptablesAddForwardAllowRelatedIn;
iptablesAddForwardMasquerade;
iptablesAddForwardRejectIn;
iptablesAddForwardRejectOut;
iptablesAddOutputFixUdpChecksum;
iptablesAddTcpInput;
iptablesAddUdpInput;
iptablesAddUdpOutput;
iptablesRemoveDontMasquerade;
iptablesRemoveForwardAllowCross;
iptablesRemoveForwardAllowIn;
iptablesRemoveForwardAllowOut;
iptablesRemoveForwardAllowRelatedIn;
iptablesRemoveForwardMasquerade;
iptablesRemoveForwardRejectIn;
iptablesRemoveForwardRejectOut;
iptablesRemoveOutputFixUdpChecksum;
iptablesRemoveTcpInput;
iptablesRemoveUdpInput;
iptablesRemoveUdpOutput;
# util/viriscsi.h
virISCSIConnectionLogin;
virISCSIConnectionLogout;
virISCSIGetSession;
virISCSINodeUpdate;
virISCSIRescanLUNs;
virISCSIScanTargets;
# util/virjson.h
virJSONValueArrayAppend;
virJSONValueArrayGet;
virJSONValueArraySize;
virJSONValueArraySteal;
virJSONValueCopy;
virJSONValueFree;
virJSONValueFromString;
virJSONValueGetArrayAsBitmap;
virJSONValueGetBoolean;
virJSONValueGetNumberDouble;
virJSONValueGetNumberInt;
virJSONValueGetNumberLong;
virJSONValueGetNumberUint;
virJSONValueGetNumberUlong;
virJSONValueGetString;
virJSONValueIsArray;
virJSONValueIsNull;
virJSONValueNewArray;
virJSONValueNewArrayFromBitmap;
virJSONValueNewBoolean;
virJSONValueNewNull;
virJSONValueNewNumberDouble;
virJSONValueNewNumberInt;
virJSONValueNewNumberLong;
virJSONValueNewNumberUint;
virJSONValueNewNumberUlong;
virJSONValueNewObject;
virJSONValueNewString;
virJSONValueNewStringLen;
virJSONValueObjectAdd;
virJSONValueObjectAddVArgs;
virJSONValueObjectAppend;
virJSONValueObjectAppendBoolean;
virJSONValueObjectAppendNull;
virJSONValueObjectAppendNumberDouble;
virJSONValueObjectAppendNumberInt;
virJSONValueObjectAppendNumberLong;
virJSONValueObjectAppendNumberUint;
virJSONValueObjectAppendNumberUlong;
virJSONValueObjectAppendString;
virJSONValueObjectCreate;
virJSONValueObjectCreateVArgs;
virJSONValueObjectForeachKeyValue;
virJSONValueObjectGet;
virJSONValueObjectGetArray;
virJSONValueObjectGetBoolean;
virJSONValueObjectGetByType;
virJSONValueObjectGetKey;
virJSONValueObjectGetNumberDouble;
virJSONValueObjectGetNumberInt;
virJSONValueObjectGetNumberLong;
virJSONValueObjectGetNumberUint;
virJSONValueObjectGetNumberUlong;
virJSONValueObjectGetObject;
virJSONValueObjectGetString;
virJSONValueObjectGetValue;
virJSONValueObjectHasKey;
virJSONValueObjectIsNull;
virJSONValueObjectKeysNumber;
virJSONValueObjectRemoveKey;
virJSONValueToString;
# util/virkeycode.h
virKeycodeSetTypeFromString;
virKeycodeSetTypeToString;
virKeycodeValueFromString;
virKeycodeValueTranslate;
# util/virkeyfile.h
virKeyFileFree;
virKeyFileGetValueString;
virKeyFileHasGroup;
virKeyFileHasValue;
virKeyFileLoadData;
virKeyFileLoadFile;
virKeyFileNew;
# util/virkmod.h
virKModConfig;
virKModIsBlacklisted;
virKModLoad;
virKModUnload;
# util/virlockspace.h
Introduce an internal API for handling file based lockspaces The previously introduced virFile{Lock,Unlock} APIs provide a way to acquire/release fcntl() locks on individual files. For unknown reason though, the POSIX spec says that fcntl() locks are released when *any* file handle referring to the same path is closed. In the following sequence threadA: fd1 = open("foo") threadB: fd2 = open("foo") threadA: virFileLock(fd1) threadB: virFileLock(fd2) threadB: close(fd2) you'd expect threadA to come out holding a lock on 'foo', and indeed it does hold a lock for a very short time. Unfortunately when threadB does close(fd2) this releases the lock associated with fd1. For the current libvirt use case for virFileLock - pidfiles - this doesn't matter since the lock is acquired at startup while single threaded an never released until exit. To provide a more generally useful API though, it is necessary to introduce a slightly higher level abstraction, which is to be referred to as a "lockspace". This is to be provided by a virLockSpacePtr object in src/util/virlockspace.{c,h}. The core idea is that the lockspace keeps track of what files are already open+locked. This means that when a 2nd thread comes along and tries to acquire a lock, it doesn't end up opening and closing a new FD. The lockspace just checks the current list of held locks and immediately returns VIR_ERR_RESOURCE_BUSY. NB, the API as it stands is designed on the basis that the files being locked are not being otherwise opened and used by the application code. One approach to using this API is to acquire locks based on a hash of the filepath. eg to lock /var/lib/libvirt/images/foo.img the application might do virLockSpacePtr lockspace = virLockSpaceNew("/var/lib/libvirt/imagelocks"); lockname = md5sum("/var/lib/libvirt/images/foo.img"); virLockSpaceAcquireLock(lockspace, lockname); NB, in this example, the caller should ensure that the path is canonicalized before calculating the checksum. It is also possible to do locks directly on resources by using a NULL lockspace directory and then using the file path as the lock name eg virLockSpacePtr lockspace = virLockSpaceNew(NULL); virLockSpaceAcquireLock(lockspace, "/var/lib/libvirt/images/foo.img"); This is only safe to do though if no other part of the process will be opening the files. This will be the case when this code is used inside the soon-to-be-reposted virlockd daemon Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-08-02 16:02:40 +00:00
virLockSpaceAcquireResource;
virLockSpaceCreateResource;
virLockSpaceDeleteResource;
virLockSpaceFree;
virLockSpaceGetDirectory;
virLockSpaceNew;
virLockSpaceNewPostExecRestart;
virLockSpacePreExecRestart;
Introduce an internal API for handling file based lockspaces The previously introduced virFile{Lock,Unlock} APIs provide a way to acquire/release fcntl() locks on individual files. For unknown reason though, the POSIX spec says that fcntl() locks are released when *any* file handle referring to the same path is closed. In the following sequence threadA: fd1 = open("foo") threadB: fd2 = open("foo") threadA: virFileLock(fd1) threadB: virFileLock(fd2) threadB: close(fd2) you'd expect threadA to come out holding a lock on 'foo', and indeed it does hold a lock for a very short time. Unfortunately when threadB does close(fd2) this releases the lock associated with fd1. For the current libvirt use case for virFileLock - pidfiles - this doesn't matter since the lock is acquired at startup while single threaded an never released until exit. To provide a more generally useful API though, it is necessary to introduce a slightly higher level abstraction, which is to be referred to as a "lockspace". This is to be provided by a virLockSpacePtr object in src/util/virlockspace.{c,h}. The core idea is that the lockspace keeps track of what files are already open+locked. This means that when a 2nd thread comes along and tries to acquire a lock, it doesn't end up opening and closing a new FD. The lockspace just checks the current list of held locks and immediately returns VIR_ERR_RESOURCE_BUSY. NB, the API as it stands is designed on the basis that the files being locked are not being otherwise opened and used by the application code. One approach to using this API is to acquire locks based on a hash of the filepath. eg to lock /var/lib/libvirt/images/foo.img the application might do virLockSpacePtr lockspace = virLockSpaceNew("/var/lib/libvirt/imagelocks"); lockname = md5sum("/var/lib/libvirt/images/foo.img"); virLockSpaceAcquireLock(lockspace, lockname); NB, in this example, the caller should ensure that the path is canonicalized before calculating the checksum. It is also possible to do locks directly on resources by using a NULL lockspace directory and then using the file path as the lock name eg virLockSpacePtr lockspace = virLockSpaceNew(NULL); virLockSpaceAcquireLock(lockspace, "/var/lib/libvirt/images/foo.img"); This is only safe to do though if no other part of the process will be opening the files. This will be the case when this code is used inside the soon-to-be-reposted virlockd daemon Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-08-02 16:02:40 +00:00
virLockSpaceReleaseResource;
virLockSpaceReleaseResourcesForOwner;
# util/virlog.h
virLogDefineFilter;
virLogDefineOutput;
virLogGetDefaultPriority;
virLogGetFilters;
virLogGetNbFilters;
virLogGetNbOutputs;
virLogGetOutputs;
virLogLock;
virLogMessage;
virLogParseDefaultPriority;
virLogParseFilters;
virLogParseOutputs;
virLogPriorityFromSyslog;
virLogProbablyLogMessage;
virLogReset;
virLogSetDefaultPriority;
virLogSetFromEnv;
virLogUnlock;
virLogVMessage;
# util/virmacaddr.h
virMacAddrCmp;
virMacAddrCmpRaw;
virMacAddrCompare;
virMacAddrFormat;
virMacAddrGenerate;
virMacAddrGetRaw;
virMacAddrIsBroadcastRaw;
virMacAddrIsMulticast;
virMacAddrIsUnicast;
virMacAddrParse;
virMacAddrParseHex;
virMacAddrSet;
virMacAddrSetRaw;
# util/virnetdev.h
virNetDevAddMulti;
Support for static routes on a virtual bridge network: static route support for <network> This patch adds the <route> subelement of <network> to define a static route. the address and prefix (or netmask) attribute identify the destination network, and the gateway attribute specifies the next hop address (which must be directly reachable from the containing <network>) which is to receive the packets destined for "address/(prefix|netmask)". These attributes are translated into an "ip route add" command that is executed when the network is started. The command used is of the following form: ip route add <address>/<prefix> via <gateway> \ dev <virbr-bridge> proto static metric <metric> Tests are done to validate that the input data are correct. For example, for a static route ip definition, the address must be a network address and not a host address. Additional checks are added to ensure that the specified gateway is directly reachable via this network (i.e. that the gateway IP address is in the same subnet as one of the IP's defined for the network). prefix='0' is supported for both family='ipv4' address='0.0.0.0' netmask='0.0.0.0' or prefix='0', and for family='ipv6' address='::', prefix=0', although care should be taken to not override a desired system default route. Anytime an attempt is made to define a static route which *exactly* duplicates an existing static route (for example, address=::, prefix=0, metric=1), the following error message will be sent to syslog: RTNETLINK answers: File exists This can be overridden by decreasing the metric value for the route that should be preferred, or increasing the metric for the route that shouldn't be preferred (and is thus in place only in anticipation that the preferred route may be removed in the future). Caution should be used when manipulating route metrics, especially for a default route. Note: The use of the command-line interface should be replaced by direct use of libnl so that error conditions can be handled better. But, that is being left as an exercise for another day. Signed-off-by: Gene Czarcinski <gene@czarc.net> Signed-off-by: Laine Stump <laine@laine.org>
2013-05-07 17:42:55 +00:00
virNetDevAddRoute;
virNetDevClearIPAddress;
virNetDevDelMulti;
virNetDevExists;
virNetDevGetFeatures;
virNetDevGetIndex;
virNetDevGetIPAddress;
virNetDevGetLinkInfo;
virNetDevGetMAC;
virNetDevGetMTU;
virNetDevGetOnline;
virNetDevGetPhysicalFunction;
virNetDevGetPromiscuous;
virNetDevGetRcvAllMulti;
virNetDevGetRcvMulti;
virNetDevGetRxFilter;
virNetDevGetVirtualFunctionIndex;
virNetDevGetVirtualFunctionInfo;
virNetDevGetVirtualFunctions;
virNetDevGetVLanID;
virNetDevIsVirtualFunction;
virNetDevLinkDump;
virNetDevReplaceNetConfig;
virNetDevRestoreNetConfig;
virNetDevRxFilterFree;
virNetDevRxFilterModeTypeFromString;
virNetDevRxFilterModeTypeToString;
virNetDevRxFilterNew;
virNetDevSetIPAddress;
virNetDevSetMAC;
virNetDevSetMTU;
virNetDevSetMTUFromDevice;
virNetDevSetName;
virNetDevSetNamespace;
virNetDevSetOnline;
virNetDevSetPromiscuous;
virNetDevSetRcvAllMulti;
virNetDevSetRcvMulti;
virNetDevSetupControl;
virNetDevSysfsFile;
virNetDevValidateConfig;
# util/virnetdevbandwidth.h
virNetDevBandwidthClear;
virNetDevBandwidthCopy;
virNetDevBandwidthEqual;
virNetDevBandwidthFree;
virNetDevBandwidthPlug;
virNetDevBandwidthSet;
virNetDevBandwidthUnplug;
virNetDevBandwidthUpdateFilter;
virNetDevBandwidthUpdateRate;
# util/virnetdevbridge.h
virNetDevBridgeAddPort;
virNetDevBridgeCreate;
virNetDevBridgeDelete;
virNetDevBridgeFDBAdd;
virNetDevBridgeFDBDel;
virNetDevBridgeGetSTP;
virNetDevBridgeGetSTPDelay;
virNetDevBridgeGetVlanFiltering;
virNetDevBridgePortGetLearning;
virNetDevBridgePortGetUnicastFlood;
virNetDevBridgePortSetLearning;
virNetDevBridgePortSetUnicastFlood;
virNetDevBridgeRemovePort;
virNetDevBridgeSetSTP;
virNetDevBridgeSetSTPDelay;
virNetDevBridgeSetVlanFiltering;
# util/virnetdevmacvlan.h
virNetDevMacVLanCreate;
virNetDevMacVLanCreateWithVPortProfile;
virNetDevMacVLanDelete;
virNetDevMacVLanDeleteWithVPortProfile;
virNetDevMacVLanRestartWithVPortProfile;
virNetDevMacVLanVPortProfileRegisterCallback;
# util/virnetdevmidonet.h
virNetDevMidonetBindPort;
virNetDevMidonetUnbindPort;
# util/virnetdevopenvswitch.h
virNetDevOpenvswitchAddPort;
virNetDevOpenvswitchGetMigrateData;
virNetDevOpenvswitchRemovePort;
virNetDevOpenvswitchSetMigrateData;
# util/virnetdevtap.h
virNetDevTapCreate;
virNetDevTapCreateInBridgePort;
virNetDevTapDelete;
virNetDevTapGetName;
virNetDevTapGetRealDeviceName;
# util/virnetdevveth.h
virNetDevVethCreate;
virNetDevVethDelete;
# util/virnetdevvlan.h
virNetDevVlanClear;
virNetDevVlanCopy;
virNetDevVlanEqual;
virNetDevVlanFree;
# util/virnetdevvportprofile.h
virNetDevVPortProfileAssociate;
virNetDevVPortProfileCheckComplete;
virNetDevVPortProfileCheckNoExtras;
virNetDevVPortProfileDisassociate;
virNetDevVPortProfileEqual;
virNetDevVPortProfileMerge3;
virNetDevVPortProfileOpTypeFromString;
virNetDevVPortProfileOpTypeToString;
# util/virnetlink.h
virNetlinkCommand;
virNetlinkDelLink;
virNetlinkEventAddClient;
virNetlinkEventRemoveClient;
virNetlinkEventServiceIsRunning;
virNetlinkEventServiceLocalPid;
virNetlinkEventServiceStart;
virNetlinkEventServiceStop;
virNetlinkEventServiceStopAll;
virNetlinkGetErrorCode;
virNetlinkShutdown;
virNetlinkStartup;
# util/virnodesuspend.h
nodeSuspendForDuration;
virNodeSuspendGetTargetMask;
# util/virnuma.h
virNumaGetAutoPlacementAdvice;
virNumaGetDistances;
virNumaGetHostNodeset;
virNumaGetMaxNode;
virNumaGetNodeMemory;
virNumaGetPageInfo;
virNumaGetPages;
virNumaIsAvailable;
virNumaNodeIsAvailable;
virNumaNodesetIsAvailable;
virNumaSetPagePoolSize;
virNumaSetupMemoryPolicy;
# util/virobject.h
virClassForObject;
virClassForObjectLockable;
virClassIsDerivedFrom;
Add a generic reference counted virObject type This introduces a fairly basic reference counted virObject type and an associated virClass type, that use atomic operations for ref counting. In a global initializer (recommended to be invoked using the virOnceInit API), a virClass type must be allocated for each object type. This requires a class name, a "dispose" callback which will be invoked to free memory associated with the object's fields, and the size in bytes of the object struct. eg, virClassPtr connclass = virClassNew("virConnect", sizeof(virConnect), virConnectDispose); The struct for the object, must include 'virObject' as its first member eg struct _virConnect { virObject object; virURIPtr uri; }; The 'dispose' callback is only responsible for freeing fields in the object, not the object itself. eg a suitable impl for the above struct would be void virConnectDispose(void *obj) { virConnectPtr conn = obj; virURIFree(conn->uri); } There is no need to reset fields to 'NULL' or '0' in the dispose callback, since the entire object will be memset to 0, and the klass pointer & magic integer fields will be poisoned with 0xDEADBEEF before being free()d When creating an instance of an object, one needs simply pass the virClassPtr eg virConnectPtr conn = virObjectNew(connclass); if (!conn) return NULL; conn->uri = virURIParse("foo:///bar") Object references can be manipulated with virObjectRef(conn) virObjectUnref(conn) The latter returns a true value, if the object has been freed (ie its ref count hit zero) Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-11 13:35:44 +00:00
virClassName;
virClassNew;
virObjectFreeCallback;
virObjectFreeHashData;
Add a generic reference counted virObject type This introduces a fairly basic reference counted virObject type and an associated virClass type, that use atomic operations for ref counting. In a global initializer (recommended to be invoked using the virOnceInit API), a virClass type must be allocated for each object type. This requires a class name, a "dispose" callback which will be invoked to free memory associated with the object's fields, and the size in bytes of the object struct. eg, virClassPtr connclass = virClassNew("virConnect", sizeof(virConnect), virConnectDispose); The struct for the object, must include 'virObject' as its first member eg struct _virConnect { virObject object; virURIPtr uri; }; The 'dispose' callback is only responsible for freeing fields in the object, not the object itself. eg a suitable impl for the above struct would be void virConnectDispose(void *obj) { virConnectPtr conn = obj; virURIFree(conn->uri); } There is no need to reset fields to 'NULL' or '0' in the dispose callback, since the entire object will be memset to 0, and the klass pointer & magic integer fields will be poisoned with 0xDEADBEEF before being free()d When creating an instance of an object, one needs simply pass the virClassPtr eg virConnectPtr conn = virObjectNew(connclass); if (!conn) return NULL; conn->uri = virURIParse("foo:///bar") Object references can be manipulated with virObjectRef(conn) virObjectUnref(conn) The latter returns a true value, if the object has been freed (ie its ref count hit zero) Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-11 13:35:44 +00:00
virObjectIsClass;
virObjectListFree;
virObjectListFreeCount;
virObjectLock;
virObjectLockableNew;
Add a generic reference counted virObject type This introduces a fairly basic reference counted virObject type and an associated virClass type, that use atomic operations for ref counting. In a global initializer (recommended to be invoked using the virOnceInit API), a virClass type must be allocated for each object type. This requires a class name, a "dispose" callback which will be invoked to free memory associated with the object's fields, and the size in bytes of the object struct. eg, virClassPtr connclass = virClassNew("virConnect", sizeof(virConnect), virConnectDispose); The struct for the object, must include 'virObject' as its first member eg struct _virConnect { virObject object; virURIPtr uri; }; The 'dispose' callback is only responsible for freeing fields in the object, not the object itself. eg a suitable impl for the above struct would be void virConnectDispose(void *obj) { virConnectPtr conn = obj; virURIFree(conn->uri); } There is no need to reset fields to 'NULL' or '0' in the dispose callback, since the entire object will be memset to 0, and the klass pointer & magic integer fields will be poisoned with 0xDEADBEEF before being free()d When creating an instance of an object, one needs simply pass the virClassPtr eg virConnectPtr conn = virObjectNew(connclass); if (!conn) return NULL; conn->uri = virURIParse("foo:///bar") Object references can be manipulated with virObjectRef(conn) virObjectUnref(conn) The latter returns a true value, if the object has been freed (ie its ref count hit zero) Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-11 13:35:44 +00:00
virObjectNew;
virObjectRef;
virObjectUnlock;
Add a generic reference counted virObject type This introduces a fairly basic reference counted virObject type and an associated virClass type, that use atomic operations for ref counting. In a global initializer (recommended to be invoked using the virOnceInit API), a virClass type must be allocated for each object type. This requires a class name, a "dispose" callback which will be invoked to free memory associated with the object's fields, and the size in bytes of the object struct. eg, virClassPtr connclass = virClassNew("virConnect", sizeof(virConnect), virConnectDispose); The struct for the object, must include 'virObject' as its first member eg struct _virConnect { virObject object; virURIPtr uri; }; The 'dispose' callback is only responsible for freeing fields in the object, not the object itself. eg a suitable impl for the above struct would be void virConnectDispose(void *obj) { virConnectPtr conn = obj; virURIFree(conn->uri); } There is no need to reset fields to 'NULL' or '0' in the dispose callback, since the entire object will be memset to 0, and the klass pointer & magic integer fields will be poisoned with 0xDEADBEEF before being free()d When creating an instance of an object, one needs simply pass the virClassPtr eg virConnectPtr conn = virObjectNew(connclass); if (!conn) return NULL; conn->uri = virURIParse("foo:///bar") Object references can be manipulated with virObjectRef(conn) virObjectUnref(conn) The latter returns a true value, if the object has been freed (ie its ref count hit zero) Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-11 13:35:44 +00:00
virObjectUnref;
# util/virpci.h
virPCIDeviceAddressGetIOMMUGroupAddresses;
virPCIDeviceAddressGetIOMMUGroupNum;
virPCIDeviceAddressGetSysfsFile;
virPCIDeviceAddressIOMMUGroupIterate;
virPCIDeviceAddressParse;
virPCIDeviceCopy;
virPCIDeviceDetach;
virPCIDeviceFileIterate;
virPCIDeviceFree;
virPCIDeviceGetDriverPathAndName;
virPCIDeviceGetIOMMUGroupDev;
virPCIDeviceGetIOMMUGroupList;
virPCIDeviceGetLinkCapSta;
virPCIDeviceGetManaged;
virPCIDeviceGetName;
virPCIDeviceGetRemoveSlot;
virPCIDeviceGetReprobe;
virPCIDeviceGetStubDriver;
virPCIDeviceGetUnbindFromStub;
virPCIDeviceGetUsedBy;
virPCIDeviceHasPCIExpressLink;
virPCIDeviceIsAssignable;
virPCIDeviceIsPCIExpress;
virPCIDeviceListAdd;
virPCIDeviceListAddCopy;
virPCIDeviceListCount;
virPCIDeviceListDel;
virPCIDeviceListFind;
virPCIDeviceListFindByIDs;
virPCIDeviceListFindIndex;
virPCIDeviceListGet;
virPCIDeviceListNew;
virPCIDeviceListSteal;
virPCIDeviceListStealIndex;
virPCIDeviceNew;
virPCIDeviceReattach;
virPCIDeviceReattachInit;
virPCIDeviceReset;
virPCIDeviceSetManaged;
virPCIDeviceSetRemoveSlot;
virPCIDeviceSetReprobe;
virPCIDeviceSetStubDriver;
virPCIDeviceSetUnbindFromStub;
virPCIDeviceSetUsedBy;
virPCIDeviceUnbind;
virPCIDeviceWaitForCleanup;
virPCIEDeviceInfoFree;
virPCIGetNetName;
virPCIGetPhysicalFunction;
virPCIGetVirtualFunctionIndex;
virPCIGetVirtualFunctionInfo;
virPCIGetVirtualFunctions;
virPCIIsVirtualFunction;
# util/virpidfile.h
virPidFileAcquire;
virPidFileAcquirePath;
virPidFileBuildPath;
virPidFileConstructPath;
virPidFileDelete;
virPidFileDeletePath;
virPidFileForceCleanupPath;
virPidFileRead;
virPidFileReadIfAlive;
virPidFileReadPath;
virPidFileReadPathIfAlive;
virPidFileRelease;
virPidFileReleasePath;
virPidFileWrite;
virPidFileWritePath;
# util/virpolkit.h
virPolkitCheckAuth;
# util/virportallocator.h
virPortAllocatorAcquire;
virPortAllocatorNew;
virPortAllocatorRelease;
virPortAllocatorSetUsed;
# util/virprocess.h
virProcessAbort;
virProcessExitWithStatus;
virProcessGetAffinity;
virProcessGetNamespaces;
virProcessGetPids;
virProcessGetStartTime;
virProcessKill;
virProcessKillPainfully;
virProcessRunInMountNamespace;
virProcessSchedPolicyTypeFromString;
virProcessSchedPolicyTypeToString;
virProcessSetAffinity;
virProcessSetMaxFiles;
virProcessSetMaxMemLock;
virProcessSetMaxProcesses;
virProcessSetNamespaces;
virProcessSetScheduler;
virProcessTranslateStatus;
virProcessWait;
# util/virrandom.h
virRandom;
virRandomBits;
virRandomGenerateWWN;
virRandomInt;
# util/virscsi.h
virSCSIDeviceFileIterate;
virSCSIDeviceFree;
virSCSIDeviceGetAdapter;
virSCSIDeviceGetBus;
virSCSIDeviceGetDevName;
virSCSIDeviceGetName;
virSCSIDeviceGetReadonly;
virSCSIDeviceGetSgName;
virSCSIDeviceGetShareable;
virSCSIDeviceGetTarget;
virSCSIDeviceGetUnit;
qemu: Don't fail if the SCSI host device is shareable between domains It doesn't make sense to fail if the SCSI host device is specified as "shareable" explicitly between domains (NB, it works if and only if the device is specified as "shareable" for *all* domains, otherwise it fails). To fix the problem, this patch introduces an array for virSCSIDevice struct, which records all the names of domain which are using the device (note that the recorded domains must specify the device as shareable). And the change on the data struct brings on many subsequent changes in the code. Prior to this patch, the "shareable" tag didn't work as expected, it actually work like "non-shareable". So this patch also added notes in formatdomain.html to declare the fact. * src/util/virscsi.h: - Remove virSCSIDeviceGetUsedBy - Change definition of virSCSIDeviceGetUsedBy and virSCSIDeviceListDel - Add virSCSIDeviceIsAvailable * src/util/virscsi.c: - struct virSCSIDevice: Change "used_by" to be an array; Add "n_used_by" as the array count - virSCSIDeviceGetUsedBy: Removed - virSCSIDeviceFree: frees the "used_by" array - virSCSIDeviceSetUsedBy: Copy the domain name to avoid potential memory corruption - virSCSIDeviceIsAvailable: New - virSCSIDeviceListDel: Change the logic, for device which is already in the list, just remove the corresponding entry in "used_by". And since it's only used in one place, we can safely removing the code to find out the dev in the list first. - Copyright updating * src/libvirt_private.sys: - virSCSIDeviceGetUsedBy: Remove - virSCSIDeviceIsAvailable: New * src/qemu/qemu_hostdev.c: - qemuUpdateActiveScsiHostdevs: Check if the device existing before adding it to the list; - qemuPrepareHostdevSCSIDevices: Error out if the not all domains use the device as "shareable"; Also don't try to add the device to the activeScsiHostdevs list if it already there; And make more sensible error w.r.t the current "shareable" value in driver->activeScsiHostdevs. - qemuDomainReAttachHostScsiDevices: Change the logic according to the changes on helpers. Signed-off-by: Osier Yang <jyang@redhat.com>
2014-01-29 17:22:42 +00:00
virSCSIDeviceIsAvailable;
virSCSIDeviceListAdd;
virSCSIDeviceListCount;
virSCSIDeviceListDel;
virSCSIDeviceListFind;
virSCSIDeviceListGet;
virSCSIDeviceListNew;
virSCSIDeviceListSteal;
virSCSIDeviceNew;
virSCSIDeviceSetUsedBy;
# util/virseclabel.h
virSecurityDeviceLabelDefFree;
virSecurityDeviceLabelDefNew;
virSecurityLabelDefFree;
virSecurityLabelDefNew;
# util/virsexpr.h
sexpr2string;
sexpr_append;
sexpr_cons;
sexpr_float;
sexpr_fmt_node;
sexpr_free;
sexpr_has;
sexpr_int;
sexpr_lookup;
sexpr_nil;
sexpr_node;
sexpr_node_copy;
sexpr_string;
sexpr_u64;
string2sexpr;
# util/virsocketaddr.h
virSocketAddrBroadcast;
virSocketAddrBroadcastByPrefix;
virSocketAddrCheckNetmask;
virSocketAddrEqual;
virSocketAddrFormat;
virSocketAddrFormatFull;
virSocketAddrGetIpPrefix;
virSocketAddrGetPort;
virSocketAddrGetRange;
virSocketAddrIsNetmask;
virSocketAddrIsNumericLocalhost;
virSocketAddrIsPrivate;
virSocketAddrIsWildcard;
virSocketAddrMask;
virSocketAddrMaskByPrefix;
virSocketAddrNumericFamily;
virSocketAddrParse;
virSocketAddrParseIPv4;
virSocketAddrParseIPv6;
virSocketAddrPrefixToNetmask;
virSocketAddrSetIPv4Addr;
virSocketAddrSetPort;
# util/virstats.h
virNetInterfaceStats;
# util/virstorageencryption.h
virStorageEncryptionFormat;
virStorageEncryptionFree;
virStorageEncryptionParseNode;
virStorageGenerateQcowPassphrase;
# util/virstoragefile.h
virStorageAuthDefCopy;
virStorageAuthDefFormat;
virStorageAuthDefFree;
virStorageAuthDefParse;
virStorageFileCanonicalizePath;
virStorageFileChainGetBroken;
virStorageFileChainLookup;
virStorageFileFeatureTypeFromString;
virStorageFileFeatureTypeToString;
virStorageFileFormatTypeFromString;
virStorageFileFormatTypeToString;
virStorageFileGetLVMKey;
virStorageFileGetMetadataFromBuf;
virStorageFileGetMetadataFromFD;
virStorageFileGetMetadataInternal;
virStorageFileGetRelativeBackingPath;
virStorageFileGetSCSIKey;
virStorageFileIsClusterFS;
virStorageFileParseChainIndex;
virStorageFileProbeFormat;
virStorageFileProbeFormatFromBuf;
virStorageFileResize;
virStorageIsFile;
conf: split network host structs to util/ 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: Eric Blake <eblake@redhat.com>
2014-03-26 22:33:08 +00:00
virStorageNetHostDefClear;
virStorageNetHostDefCopy;
virStorageNetHostDefFree;
virStorageNetHostTransportTypeFromString;
virStorageNetHostTransportTypeToString;
virStorageNetProtocolTypeToString;
virStorageSourceBackingStoreClear;
virStorageSourceClear;
virStorageSourceCopy;
virStorageSourceFree;
virStorageSourceGetActualType;
virStorageSourceGetSecurityLabelDef;
virStorageSourceInitChainElement;
virStorageSourceIsEmpty;
virStorageSourceIsLocalStorage;
virStorageSourceNewFromBacking;
virStorageSourceParseRBDColonString;
virStorageSourcePoolDefFree;
virStorageSourcePoolModeTypeFromString;
virStorageSourcePoolModeTypeToString;
conf: move host disk type to util/ 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: Eric Blake <eblake@redhat.com>
2014-03-27 21:57:49 +00:00
virStorageTypeFromString;
virStorageTypeToString;
# util/virstring.h
virArgvToString;
virAsprintfInternal;
virSkipSpaces;
virSkipSpacesAndBackslash;
virSkipSpacesBackwards;
virStrcpy;
virStrdup;
virStringArrayHasString;
virStringFreeList;
virStringFreeListCount;
virStringHasControlChars;
virStringIsEmpty;
virStringJoin;
virStringListLength;
virStringReplace;
virStringSearch;
virStringSortCompare;
virStringSortRevCompare;
virStringSplit;
virStringSplitCount;
virStringStripControlChars;
virStringStripIPv6Brackets;
virStrncpy;
virStrndup;
virStrToDouble;
virStrToLong_i;
virStrToLong_l;
virStrToLong_ll;
virStrToLong_ui;
virStrToLong_uip;
virStrToLong_ul;
virStrToLong_ull;
virStrToLong_ullp;
virStrToLong_ulp;
virTrimSpaces;
virVasprintfInternal;
# util/virsysinfo.h
virSysinfoBaseBoardDefClear;
virSysinfoBIOSDefFree;
virSysinfoDefFree;
virSysinfoFormat;
virSysinfoRead;
virSysinfoSetup;
virSysinfoSystemDefFree;
# util/virsystemd.h
virSystemdCanHibernate;
virSystemdCanHybridSleep;
virSystemdCanSuspend;
virSystemdCreateMachine;
virSystemdMakeMachineName;
virSystemdMakeScopeName;
virSystemdMakeSliceName;
virSystemdNotifyStartup;
virSystemdTerminateMachine;
# util/virthread.h
virCondBroadcast;
virCondDestroy;
virCondInit;
virCondSignal;
virCondWait;
virCondWaitUntil;
virMutexDestroy;
virMutexInit;
virMutexInitRecursive;
virMutexLock;
virMutexUnlock;
virOnce;
virRWLockDestroy;
virRWLockInit;
virRWLockRead;
virRWLockUnlock;
virRWLockWrite;
virThreadCancel;
virThreadCreateFull;
virThreadID;
virThreadInitialize;
virThreadIsSelf;
virThreadJoin;
virThreadSelf;
virThreadSelfID;
# util/virthreadjob.h
virThreadJobClear;
virThreadJobGet;
virThreadJobSet;
virThreadJobSetWorker;
# util/virthreadpool.h
virThreadPoolFree;
virThreadPoolGetMaxWorkers;
virThreadPoolGetMinWorkers;
virThreadPoolGetPriorityWorkers;
virThreadPoolNewFull;
virThreadPoolSendJob;
# util/virtime.h
virTimeFieldsNow;
virTimeFieldsNowRaw;
virTimeFieldsThen;
virTimeLocalOffsetFromUTC;
virTimeMillisNow;
virTimeMillisNowRaw;
virTimeStringNow;
virTimeStringNowRaw;
virTimeStringThen;
virTimeStringThenRaw;
# util/virtpm.h
virTPMCreateCancelPath;
# util/virtypedparam.h
virTypedParameterAssign;
virTypedParameterAssignFromStr;
virTypedParameterToString;
virTypedParameterTypeFromString;
virTypedParameterTypeToString;
virTypedParamsCheck;
virTypedParamsCopy;
virTypedParamsFilter;
virTypedParamsGetStringList;
virTypedParamsReplaceString;
virTypedParamsValidate;
# util/viruri.h
virURIFormat;
virURIFormatParams;
virURIFree;
virURIParse;
# util/virusb.h
virUSBDeviceFileIterate;
virUSBDeviceFind;
virUSBDeviceFindByBus;
virUSBDeviceFindByVendor;
virUSBDeviceFree;
virUSBDeviceGetBus;
virUSBDeviceGetDevno;
virUSBDeviceGetName;
virUSBDeviceGetUsedBy;
virUSBDeviceListAdd;
virUSBDeviceListCount;
virUSBDeviceListDel;
virUSBDeviceListFind;
virUSBDeviceListGet;
virUSBDeviceListNew;
virUSBDeviceListSteal;
virUSBDeviceNew;
virUSBDeviceSetUsedBy;
# util/virutil.h
virDoubleToStr;
virEnumFromString;
virEnumToString;
virFindFCHostCapableVport;
virFindSCSIHostByPCI;
virFormatIntDecimal;
virGetDeviceID;
virGetDeviceUnprivSGIO;
virGetEnvAllowSUID;
virGetEnvBlockSUID;
virGetFCHostNameByWWN;
virGetGroupID;
virGetGroupList;
virGetGroupName;
virGetHostname;
virGetListenFDs;
virGetSCSIHostNameByParentaddr;
virGetSCSIHostNumber;
virGetSelfLastChanged;
virGetSystemPageSize;
virGetSystemPageSizeKB;
virGetUnprivSGIOSysfsPath;
virGetUserCacheDirectory;
virGetUserConfigDirectory;
virGetUserDirectory;
virGetUserDirectoryByUID;
virGetUserID;
virGetUserName;
virGetUserRuntimeDirectory;
virHexToBin;
virIndexToDiskName;
virIsCapableFCHost;
virIsCapableVport;
virIsDevMapperDevice;
virIsSUID;
virManageVport;
virMemoryLimitIsSet;
virMemoryLimitTruncate;
virMemoryMaxValue;
virParseNumber;
virParseOwnershipIds;
virParseVersionString;
virPipeReadUntilEOF;
virReadFCHost;
virReadSCSIUniqueId;
virScaleInteger;
virSetBlocking;
virSetCloseExec;
virSetDeviceUnprivSGIO;
virSetInherit;
virSetNonBlock;
virSetSockReuseAddr;
virSetUIDGID;
virSetUIDGIDWithCaps;
virStrIsPrint;
virTristateBoolTypeFromString;
virTristateBoolTypeToString;
virTristateSwitchTypeFromString;
virTristateSwitchTypeToString;
virUpdateSelfLastChanged;
virValidateWWN;
# util/viruuid.h
virGetHostUUID;
virSetHostUUIDStr;
virUUIDFormat;
virUUIDGenerate;
virUUIDIsValid;
virUUIDParse;
# util/virxml.h
virXMLChildElementCount;
virXMLExtractNamespaceXML;
virXMLNodeToString;
virXMLParseHelper;
virXMLPickShellSafeComment;
virXMLPropString;
virXMLSaveFile;
virXMLValidateAgainstSchema;
virXPathBoolean;
virXPathInt;
virXPathLong;
virXPathLongHex;
virXPathLongLong;
virXPathNode;
virXPathNodeSet;
virXPathNumber;
virXPathString;
virXPathStringLimit;
virXPathUInt;
virXPathULong;
virXPathULongHex;
virXPathULongLong;
# Let emacs know we want case-insensitive sorting
# Local Variables:
# sort-fold-case: t
# End: