- 06 5月, 2014 1 次提交
-
-
由 Julio Faracco 提交于
In "src/util/" there are many enumeration (enum) declarations. Sometimes, it's better using a typedef for variable types, function types and other usages. Other enumeration will be changed to typedef's in the future. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 02 5月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
Older gcc (4.1.2-55.el5, 4.2.1 on FreeBSD) reports bogus warnings: ../../src/conf/nwfilter_conf.c:2111: warning: 'protocol' may be used uninitialized in this function ../../src/conf/nwfilter_conf.c:2110: warning: 'dataProtocolID' may be used uninitialized in this function Initialize them to NULL to make the compiler happy.
-
- 30 4月, 2014 1 次提交
-
-
由 Stefan Berger 提交于
An IP or IPv6 rule with port specification but without protocol specification cannot be instantiated by ebtables. The documentation points to 'protocol' being required but implementation does not enforce it to be given. Implement a rule validation function that checks whether the rule is valid when it is defined. This for example prevents the definition of rules like: <ip dstportstart='53'> where a protocol attribute would be required for it to be valid and for ebtables to be able to instantiate it. A valid rule then is: <ip protocol='udp' dstportstart='53'> Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
-
- 29 4月, 2014 1 次提交
-
-
由 Eric Blake 提交于
When reading configuration files, we were silently ignoring directory read failures. While unlikely, we might as well report them. * src/conf/domain_conf.c (virDomainObjListLoadAllConfigs): Report readdir errors. * src/conf/network_conf.c (virNetworkLoadAllState) (virNetworkLoadAllConfigs): Likewise. * src/conf/nwfilter_conf.c (virNWFilterLoadAllConfigs): Likewise. * src/conf/storage_conf.c (virStoragePoolLoadAllConfigs): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 27 4月, 2014 2 次提交
-
-
由 Laine Stump 提交于
libvirt attempts to determine at startup time which networks are already active, and set their active flags. Previously it has done this by assuming that all networks are inactive, then setting the active flag if the network has a bridge device associated with it and that bridge device exists. This is not useful for macvtap and hostdev based networks, since they do not use a bridge device. Of course the reason that such a check had to be done was that the presence of a status file in the network "stateDir" couldn't be trusted as an indicator of whether or not a network was active. This was due to the network driver mistakenly using /var/lib/libvirt/network to store the status files, rather than /var/run/libvirt/network (similar to what is done by every other libvirt driver that stores status xml for its objects). The difference is that /var/run is cleared out when the host reboots, so you can be assured that the state file you are seeing isn't just left over from a previous boot of the host. Now that the network driver has been switched to using /var/run/libvirt/network for status, we can also modify it to assume that any network with an existing status file is by definition active - we do this when reading the status file. To fine tune the results, networkFindActiveConfigs() is changed to networkUpdateAllState(), and only sets active = 0 if the conditions for particular network types are *not* met. The result is that during the first run of libvirtd after the host boots, there are no status files, so no networks are active. Any time libvirtd is restarted, any network with a status file will be marked as active (unless the network uses a bridge device and that device for some reason doesn't exist).
-
由 Laine Stump 提交于
Experimentation showed that if virNetworkCreateXML() was called for a network that was already defined, and then the network was subsequently shutdown, the network would continue to be persistent after the shutdown (expected/desired), but the original config would be lost in favor of the transient config sent in with virNetworkCreateXML() (which would then be the new persistent config) (obviously unexpected/not desired). To fix this, virNetworkObjAssignDef() has been changed to 1) properly save/free network->def and network->newDef for all the various combinations of live/active/persistent, including some combinations that were previously considered to be an error but didn't need to be (e.g. setting a "live" config for a network that isn't yet active but soon will be - that was previously considered an error, even though in practice it can be very useful). 2) automatically set the persistent flag whenever a new non-live config is assigned to the network (and clear it when the non-live config is set to NULL). the libvirt network driver no longer directly manipulates network->persistent, but instead relies entirely on virNetworkObjAssignDef() to do the right thing automatically. After this patch, the following sequence will behave as expected: virNetworkDefineXML(X) virNetworkCreateXML(X') (same name but some config different) virNetworkDestroy(X) At the end of these calls, the network config will remain as it was after the initial virNetworkDefine(), whereas previously it would take on the changes given during virNetworkCreateXML(). Another effect of this tighter coupling between a) setting a !live def and b) setting/clearing the "persistent" flag, is that future patches which change the details of network lifecycle management (e.g. upcoming patches to fix detection of "active" networks when libvirtd is restarted) will find it much more difficult to break persistence functionality.
-
- 25 4月, 2014 7 次提交
-
-
由 Daniel P. Berrange 提交于
Create a nwfilterxml2firewalltest to exercise the ebiptables_driver.applyNewRules method with a variety of different XML input files. The XML input files are taken from the libvirt-tck nwfilter tests. While the nwfilter tests verify the final state of the iptables chains, this test verifies the set of commands invoked to create the chains. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Convert the nwfilter ebtablesApplyNewRules method to use the virFirewall object APIs instead of creating shell scripts using virBuffer APIs. This provides a performance improvement through allowing direct use of firewalld dbus APIs and will facilitate automated testing. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Add virNWFilterRuleIsProtocol{Ethernet,IPv4,IPv6} helper methods to avoid having to write a giant switch statements with many cases. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The virNWFilterHashTable struct contains a virHashTable and then a 'char **names' field which keeps a copy of all the hash keys. Presumably this was intended to record the ordering of the hash keys. No code ever uses this and the ordering is mangled whenever a variable is removed from the hash, because the last element in the list is copied into the middle of the list when shrinking the array. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The virNWFilterTechDriver struct is nothing to do with the nwfilter XML configuration. It stores data specific to the driver implementation so should be in a header in the driver directory instead. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
If virNWFilterVarValueCreateSimple fails with OOM, then 'val' will be leaked by virNWFilterVarValueCreateSimpleCopyValue Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Eric Blake 提交于
Once again, gcc 4.4.7 (hello RHEL) rears its ugly head: conf/domain_conf.c: In function 'virDomainDiskBackingStoreFormat': conf/domain_conf.c:14940: error: declaration of 'index' shadows a global declaration [-Wshadow] /usr/include/string.h:489: error: shadowed declaration is here [-Wshadow] * src/conf/domain_conf.c (virDomainDiskBackingStoreFormat): Pacify older gcc. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 24 4月, 2014 6 次提交
-
-
由 Jiri Denemark 提交于
This patch implements formating and parsing code for the backing store schema defined and documented by the previous patch. This patch does not aim at providing full persistent storage of disk backing chains yet. The formatter is supposed to provide the backing chain detected when starting a domain and thus it is not formatted into an inactive domain XML. The parser is implemented mainly for the purpose of testing the XML generated by the formatter and thus it does not distinguish between no backingStore element and an empty backingStore element. This will have to change once we fully implement support for user-supplied backing chains. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Peter Krempa 提交于
To avoid having the root of a backing chain present twice in the list we need to invert the working of virStorageFileGetMetadataRecurse. Until now the recursive worker created a new backing chain element from the name and other information passed as arguments. This required us to pass the data of the parent in a deconstructed way and the worker created a new entry for the parent. This patch converts this function so that it just fills in metadata about the parent and creates a backing chain element from those. This removes the duplication of the first element. To avoid breaking the test suite, virstoragetest now calls a wrapper that creates the parent structure explicitly and pre-fills it with the test data with same function signature as previously used.
-
由 Peter Krempa 提交于
Switch over to storing of the backing chain as a recursive virStorageSource structure. This is a string based move. Currently the first element will be present twice in the backing chain as currently the retrieval function stores the parent in the newly detected chain. This will be fixed later.
-
由 Peter Krempa 提交于
To conform with the naming of the planned XML output rename the metadata variable name. s/backingMeta/backingStore/g
-
由 Peter Krempa 提交于
Replace the old structure with the new one. This change is a trivial name change operation (along with change of the freeing function).
-
由 Peter Krempa 提交于
Remove the obsolete field replaced by data in "path". The testsuite requires tweaking as the name of the backing file is now stored one layer deeper in the backing chain linked list.
-
- 22 4月, 2014 2 次提交
-
-
由 Ján Tomko 提交于
Remove the pointer from def->cputune.vcpupin after unplugging the CPU and also free the bitmap contained in the structure by calling virDomainVcpuPinDel instead of VIR_FREE. Introduced by commit 0df1a790. This makes virDomainLookupVcpuPin redundant. https://bugzilla.redhat.com/show_bug.cgi?id=1088165
- 16 4月, 2014 1 次提交
-
-
由 Eric Blake 提交于
I noticed that depending on the <driver> attributes the user passed in, the output may omit the <driver> element altogether. For example, the rerror_policy has had this problem since commit 4bb4109f in Oct 2011. But in adding testsuite coverage to expose it, I found another problem: the C code is just fine without a driver name, but the XML validator required either a name or a cache mode. * src/conf/domain_conf.c (virDomainDiskDefFormat): Update conditional. * docs/schemas/domaincommon.rng (diskDriver): Simplify. * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.xml: * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.args: New files. * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.xml: Enhance test. * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-discard.xml: Likewise. * tests/qemuxml2argvtest.c (mymain): New test. * tests/qemuxml2xmltest.c (mymain): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com> Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 15 4月, 2014 1 次提交
-
-
由 Eric Blake 提交于
Domain snapshots should only permit an external snapshot into a storage format that permits a backing chain, since the new snapshot file necessarily must be backed by the existing file. The C code for the qemu driver is a little bit stricter in currently enforcing only qcow2 or qed, but at the XML parser level, including virt-xml-validate, it is fairly easy to enforce that a user can't request a 'raw' external snapshot. * docs/schemas/storagecommon.rng (storageFormat): Split out... (storageFormatBacking): ...new sublist. * docs/schemas/domainsnapshot.rng (disksnapshotdriver): Use new type. * src/util/virstoragefile.h (virStorageFileFormat): Rearrange for easier code management. * src/util/virstoragefile.c (virStorageFileFormat, fileTypeInfo): Likewise. * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML): Use new marker to limit selection of formats. Signed-off-by: NEric Blake <eblake@redhat.com> Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 11 4月, 2014 1 次提交
-
-
由 Eric Blake 提交于
Deciding if a user string represents a local file instead of a network path is an operation worth exposing directly, particularly since the next patch will be removing a redundant variable that was caching the information. * src/util/virstoragefile.h (virStorageIsFile): New declaration. * src/util/virstoragefile.c (virBackingStoreIsFile): Rename... (virStorageIsFile): ...export, and allow NULL input. (virStorageFileGetMetadataInternal) (virStorageFileGetMetadataRecurse, virStorageFileGetMetadata): Update callers. * src/conf/domain_conf.c (virDomainDiskDefForeachPath): Use it. * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget): Likewise. * src/libvirt_private.syms (virstoragefile.h): Export function. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 09 4月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
Now that the storage source definition is uniform convert the helpers to retrieve the actual storage type to a single one.
-
- 08 4月, 2014 5 次提交
-
-
由 Daniel P. Berrange 提交于
Now that we ditched our custom pthread impl for Win32, we can use PTHREAD_MUTEX_INITIALIZER for static mutexes. This avoids the need to use a virOnce one-time global initializer in a number of places. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Since it is an abbreviation, PCI should always be fully capitalized or full lower case, never Pci. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Since it is an abbreviation, USB should always be fully capitalized or full lower case, never Usb. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Since it is an abbreviation, SCSI should always be fully capitalized or full lower case, never Scsi. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
- 05 4月, 2014 2 次提交
-
-
由 Roman Bogorodskiy 提交于
nmdm is a FreeBSD driver which allows to create a pair of tty devices one of which is passed to the guest and second is used by the client. This patch adds new 'nmdm' character device type. Its definition looks this way: <serial type='nmdm'> <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/> </serial> Master is passed to the hypervisior and slave is used for client connection. Also implement domainOpenConsole() for bhyve driver based on that.
-
由 Eric Blake 提交于
Right now, virStorageFileMetadata tracks bool backingStoreIsFile for whether the backing string specified in metadata can be resolved as a file (covering both block and regular file resources) or is treated as a network protocol. But when merging this struct with virStorageSource, it will be easier to just actually track which type of resource it is, as well as have a reserved value for the case where the resource type is unknown (or had an error during probing). * src/util/virstoragefile.h (virStorageType): Add a placeholder value, swap order to match similar public enum. * src/util/virstoragefile.c (virStorage): Update string mapping. * src/conf/domain_conf.c (virDomainDiskSourceParse) (virDomainDiskDefParseXML, virDomainDiskDefFormat) (virDomainDiskSourceFormat): Adjust clients. * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML): Likewise. * src/qemu/qemu_driver.c (qemuDomainSnapshotPrepareDiskExternalBackingInactive) (qemuDomainSnapshotPrepareDiskExternalOverlayActive) (qemuDomainSnapshotPrepareDiskExternalOverlayInactive) (qemuDomainSnapshotPrepareDiskInternal) (qemuDomainSnapshotCreateSingleDiskActive): Likewise. * src/qemu/qemu_command.c (qemuGetDriveSourceString): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 03 4月, 2014 3 次提交
-
-
由 Ján Tomko 提交于
Check the bus, type of the source device (tcp vs. spicevmc) and the device address visible in the guest. https://bugzilla.redhat.com/show_bug.cgi?id=1035128
-
由 Ján Tomko 提交于
When looking up a net device by a MAC and PCI address, it is possible that we've got a match on the MAC address but failed to match the PCI address. In that case, outputting just the MAC address can be confusing. Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=872028
-
由 Ján Tomko 提交于
Every caller checked the return value and logged an error - one if no device with the specified MAC was found, other if there were multiple devices matching the MAC address (except for qemuDomainUpdateDeviceConfig which logged the same message in both cases). Move the error reporting into virDomainNetFindIdx, since in both cases, we couldn't find one single match - it's just the error messages that differ.
-
- 02 4月, 2014 5 次提交
-
-
由 Eric Blake 提交于
One of the features of qcow2 is that a wrapper file can have more capacity than its backing file from the guest's perspective; what's more, sparse files make tracking allocation of both the active and backing file worthwhile. As such, it makes more sense to show allocation numbers for each file in a chain, and not just the top-level file. This sets up the fields for the tracking, although it does not modify XML to display any new information. * src/util/virstoragefile.h (_virStorageSource): Add fields. * src/conf/storage_conf.h (_virStorageVolDef): Drop redundant fields. * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom) (createRawFile, virStorageBackendCreateQemuImgCmd) (virStorageBackendCreateQcowCreate): Update clients. * src/storage/storage_driver.c (storageVolDelete) (storageVolCreateXML, storageVolCreateXMLFrom, storageVolResize) (storageVolWipeInternal, storageVolGetInfo): Likewise. * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget) (virStorageBackendFileSystemRefresh) (virStorageBackendFileSystemVolResize) (virStorageBackendFileSystemVolRefresh): Likewise. * src/storage/storage_backend_logical.c (virStorageBackendLogicalMakeVol) (virStorageBackendLogicalCreateVol): Likewise. * src/storage/storage_backend_scsi.c (virStorageBackendSCSINewLun): Likewise. * src/storage/storage_backend_mpath.c (virStorageBackendMpathNewVol): Likewise. * src/storage/storage_backend_rbd.c (volStorageBackendRBDRefreshVolInfo) (virStorageBackendRBDCreateImage): Likewise. * src/storage/storage_backend_disk.c (virStorageBackendDiskMakeDataVol) (virStorageBackendDiskCreateVol): Likewise. * src/storage/storage_backend_sheepdog.c (virStorageBackendSheepdogBuildVol) (virStorageBackendSheepdogParseVdiList): Likewise. * src/storage/storage_backend_gluster.c (virStorageBackendGlusterRefreshVol): Likewise. * src/conf/storage_conf.c (virStorageVolDefFormat) (virStorageVolDefParseXML): Likewise. * src/test/test_driver.c (testOpenVolumesForPool) (testStorageVolCreateXML, testStorageVolCreateXMLFrom) (testStorageVolDelete, testStorageVolGetInfo): Likewise. * src/esx/esx_storage_backend_iscsi.c (esxStorageVolGetXMLDesc): Likewise. * src/esx/esx_storage_backend_vmfs.c (esxStorageVolGetXMLDesc) (esxStorageVolCreateXML): Likewise. * src/parallels/parallels_driver.c (parallelsAddHddByVolume): Likewise. * src/parallels/parallels_storage.c (parallelsDiskDescParseNode) (parallelsStorageVolDefineXML, parallelsStorageVolCreateXMLFrom) (parallelsStorageVolDefRemove, parallelsStorageVolGetInfo): Likewise. * src/vbox/vbox_tmpl.c (vboxStorageVolCreateXML) (vboxStorageVolGetXMLDesc): Likewise. * tests/storagebackendsheepdogtest.c (test_vdi_list_parser): Likewise. * src/phyp/phyp_driver.c (phypStorageVolCreateXML): Likewise.
-
由 Eric Blake 提交于
A fairly smooth transition. And now that domain disks and storage volumes share a common struct, it opens the doors for a future patch to expose more details in the XML for both objects. * src/conf/storage_conf.h (_virStorageVolTarget): Delete. (_virStorageVolDef): Use common type. * src/conf/storage_conf.c (virStorageVolDefFree) (virStorageVolTargetDefFormat): Update clients. * src/storage/storage_backend.h: Likewise. * src/storage/storage_backend.c (virStorageBackendDetectBlockVolFormatFD) (virStorageBackendUpdateVolTargetInfo) (virStorageBackendUpdateVolTargetInfoFD): Likewise. * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Another step towards unification of structures. While we might not expose everything in XML via domain disk as we do for storage volume pointer, both places want to deal with (at least part of) the backing chain; therefore, moving towards a single struct usable from both contexts will make the backing chain code more reusable. * src/conf/storage_conf.h (_virStoragePerms) (virStorageTimestamps): Move... * src/util/virstoragefile.h: ...here. (_virStorageSource): Add more fields. * src/util/virstoragefile.c (virStorageSourceClear): Clean additional fields. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Some preparatory work before consolidating storage volume structs with the rest of virstoragefile. Making these changes allows a volume target to be much closer to (a subset of) the virStorageSource struct. Making perms be a pointer allows it to be optional if we have a storage pool that doesn't expose permissions in a way we can access. It also allows future patches to optionally expose permissions details learned about a disk image via domain <disk> listings, rather than just limiting it to storage volume listings. Disk partition types was only used by internal code to control what type of partition to create when carving up an MS-DOS partition table storage pool (and is not used for GPT partition tables or other storage pools). It was not exposed in volume XML, and as it is more closely related to extent information of the overall block device than it is to the <target> information describing the host file. Besides, if we ever decide to expose it in XML down the road, we can move it back as needed. * src/conf/storage_conf.h (_virStorageVolTarget): Change perms to pointer, enhance comments. Move partition type... (_virStorageVolSource): ...here. * src/conf/storage_conf.c (virStorageVolDefFree) (virStorageVolDefParseXML, virStorageVolTargetDefFormat): Update clients. * src/storage/storage_backend_fs.c (createFileDir): Likewise. * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom) (virStorageBackendCreateRaw, virStorageBackendCreateExecCommand) (virStorageBackendUpdateVolTargetInfoFD): Likewise. * src/storage/storage_backend_logical.c (virStorageBackendLogicalCreateVol): Likewise. * src/storage/storage_backend_disk.c (virStorageBackendDiskMakeDataVol) (virStorageBackendDiskPartTypeToCreate): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Now that we have a dedicated type for representing a disk source, we might as well parse and format directly into that type instead of piecemeal into pointers to members of the type. * src/conf/domain_conf.h (virDomainDiskSourceDefFormatInternal) (virDomainDiskSourceDefParse): Rename... (virDomainDiskSourceFormat, virDomainDiskSourceParse): ...and compress signatures. * src/conf/domain_conf.c (virDomainDiskSourceParse) (virDomainDiskSourceFormat): Rewrite to use common struct. (virDomainDiskSourceDefFormat): Delete. (virDomainDiskDefParseXML, virDomainDiskDefFormat): Update callers. * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML) (virDomainSnapshotDiskDefFormat): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-