- 15 8月, 2012 6 次提交
-
-
由 Laine Stump 提交于
This patch adds three utility functions that operate on virNetDevVPortProfile objects. * virNetDevVPortProfileCheckComplete() - verifies that all attributes required for the type of the given virtport are specified. * virNetDevVPortProfileCheckNoExtras() - verifies that there are no attributes specified which are inappropriate for the type of the given virtport. * virNetDevVPortProfileMerge3() - merges 3 virtports into a single, newly allocated virtport. If any attributes are specified in more than one of the three sources, and do not exactly match, an error is logged and the function fails. These new functions depend on new fields in the virNetDevVPortProfile object that keep track of whether or not each attribute was specified. Since the higher level parse function doesn't yet set those fields, these functions are not actually usable yet (but that's okay, because they also aren't yet used - all of that functionality comes in a later patch.) Note that these three functions return 0 on success and -1 on failure. This may seem odd for the first two Check functions, since they could also easily return true/false, but since they actually log an error when the requested condition isn't met (and should result in a failure of the calling function), I thought 0/-1 was more appropriate.
-
由 Laine Stump 提交于
This function was overlooked when openvswitch support was added. Fortunately it's only use for update-device, which is relatively new and seldom-used.
-
由 Laine Stump 提交于
virNetDevVPortProfile has (had) a type field that can be set to one of several values, and a union of several structs, one for each type. When a domain's interface object is of type "network", the domain config may not know beforehand which type of virtualport is going to be provided in the actual device handed down from the network driver at runtime, but may want to set some values in the virtualport that may or may not be used, depending on the type. To support this usage, this patch replaces the union of structs with toplevel fields in the struct, making it possible for all of the fields to be set at the same time.
-
由 Laine Stump 提交于
Both of these functions returned void, but it's convenient for them to return a const char* of the char* that is passed in. This was you can call the function and use the result in the same expression/arg.
-
由 Eric Blake 提交于
Commit bb705e25 missed that the appArmor helper file also needs to resolve the new symbols dragged in by domain_conf.c. * src/Makefile.am (SECURITY_DRIVER_APPARMOR_HELPER_SOURCES): Pull in datatypes.c.
-
由 Eric Blake 提交于
* tests/viratomictest.c: Fix copy-and-paste bug.
-
- 14 8月, 2012 19 次提交
-
-
由 Dmitry Guryanov 提交于
openvzOpen fucntion must leave unlocked virDomainObj objects in driver->domains. Now even simple commands like list or domain lookup hang, for example virsh -c openvz:///system list --all. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Daniel P. Berrange 提交于
The code for picking a MCS label is about to get significantly more complicated, so it deserves to be in a standlone method, instead of a switch/case body. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
When generating an SELinux context for a VM from the template "system_u:system_r:svirt_t:s0", copy the role + user from the current process instead of the template context. So if the current process is unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 then the VM context ends up as unconfined_u:unconfined_r:svirt_t:s0:c386,c703 instead of system_u:system_r:svirt_t:s0:c177,c424 Ideally the /etc/selinux/targeted/contexts/virtual_domain_context file would have just shown the 'svirt_t' type, and not the full context, but that can't be changed now for compatibility reasons. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The virSecuritySELinuxGenNewContext method was not reporting any errors, leaving it up to the caller to report a generic error. In addition it could potentially trigger a strdup(NULL) in an OOM scenario. Move all error reporting into the virSecuritySELinuxGenNewContext method where accurate info can be provided Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
There is currently no way to distinguish the case that a requested security driver was disabled, from the case where no security driver was available. Use VIR_ERR_CONFIG_UNSUPPORTED as the error when an explicitly requested security driver was disabled Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The security_manager.h header is not self-contained because it uses the virDomainDefPtr without first including domain_conf.h Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The current virRandomBits() API is only usable if the caller wants a random number in the range [0, n-1) where n is a power of two. This adds a virRandom() API which generates a double in the range [0.0,1.0) with 48 bits of entropy. It then also adds a virRandomInt(uint32_t max) API which generates an unsigned in the range [0,@max) Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Martin Kletzander 提交于
Fixes for some typos that somehow didn't get to the final push of the commit 43bfa23e.
-
由 Daniel P. Berrange 提交于
The way LIBVIRT_VERSION_INFO is calculated has a timebomb that will cause us to accidentally break soname when we change the major version number to a non-zero value ! Given CURRENT:REVISION:AGE, libtool will generate libvirt.so.($CURRENT-$AGE).$AGE.$REVISION We set CURRENT to be MAJOR+MINOR and AGE to $MINOR, so as soon as MAJOR changes to non-zero, we get libvirt.so.1 as the soname, eg 1.3.9 would create libvirt.so.1.3.9 Looks natural but is not ABI compatible with libvirt.so.0.x.y The fix is to set CURRENT to always be exactly the same as AGE. We want to have the major version reflected in the so symlinks though. So then we set AGE to MAJOR*1000+MINOR eg, so 1.3.9 would create libvirt.so.0.1003.9 and libvirt 2.51.3 would create libvirt.so.0.2051.3
-
由 Osier Yang 提交于
As the consensus in: https://www.redhat.com/archives/libvir-list/2012-July/msg01692.html, this patch is to destroy conf/virdomainlist.[ch], folding the helpers into conf/domain_conf.[ch]. * src/Makefile.am: - Various indention fixes incidentally - Add macro DATATYPES_SOURCES (datatypes.[ch]) - Link datatypes.[ch] for libvirt_lxc * src/conf/domain_conf.c: - Move all the stuffs from virdomainlist.c into it - Use virUnrefDomain and virUnrefDomainSnapshot instead of virDomainFree and virDomainSnapshotFree, which are defined in libvirt.c, and we don't want to link to it. - Remove "if" before "free" the object, as virObjectUnref is in the list "useless_free_options". * src/conf/domain_conf.h: - Move all the stuffs from virdomainlist.h into it - s/LIST_FILTER/LIST_DOMAINS_FILTER/ * src/libxl/libxl_driver.c: - s/LIST_FILTER/LIST_DOMAINS_FILTER/ - no (include "virdomainlist.h") * src/libxl/libxl_driver.c: Likewise * src/lxc/lxc_driver.c: Likewise * src/openvz/openvz_driver.c: Likewise * src/parallels/parallels_driver.c: Likewise * src/qemu/qemu_driver.c: Likewise * src/test/test_driver.c: Likewise * src/uml/uml_driver.c: Likewise * src/vbox/vbox_tmpl.c: Likewise * src/vmware/vmware_driver.c: Likewise * tools/virsh-domain-monitor.c: Likewise * tools/virsh.c: Likewise
-
由 Martin Kletzander 提交于
libvirt creates invalid commands if wrong locale is selected. For example with locale that uses comma as a decimal point, JSON commands created with decimal numbers are invalid because comma separates the entries in JSON. Fortunately even when decimal point is affected, thousands grouping is not, because for grouping to be enabled with *printf, there has to be an apostrophe flag specified (and supported). This patch adds specific internal function for converting doubles to strings with C locale.
-
由 Ján Tomko 提交于
The common code for editing files in virsh-edit.c expects EDIT_DEFINE to return 0 on failure. virDomainSaveImageDefineXML returns 0 on success.
-
由 Asad Saeed 提交于
This is a patch for bug 847848 If registering an existing lockspace with the sanlock daemon returns an error, libvirt should not proceed to unlink the lockspace. Signed-off-by: NAsad Saeed <asad.saeed@acidseed.com>
-
由 Cole Robinson 提交于
Similar to the previous patch, prepending 'help' to a partial command string doesn't cut us any slack. $ virsh help pool-define-as --name foo --type dir error: command 'help' doesn't support option --name This patch adds a few hacks to make 'help' ignore everything after the first data bit, so the above command shows help output for pool-define-as.
-
由 Cole Robinson 提交于
Often times I find myself halfway through typing a long command when I want to see 'help' output. I instinctively append '--help' to the command I'm typing, only to get an error: $ virsh vol-create-as foo --help error: command 'vol-create-as' doesn't support option --help This patch makes --help work in a pretty hacky way. One missing piece here is that --help isn't listed as an option in the actual 'help <cmd>' output, but maybe this can be a starting point for someone.
-
由 Cole Robinson 提交于
For some reason I only get this after applying subsequent upcoming patches that touch virsh, but don't seem to actually cause the warning. virsh.c: In function ‘vshCommandParse’: virsh.c:2014:46: error: ‘opt_index’ may be used uninitialized in this function [-Werror=maybe-uninitialized] cc1: all warnings being treated as errors
-
由 Cole Robinson 提交于
Otherwise distcheck can fail with: GEN check-symfile Can't open perl script "../../src/check-symfile.pl": No such file or directory make[4]: *** [check-symfile] Error 2
-
由 Eric Blake 提交于
* AUTHORS: Add Frido Roose.
-
由 Frido Roose 提交于
This is a patch for bug 826704 All sanlock resources get released when hot-dettaching a disk from the domain because virLockManagerSanlockRelease uses the wrong function parameters/flags. With the patch only the resources that should be released are cleaned up. Signed-off-by: NFrido Roose <frido.roose@gmail.com>
-
- 11 8月, 2012 2 次提交
-
-
由 Peter Krempa 提交于
This patch introduces a new error code VIR_ERR_OPERATION_UNSUPPORTED to mark error messages regarding operations that failed due to lack of support on the hypervisor or other than libvirt issues. The code is first used in reporting error if qemu does not support block IO tuning variables yielding error message: error: Unable to get block I/O throttle parameters error: Operation not supported: block_io_throttle field 'total_bytes_sec' missing in qemu's output instead of: error: Unable to get block I/O throttle parameters error: internal error cannot read total_bytes_sec
-
由 Laine Stump 提交于
libvirt_qemu_probes.stp stopped working after switching to a build that used --with-driver-modules. This was because the symbols listed int libvirt_qemu_probes.stp are no longer in $(bindir)/libvirtd, but are now in $(libdir)/connection-driver/libvirt_driver_qemu.so. This patch enhances dtrace2systemtap.pl (which generates the .stp files from .d files) to look for a new "module" setting in the comments of the .d file (similar to the existing "binary" setting), and to look for a --with-modules option. If the --with-modules option is set *and* a "module" setting is present in the .d file, the process name for the stap line is set to $libdir/$module If either of these isn't true, it reverts to the old behavior. src/Makefile.am was also modified to add the --with-modules option when the build calls for it, and src/libvirt_qemu_probes.d has added a "module" line pointing to the correct .so file for the qemu driver.
-
- 10 8月, 2012 11 次提交
-
-
由 Martin Kletzander 提交于
List: - some old libvir/libvirt rename leftovers (the only problem can be if somebody parses 'virsh version' output really badly) - remove pointless tags specified in some pages that are not used
-
由 Martin Kletzander 提交于
This patch makes search.php autogenerated from search.php.in, thus removing hardcoded menus, footer etc. and the search.php is added to .gitignore. There is new rule added for *.php files (to make it bit less hardcoded) that takes *.php.code.in and injects it inside the generated *.php (xslt was not happy about php code in the source xml).
-
由 Martin Kletzander 提交于
Error 404 page had relative paths specified for both the image and stylesheets which caused a problem when requested URL included a subfolder (e.g. http://libvirt.org/asdf/asdf ). This patch corrects this behaviour by modifying href_base to '/' (for style-sheets) and changing the src of the image (to be '/' always).
-
由 Laine Stump 提交于
The meat of this patch is just moving the calls to virNWFilterRegisterCallbackDriver from each hypervisor's "register" function into its "initialize" function. The rest is just code movement to allow that, and a new virNWFilterUnRegisterCallbackDriver function to undo what the register function does. The long explanation: There is an array in nwfilter called callbackDrvArray that has pointers to a table of functions for each hypervisor driver that are called by nwfilter. One of those function pointers is to a function that will lock the hypervisor driver. Entries are added to the table by calling each driver's "register" function, which happens quite early in libvirtd's startup. Sometime later, each driver's "initialize" function is called. This function allocates a driver object and stores a pointer to it in a static variable that was previously initialized to NULL. (and here's the important part...) If the "initialize" function fails, the driver object is freed, and that pointer set back to NULL (but the entry in nwfilter's callbackDrvArray is still there). When the "lock the driver" function mentioned above is called, it assumes that the driver was successfully loaded, so it blindly tries to call virMutexLock on "driver->lock". BUT, if the initialize never happened, or if it failed, "driver" is NULL. And it just happens that "lock" is always the first field in driver so it is also NULL. Boom. To fix this, the call to virNWFilterRegisterCallbackDriver for each driver shouldn't be called until the end of its (*already guaranteed successful*) "initialize" function, not during its "register" function (which is currently the case). This implies that there should also be a virNWFilterUnregisterCallbackDriver() function that is called in a driver's "shutdown" function (although in practice, that function is currently never called).
-
由 Eric Blake 提交于
Otherwise, in locations like virobject.c where PROBE is used, for certain configure options, the compiler warns: util/virobject.c:110:1: error: 'intptr_t' undeclared (first use in this function) As long as we are making this header always available, we can clean up several other files. * src/internal.h (includes): Pull in <stdint.h>. * src/conf/nwfilter_conf.h: Rely on internal.h. * src/storage/storage_backend.c: Likewise. * src/storage/storage_backend.h: Likewise. * src/util/cgroup.c: Likewise. * src/util/sexpr.h: Likewise. * src/util/virhashcode.h: Likewise. * src/util/virnetdevvportprofile.h: Likewise. * src/util/virnetlink.h: Likewise. * src/util/virrandom.h: Likewise. * src/vbox/vbox_driver.c: Likewise. * src/xenapi/xenapi_driver.c: Likewise. * src/xenapi/xenapi_utils.c: Likewise. * src/xenapi/xenapi_utils.h: Likewise. * src/xenxs/xenxs_private.h: Likewise. * tests/storagebackendsheepdogtest.c: Likewise.
-
由 Eric Blake 提交于
Stefan's attribution came through with an extra 'n' in the email address.
-
由 Matthias Bolte 提交于
An ESX server has one or more PhysicalNics that represent the actual hardware NICs. Those can be listed via the interface driver. A libvirt virtual network is mapped to a HostVirtualSwitch. On the physical side a HostVirtualSwitch can be connected to PhysicalNics. On the virtual side a HostVirtualSwitch has HostPortGroups that are mapped to libvirt virtual network's portgroups. Typically there is HostPortGroups named 'VM Network' that is used to connect virtual machines to a HostVirtualSwitch. A second HostPortGroup typically named 'Management Network' is used to connect the hypervisor itself to the HostVirtualSwitch. This one is not mapped to a libvirt virtual network's portgroup. There can be more HostPortGroups than those typical two on a HostVirtualSwitch. +---------------+-------------------+ ...---| | | +-------------+ | HostPortGroup | |---| PhysicalNic | | VM Network | | | vmnic0 | ...---| | | +-------------+ +---------------+ HostVirtualSwitch | | vSwitch0 | +---------------+ | | HostPortGroup | | ...---| Management | | | Network | | +---------------+-------------------+ The virtual counterparts of the PhysicalNic is the HostVirtualNic for the hypervisor and the VirtualEthernetCard for the virtual machines that are grouped into HostPortGroups. +---------------------+ +---------------+---... | VirtualEthernetCard |---| | +---------------------+ | HostPortGroup | +---------------------+ | VM Network | | VirtualEthernetCard |---| | +---------------------+ +---------------+ | +---------------+ +---------------------+ | HostPortGroup | | HostVirtualNic |---| Management | +---------------------+ | Network | +---------------+---... The currently implemented network driver can list, define and undefine HostVirtualSwitches including HostPortGroups for virtual machines. Existing HostVirtualSwitches cannot be edited yet. This will be added in a followup patch.
-
由 Matthias Bolte 提交于
esxVI_LookupHostSystemProperties guarantees that hostSystem is non-NULL. Remove redundant NULL checks from callers. Also prefer esxVI_GetStringValue over open-coding the logic.
-
由 Matthias Bolte 提交于
The static deep copy allocates storage for the copy. The dynamic version injected the dynamic dispatch after the allocation. This triggered the invalid argument check in the dynamically dispatched deep copy call. The deep copy function expects its dest parameter to be a pointer to a NULL-pointer. This expectation wasn't met due to the dispatching deep copy doing the allocation before the call. Fix this by dynamically dispatching to the correct type before the allocation.
-
由 Matthias Bolte 提交于
Lists available PhysicalNic devices. A PhysicalNic is always active and can neither be defined nor undefined. A PhysicalNic is used to bridge a HostVirtualSwitch to the physical network.
-
由 Stefan Berger 提交于
Remove the target table before renaming a table to it, i.e., remove table B before renaming A to B. This makes the renaming more robust against unconnected left-over tables.
-
- 09 8月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
Both LVM volumes and SCSI LUNs have a globally unique identifier associated with them. It is useful to be able to query this identifier to then perform disk locking, rather than try to figure out a stable pathname. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Jiri Denemark 提交于
When entering "confirm" phase, we are interested in the value of cancelled rather then ret variable which was interesting before "finish" phase and didn't change since then.
-