- 04 5月, 2014 3 次提交
-
-
由 Roman Bogorodskiy 提交于
The only accepted format for now is 'bhyve-argv' which prints out a bhyve command corresponding to the given domain definition.
-
由 Roman Bogorodskiy 提交于
* bhyve_command.c (bhyveBuildNetArgStr, virBhyveProcessBuildBhyveCmd): add dryRun mode which doesn't create any devices when enabled * bhyve_command.c (virBhyveProcessBuildBhyveCmd, virBhyveProcessBuildDestroyCmd, virBhyveProcessBuildLoadCmd): accept virDomainDefPtr instead of virDomainObjPtr.
-
由 Ján Tomko 提交于
Instead of guessing it from the interface name, look into /proc/net/vlan/<interface>. This works for devices not named <real_device>.<vlan ID>, avoiding an error flood when virt-manager keeps asking about them every second: https://bugzilla.redhat.com/show_bug.cgi?id=966329
-
- 02 5月, 2014 6 次提交
-
-
由 John Ferlan 提交于
Commit id 'ac9a0963' refactored out the 'withCapacity' for the virStorageBackendUpdateVolInfo() API. See: http://www.redhat.com/archives/libvir-list/2014-April/msg00043.html This resulted in a difference in how 'virsh vol-info --pool <poolName> <volume>' or 'virsh vol-list vol-list --pool <poolName> --details' outputs the capacity information for a directory pool with a qcow2 sparse file. For example, using the following XML mkdir /home/TestPool cat testpool.xml <pool type='dir'> <name>TestPool</name> <uuid>6bf80895-10b6-75a6-6059-89fdea2aefb7</uuid> <source> </source> <target> <path>/home/TestPool</path> <permissions> <mode>0755</mode> <owner>0</owner> <group>0</group> </permissions> </target> </pool> virsh pool-create testpool.xml virsh vol-create-as --pool TestPool temp_vol_1 \ --capacity 1048576 --allocation 1048576 --format qcow2 virsh vol-info --pool TestPool temp_vol_1 Results in listing a Capacity value. Prior to the commit, the value would be '1.0 MiB' (1048576 bytes). However, after the commit the output would be (for example) '192.50 KiB', which for my system was the size of the volume in my file system (eg 'ls -l TestPool/temp_vol_1' results in '197120' bytes or 192.50 KiB). While perhaps technically correct, it's not necessarily what the user expected (certainly virt-test didn't expect it). This patch restores the code to not update the target capacity for this path
-
由 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.
-
由 Eric Blake 提交于
Commit f22b7899 stumbled across a difference between 32-bit and 64-bit platforms when parsing "-1" as an int. Now that we've fixed that difference, it's time to fix the testsuite. * src/util/virstoragefile.c (virStorageFileParseChainIndex): Require a positive index. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
strtoul() is required to parse negative numbers as their twos-complement positive counterpart. But sometimes we want to reject negative numbers. Add new functions to do this. The 'p' suffix is a mnemonic for 'positive' (technically it also parses 0, but 'non-negative' doesn't lend itself to a nice one-letter suffix). * src/util/virstring.h (virStrToLong_uip, virStrToLong_ulp) (virStrToLong_ullp): New prototypes. * src/util/virstring.c (virStrToLong_uip, virStrToLong_ulp) (virStrToLong_ullp): New functions. * src/libvirt_private.syms (virstring.h): Export them. * tests/virstringtest.c (testStringToLong): Test them. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Commit f22b7899 called to light a long-standing latent bug: the behavior of virStrToLong_ui was different on 32-bit platforms than on 64-bit platforms. Curse you, C type promotion and narrowing rules, and strtoul specification. POSIX says that for a 32-bit long, strtol handles only 2^32 values [LONG_MIN to LONG_MAX] while strtoul handles 2^33 - 1 values [-ULONG_MAX to ULONG_MAX] with twos-complement wraparound for negatives. Thus, parsing -1 as unsigned long produces ULONG_MAX, rather than a range error. We WANT[1] this same shortcut for turning -1 into UINT_MAX when parsing to int; and get it for free with 32-bit long. But with 64-bit long, ULONG_MAX is outside the range of int and we were rejecting it as invalid; meanwhile, we were silently treating -18446744073709551615 as 1 even though it textually exceeds INT_MIN. Too bad there's not a strtoui() in libc that does guaranteed parsing to int, regardless of the size of long. The bug has been latent since 2007, introduced by Jim Meyering in commit 5d254191 in the attempt to eradicate unsafe use of strto[u]l when parsing ints and longs. How embarrassing that we are only discovering it now - so I'm adding a testsuite to ensure that it covers all the corner cases we care about. [1] Ideally, we really want the caller to be able to choose whether to allow negative numbers to wrap around to their 2s-complement counterpart, as in strtoul, or to force a stricter input range of [0 to UINT_MAX] by rejecting negative signs; this will be added in a later patch for all three int types. This patch is tested on both 32- and 64-bit; the enhanced virstringtest passes on both platforms, while virstoragetest now reliably fails on both platforms instead of just 32-bit platforms. That test will be fixed later. * src/util/virstring.c (virStrToLong_ui): Ensure same behavior regardless of platform long size. * tests/virstringtest.c (testStringToLong): New function. (mymain): Comprehensively test string to long parsing. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Daniel P. Berrange 提交于
A couple of places in the QEMU XML -> ARGV conversion code raised an error but then forgot to return an error status due to missing gotos. While fixing this also tweak style of a couple of other error reports Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 01 5月, 2014 4 次提交
-
-
由 Laine Stump 提交于
If a domain network interface that contains a <filterref> is modified "live" using "virsh update-device --live", libvirtd would crash. This was because the code supporting live update of an interface's filterref was assuming that a filterref might be added or modified, but didn't account for removing the filterref, resulting in a null dereference of the filter name. Introduced with commit 258fb278, which was first in libvirt v1.0.1. This addresses https://bugzilla.redhat.com/show_bug.cgi?id=1093301
-
由 Peter Krempa 提交于
To avoid memory leak of the "backingStoreRaw" field when reparsing backing chains a new function is being introduced by this patch that shall be used to clear backing store information. The memory leak was introduced in commit 8823272d.
-
由 Stefan Berger 提交于
Refactor the ebiptablesTearNewRules function so that the teardown of temporary filters can also be called by the ebiptablesAllTeardown function. This fixes a problem that leaves temporary filters behind when a VM shuts down while its filters are modified. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> v1->v2: - test cases adjusted to expect more commands
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=808463 Well, libvirt doesn't distinguish between domain poweroff and hibernation (S4). It's hard to differentiate these two on a real machine anyway. As a result, any device that is hot(un-)plugged is lost (appears again) when domain is started again as from our POV it is a fresh cold boot. Instead of doing anything wise here, we should just document this as known limitation. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 30 4月, 2014 4 次提交
-
-
由 Daniel P. Berrange 提交于
The LXC controller itself needs to mknod the USB device node in /dev/bus/usb, so we can't block mknod permission from the cgroup. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 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>
-
由 Sahid Orentino Ferdjaoui 提交于
This commit provides the ability to virDomainMigrateToURI to check for SASL credentials when attempts to migrate a domain with the driver QEMU. Signed-off-by: NSahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com>
-
由 Pavel Hrdina 提交于
Freebsd doesn't know ENODATA so we have to use different EINVAL error code. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 29 4月, 2014 14 次提交
-
-
由 Eric Blake 提交于
Commit 5c43e2e0 introduced a NULL deref if there is a failure in virStorageFileGetMetadataInternal. * src/util/virstoragefile.c (virStorageFileGetMetadataFromBuf): Fix error handling. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Daniel P. Berrange 提交于
SO_REUSEADDR on Windows is actually akin to SO_REUSEPORT on Linux/BSD. ie it allows 2 apps to listen to the same port at once. Thus we must not set it on Win32 platforms See http://msdn.microsoft.com/en-us/library/windows/desktop/ms740621.aspxSigned-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Martin Kletzander 提交于
When EIO comes to qemu while it's replying to qemuMigrationUpdateJobStatus(), qemu blocks, the migration of RAM can complete in the meantime, and when qemu unblocks, it sends us BLOCK_IO_ERROR plus migrations "status": "complete". Even though we act upon the BLOCK_IO_ERROR by setting the proper state of the domain, the call still waits for the proper reply on monitor for query_migrate and after it gets it, it checks that migration is completed and the migration is finished. This is what abort_on_error flag was meant for (we can migrate with these errors, but this flag must inhibit such behaviour). Changing the order of the steps guarantees the flag works properly. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1045833Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Martin Kletzander 提交于
Based on suggestion from Eric [1], because it might not get cleaned up before the release, so to avoid potential errors. [1] https://www.redhat.com/archives/libvir-list/2014-April/msg00929.htmlSigned-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Steven McDonald 提交于
The stripe_unit and stripe_count arguments are passed to rbd_create3 in the wrong order, resulting in a stripe size of 1 byte with 4194304 stripes on newly created RBD volumes. https://bugzilla.redhat.com/show_bug.cgi?id=1092208Signed-off-by: NSteven McDonald <steven.mcdonald@anchor.net.au>
-
由 Eric Blake 提交于
Now that all clients have been adjusted, ensure that no future misuse of readdir is introduced into the code base. * cfg.mk (sc_prohibit_readdir): New rule. * src/util/virfile.c (virDirRead): Exempt the wrapper. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Laine Stump 提交于
This attempts to follow the same variable name and usage patterns as the other conversions to virDirRead().
-
由 Eric Blake 提交于
More instances of failure to report (unlikely) readdir errors. In one case, I chose to ignore them, given that a readdir error would be no different than timing out on the loop, where the fallback path behaves correctly either way. * src/storage/storage_backend.c (virStorageBackendStablePath): Ignore readdir errors. * src/storage/storage_backend_fs.c (virStorageBackendFileSystemRefresh): Report readdir errors. * src/storage/storage_backend_iscsi.c (virStorageBackendISCSIGetHostNumber): Likewise. * src/storage/storage_backend_scsi.c (getNewStyleBlockDevice) (getBlockDevice, virStorageBackendSCSIFindLUs): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Convert all remaining clients of readdir to use the new interface, so that we can ensure (unlikely) errors while reading a directory are reported. * src/openvz/openvz_conf.c (openvzAssignUUIDs): Use new interface. * src/parallels/parallels_storage.c (parallelsFindVolumes) (parallelsFindVmVolumes): Report readdir failures. * src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Ignore readdir failures. * src/secret/secret_driver.c (loadSecrets): Likewise. * src/qemu/qemu_hostdev.c (qemuHostdevHostSupportsPassthroughVFIO): Report readdir failures. * src/xen/xen_inotify.c (xenInotifyOpen): Likewise. * src/xen/xm_internal.c (xenXMConfigCacheRefresh): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
In making the conversion to the new API, I fixed a couple bugs: virSCSIDeviceGetSgName would leak memory if a directory unexpectedly contained multiple entries; virNetDevTapGetRealDeviceName could report a spurious error from a stale errno inherited before starting the readdir search. The decision on whether to store the result of virDirRead into a variable is based on whether the end of the loop falls through to cleanup code automatically. In some cases, we have loops that are documented to return NULL on failure, and which raise an error on most failure paths but not in the case where the directory was unexpectedly empty; it may be worth a followup patch to explicitly report an error if readdir was successful but the directory was empty, so that a NULL return always has an error set. * src/util/vircgroup.c (virCgroupRemoveRecursively): Use new interface. (virCgroupKillRecursiveInternal, virCgroupSetOwner): Report readdir failures. * src/util/virfile.c (virFileLoopDeviceOpenSearch) (virFileNBDDeviceFindUnused, virFileDeleteTree): Use new interface. * src/util/virnetdevtap.c (virNetDevTapGetRealDeviceName): Properly check readdir errors. * src/util/virpci.c (virPCIDeviceIterDevices) (virPCIDeviceFileIterate, virPCIGetNetName): Report readdir failures. (virPCIDeviceAddressIOMMUGroupIterate): Use new interface. * src/util/virscsi.c (virSCSIDeviceGetSgName): Report readdir failures, and avoid memory leak. (virSCSIDeviceGetDevName): Report readdir failures. * src/util/virusb.c (virUSBDeviceSearch): Report readdir failures. * src/util/virutil.c (virGetFCHostNameByWWN) (virFindFCHostCapableVport): Report readdir failures. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 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>
-
由 Natanael Copa 提交于
This makes sure that errno is reset before readdir is called, even if the loop does a 'continue'. This fixes issue with musl libc which sets errno on sscanf. The following 'continue' makes the errno be set before calling readdir. Signed-off-by: NNatanael Copa <ncopa@alpinelinux.org> Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Natanael Copa 提交于
Introduce a wrapper for readdir. This helps us make sure that we always set errno before calling readdir and it will make sure errors are properly logged. Signed-off-by: NNatanael Copa <ncopa@alpinelinux.org> Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Jim Fehlig 提交于
With xend on the way out, installations may not even have /usr/sbin/xend, which results in the following error when the drivers are probed 2014-04-28 18:21:19.271+0000: 22129: error : virCommandWait:2426 : internal error: Child process (/usr/sbin/xend status) unexpected exit status 127: libvirt: error : cannot execute binary /usr/sbin/xend: No such file or directory Check for existence of /usr/sbin/xend before trying to run it with the 'status' option.
-
- 28 4月, 2014 5 次提交
-
-
由 Daniel P. Berrange 提交于
The virFirewallAddRuleFull method originally had a single compulsory virFirewallQueryCallback parameter. During dev work though the ignoreErrors parameter was added and the callback parameter made optional. The ATTRIBUTE_NONNULL annotation was never removed though. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The virnetsocket.c API is hardcoded to pass --timeout=30 to any daemon it auto-starts. For inexplicable reasons the virtlockd daemon did not implement the --timeout option, so it would immediately exit on autostart with an error. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Make the lock plugin use virFileFindResource to find the virtlockd daemon path, so that it executes the in-builddir daemon if run from source tree. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Make the remote driver use virFileFindResource to find the libvirt daemon path, so that it executes the in-builddir daemon if run from source tree. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Jiri Denemark 提交于
When a snapshot operation finishes we have to recheck the backing chain of all disks involved in the snapshot. And we need to do that even if the operation failed because some of the disks might have changed if QEMU did not support transactions.
-
- 27 4月, 2014 4 次提交
-
-
由 Laine Stump 提交于
The check for a network being active during interface attach was being done individually in several places (by both the lxc driver and the qemu driver), but those places were too specific, leading to it *not* being checked when allocating a connection/device from a macvtap or hostdev network. This patch puts a single check in networkAllocateActualDevice(), which is always called before the any network interface is attached to any type of domain. It also removes all the other now-redundant checks from the lxc and qemu drivers. NB: the following patches are prerequisites for this patch, in the case that it is backported to any branch: 440beeb7 network: fix virNetworkObjAssignDef and persistence 8aaa5b68 network: create statedir during driver initialization b9e95491 network: change location of network state xml files 411c5486 network: set macvtap/hostdev networks active if their state file exists This fixes: https://bugzilla.redhat.com/show_bug.cgi?id=880483
-
由 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 提交于
For some reason these have been stored in /var/lib, although other drivers (e.g. qemu and lxc) store their state files in /var/run. It's much nicer to store state files in /var/run because it is automatically cleared out when the system reboots. We can then use existence of the state file as a convenient indicator of whether or not a particular network is active. Since changing the location of the state files by itself will cause problems in the case of a *live* upgrade from an older libvirt that uses /var/lib (because current status of active networks will be lost), the network driver initialization has been modified to migrate any network state files from /var/lib to /var/run. This will not help those trying to *downgrade*, but in practice this will only be problematic in two cases 1) If there are networks with network-wide bandwidth limits configured *and in use* by a guest during a downgrade to "old" libvirt. In this case, the class ID's used for that network's tc rules, as well as the currently in-use bandwidth "floor" will be forgotten. 2) If someone does this: 1) upgrade libvirt, 2) downgrade libvirt, 3) modify running state of network (e.g. add a static dhcp host, etc), 4) upgrade. In this case, the modifications to the running network will be lost (but not any persistent changes to the network's config).
-
由 Laine Stump 提交于
This directory should be created when the network driver is first started up, not just when a dhcp daemon is run. This hasn't posed a problem in the past, because the directory has always been pre-existing.
-