- 11 12月, 2012 21 次提交
-
-
由 Laine Stump 提交于
These three functions are very similar - none allow a MODIFY operation; you can only add or delete. The biggest difference between them (other than the data itself) is in the criteria for determining a match, and whether or not multiple matches are possible: 1) for HOST records, it's considered a match if the IP address or any of the hostnames of an existing record matches. 2) for SRV records, it's a match if all of domain+service+protocol+target *which have been specified* are matched. 3) for TXT records, there is only a single field to match - name (value can be the same for multiple records, and isn't considered a search term), so by definition there can be no ambiguous matches. In all three cases, if any matches are found, ADD will fail; if multiple matches are found, it means the search term was ambiguous, and a DELETE will fail. The upper level code in bridge_driver.c is already implemented for these functions - appropriate conf files will be re-written, and dnsmasq will be SIGHUPed or restarted as appropriate.
-
由 Laine Stump 提交于
Since there is only a single virNetworkDNSDef for any virNetworkDef, and it's trivial to determine whether or not it contains any real data, it's much simpler (and fits more uniformly with the parse function calling sequence of the parsers for many other objects that are subordinates of virNetworkDef) if virNetworkDef *contains* an virNetworkDNSDef rather than pointing to one. Since it is now just a part of another object rather than its own object, it no longer makes sense to have a *Free() function, so that is changed to a *Clear() function. More importantly though, ParseXML and Clear functions are needed for the individual items contained in a virNetworkDNSDef (srv, txt, and host records), but none of them have a *Clear(), and only two of the three had *ParseXML() functions (both of which used a non-uniform arglist). Those problems are cleared up by this patch - it splits the higher-level Clear function into separate functions for each of the three, creates a parse for txt records, and cleans up the srv and host parsers, so we now have all the utility functions necessary to implement virNetworkDefUpdateDNS(Host|Srv|Txt).
-
由 Laine Stump 提交于
This shortens the name of the structs for srv and txt, and their instances in virNetworkDNSDef, to be more compact and uniform with the naming of the dns host array. It also changes the type of ntxts, etc from unsigned int to size_t, so that they can be used directly as args to VIR_*_ELEMENT.
-
由 Laine Stump 提交于
The already-written backend functions for virNetworkUpdate that add and delete items into lists within the a network were already debugged to work properly, but future such functions will use VIR_(INSERT|DELETE)_ELEMENT instead, so these are changed for uniformity.
-
由 Laine Stump 提交于
I noticed when writing the backend functions for virNetworkUpdate that I was repeating the same sequence of memmove, VIR_REALLOC, nXXX-- (and messed up the args to memmove at least once), and had seen the same sequence in a lot of other places, so I decided to write a few utility functions/macros - see the .h file for full documentation. The intent is to reduce the number of lines of code, but more importantly to eliminate the need to check the element size and element count arithmetic every time we need to do this (I *always* make at least one mistake.) VIR_INSERT_ELEMENT: insert one element at an arbitrary index within an array of objects. The size of each object is determined automatically by the macro using sizeof(*array). The new element's contents are copied into the inserted space, then the original copy of contents are 0'ed out (if everything else was successful). Compile-time assignment and size compatibility between the array and the new element is guaranteed (see explanation below [*]) VIR_INSERT_ELEMENT_COPY: identical to VIR_INSERT_ELEMENT, except that the original contents of newelem are not cleared to 0 (i.e. a copy is made). VIR_APPEND_ELEMENT: This is just a special case of VIR_INSERT_ELEMENT that "inserts" one past the current last element. VIR_APPEND_ELEMENT_COPY: identical to VIR_APPEND_ELEMENT, except that the original contents of newelem are not cleared to 0 (i.e. a copy is made). VIR_DELETE_ELEMENT: delete one element at an arbitrary index within an array of objects. It's assumed that the element being deleted is already saved elsewhere (or cleared, if that's what is appropriate). All five of these macros have an _INPLACE variant, which skips the memory re-allocation of the array, assuming that the caller has already done it (when inserting) or will do it later (when deleting). Note that VIR_DELETE_ELEMENT* can return a failure, but only if an invalid index is given (index + amount to delete is > current array size), so in most cases you can safely ignore the return (that's why the helper function virDeleteElementsN isn't declared with ATTRIBUTE_RETURN_CHECK). A warning is logged if this ever happens, since it is surely a coding error. [*] One initial problem with the INSERT and APPEND macros was that, due to both the array pointer and newelem pointer being cast to void* when passing to virInsertElementsN(), any chance of type-checking was lost. If we were going to move in newelem with a memmove anyway, we would be no worse off for this. However, most current open-coded insert/append operations use direct struct assignment to move the new element into place (or just populate the new element directly) - thus use of the new macros would open a possibility for new usage errors that didn't exist before (e.g. accidentally sending &newelemptr rather than newelemptr - I actually did this quite a lot in my test conversions of existing code). But thanks to Eric Blake's clever thinking, I was able to modify the INSERT and APPEND macros so that they *do* check for both assignment and size compatibility of *ptr (an element in the array) and newelem (the element being copied into the new position of the array). This is done via clever use of the C89-guaranteed fact that the sizeof() operator must have *no* side effects (so an assignment inside sizeof() is checked for validity, but not actually evaluated), and the fact that virInsertElementsN has a "# of new elements" argument that we want to always be 1.
-
由 Peter Krempa 提交于
When restarting CPUs after an external snapshot, the restarting function was called without the appropriate async job type. This caused that a new sync job wasn't created and allowed races in the monitor.
-
由 Dmitry Guryanov 提交于
If some hard disk is not found in new domain configuration, it should be removed. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
New VM will have default values for all parameters, like cpu number, we have to change its configuration as provided by xml definition, given to parallelsDomainDefineXML. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Implement creation of new disks - if a new disk found in configuration, find a volume by disk path and actually create a disk image by issuing prlctl command. If it's successfully finished - remove the file with volume definition. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Add function for convertion bus from libvirt's numeric constant to a name, used in a parallels command-line tools. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Move part, which deletes existing volume, to a new function parallelsStorageVolumeDefRemove so that we can use it later in parallels_driver.c Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Read disk images size from xml description and fill virStorageVolDef.capacity and allocation (let's consider that allocation is the same as capacity, calculating real allcoation will be implemented later). Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Disk images in Parallels Cloud Server stored in directories. Each one has files with data and xml description of an image stored in file DiskDescriptior.xml. Since we have to support 'detached' images, which are not used by any VM, the better way to collect info about volumes is searching for directories with a file DiskDescriptior.xml in each VM directory. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
We always have to close opened dir and free 'path'. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
There are no storage pools in Parallels Cloud Server - All VM data stored in a single directory: config, snapshots, memory dump together with disk images. Let's look through list of VMs and create a storage pool for each directory, containing VMs. So if you have 3 vms: /var/parallels/vm-1.pvm, /var/parallels/vm-2.pvm and /root/test.pvm - 2 storage pools appear: -var-parallels and -root. xml descriptions of the pools will be saved in /etc/libvirt/parallels-storage, so UUIDs will not change netween connections to libvirt. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
We don't support unprivileged users anymore, so remove code, which selects configuration directory depending on user. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Move code for loading inforation about pools to a separate function - parallelsLoadPools. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Allow changing some parameters of the hard disks: bus, image and drive address. Creating new disk devices and removing existing ones require changes in the storage driver, so it will be implemented later. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Parse information about hard disks and fill disks array in virDomainDef structure. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 liguang 提交于
Offline migration transfers inactive definition of a domain (which may or may not be active). After successful completion, the domain remains in its current state on source host and is defined but inactive on destination host. It's a bit more clever than virDomainGetXMLDesc() on source host followed by virDomainDefineXML() on destination host, as offline migration will run pre-migration hook to update the domain XML on destination host. Currently, copying non-shared storage is not supported during offline migration. Offline migration can be requested with a new migration flag called VIR_MIGRATE_OFFLINE (which has to be combined with VIR_MIGRATE_PERSIST_DEST flag).
-
由 Laine Stump 提交于
This fixes a problem that showed up during testing of: https://bugzilla.redhat.com/show_bug.cgi?id=881480 Due to a logic error in the function that gets the name of the bridge an interface connects to, any time a bridge was specified directly (type='bridge') rather than indirectly (type='network'), An error would be logged (although the operation would then complete successfully): Network type 6 is not supported The final virReportError() in the function qemuDomainNetGetBridgeName() was apparently avoided in the past with a "goto cleanup" at the end of each case, but the case of bridge somehow no longer has that final goto cleanup. The proper solution is anyway to not rely on goto's, but put the error log inside an else {} clause, so that it's executed only if the type is neither bridge nor network (in reality, this function should only ever be called for those two types, that's why this is an internal error). While making this change, the error message was also tuned to be more correct (since it's not really the type of the network, but the type of the interface, and it *is* otherwise supported, it's just that the interface type in question doesn't *have* a bridge device associated with it, or at least we don't know how to get it).
-
- 10 12月, 2012 2 次提交
-
-
由 Viktor Mihajlovski 提交于
If a network interface model is not specified, libvirt will run into an unchecked NULL pointer coredump. On the other hand if the empty model is ignored, a PCI bus address would be generated, which is not supported by S390. Since the only valid network type model for S390 is virtio, we use this as the default value, which is the same for QEMU. Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
-
由 Michal Privoznik 提交于
This reverts commit 51144313 which was pushed accidentally.
-
- 08 12月, 2012 1 次提交
-
-
由 Cole Robinson 提交于
Things are supposed to look like: <machine canonical='pc-0.12'>pc</machine> But are currently swapped. This can cause many VMs to revert to having machine type='pc' which will affect save/restore across qemu upgrades.
-
- 07 12月, 2012 8 次提交
-
-
由 Peter Krempa 提交于
The termios struct exported by the termios.h header is used as an argument for vshMakeStdinRaw(). The header isn't used anywhere in tools/virsh-domain.c. This patch adds the header to the header declaring vshMakeStdinRaw() and removes other places in virsh.
-
由 Ján Tomko 提交于
Add --prealloc-metadata flag to these commands: vol-clone vol-create vol-create-as vol-create-from
-
由 Ján Tomko 提交于
Add VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA flag to virStorageVolCreateXML and virStorageVolCreateXMLFrom. This flag requests metadata preallocation when creating/cloning qcow2 images, resulting in creating a sparse file with qcow2 metadata. It has only slightly larger disk usage compared to new image with no allocation, but offers higher performance.
-
由 Osier Yang 提交于
QEMU supports setting vendor and product strings for disk since 1.2.0 (only scsi-disk, scsi-hd, scsi-cd support it), this patch exposes it with new XML elements <vendor> and <product> of disk device.
-
由 Jim Fehlig 提交于
Based on a patch originally authored by Daniel De Graaf http://lists.xen.org/archives/html/xen-devel/2012-05/msg00565.html This patch converts the Xen libxl driver to support only Xen >= 4.2. Support for Xen 4.1 libxl is dropped since that version of libxl is designated 'technology preview' only and is incompatible with Xen 4.2 libxl. Additionally, the default toolstack in Xen 4.1 is still xend, for which libvirt has a stable, functional driver.
-
由 Guido Günther 提交于
As of 1a50ba2c qemu capabilities probing takes longer since we timeout waiting for the monitor socket. When probing qemu for different architectures this can add up so the daemon auto shutdown timeout is reached and the client doesn't have a chance to connect. To avoid that inhibit daemon shutdown during driver initialization (which includes capabilities probing). This fixes http://honk.sigxcpu.org:8001/job/libvirt-tck-debian-wheezy-qemu-session/227/
-
由 Christophe Fergeau 提交于
virGetGroupIDByName is documented as returning 1 if the groupname cannot be found. getgrnam_r is documented as returning: « 0 or ENOENT or ESRCH or EBADF or EPERM or ... The given name or gid was not found. » and that: « The formulation given above under "RETURN VALUE" is from POSIX.1-2001. It does not call "not found" an error, hence does not specify what value errno might have in this situation. But that makes it impossible to recognize errors. One might argue that according to POSIX errno should be left unchanged if an entry is not found. Experiments on various UNIX-like systems shows that lots of different values occur in this situation: 0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM and probably others. » virGetGroupIDByName returns an error when the return value of getgrnam_r is non-0. However on my RHEL system, getgrnam_r returns ENOENT when the requested user cannot be found, which then causes virGetGroupID not to behave as documented (it returns an error instead of falling back to parsing the passed-in value as an gid). This commit makes virGetGroupIDByName only report an error when errno is set to one of the values in the posix description of getgrnam_r (which are the same as the ones described in the manpage on my system).
-
由 Christophe Fergeau 提交于
virGetUserIDByName is documented as returning 1 if the username cannot be found. getpwnam_r is documented as returning: « 0 or ENOENT or ESRCH or EBADF or EPERM or ... The given name or uid was not found. » and that: « The formulation given above under "RETURN VALUE" is from POSIX.1-2001. It does not call "not found" an error, hence does not specify what value errno might have in this situation. But that makes it impossible to recognize errors. One might argue that according to POSIX errno should be left unchanged if an entry is not found. Experiments on various UNIX-like systems shows that lots of different values occur in this situation: 0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM and probably others. » virGetUserIDByName returns an error when the return value of getpwnam_r is non-0. However on my RHEL system, getpwnam_r returns ENOENT when the requested user cannot be found, which then causes virGetUserID not to behave as documented (it returns an error instead of falling back to parsing the passed-in value as an uid). This commit makes virGetUserIDByName only report an error when errno is set to one of the values in the posix description of getpwnam_r (which are the same as the ones described in the manpage on my system).
-
- 06 12月, 2012 6 次提交
-
-
由 Michal Privoznik 提交于
If debugging is enabled, the debug messages are sent to stderr. Moreover, if a command has catching of stderr set, the messages gets mixed with stdout output (assuming both outputs are stored in the same variable). The resulting string then doesn't necessarily have to start with desired prefix then. This bug exposes itself when parsing dnsmasq output: 2012-12-06 11:18:11.445+0000: 18491: error : dnsmasqCapsSetFromBuffer:664 : internal error cannot parse /usr/sbin/dnsmasq version number in '2012-12-06 11:11:02.232+0000: 18492: debug : virFileClose:72 : Closed fd 22' We can clearly see that the output of dnsmasq --version doesn't start with expected "Dnsmasq version " string but a libvirt debug output.
-
由 Michal Privoznik 提交于
If the debugging is enabled, the virCommand subsystem catches debug messages in the command output as well. In that case, we can't assume the string corresponding to command's stdout will start with specific prefix. But the prefix can be moved deeper in the string. This bug shows itself when parsing dnsmasq output: 2012-12-06 11:18:11.445+0000: 18491: error : dnsmasqCapsSetFromBuffer:664 : internal error cannot parse /usr/sbin/dnsmasq version number in '2012-12-06 11:11:02.232+0000: 18492: debug : virFileClose:72 : Closed fd 22' We can clearly see that the output of dnsmasq --version doesn't start with expected "Dnsmasq version " string but a libvirt debug output.
-
由 Laine Stump 提交于
This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=767057 It was possible to define a network with <forward mode='bridge'> that had both a bridge device and a forward device defined. These two are mutually exclusive by definition (if you are using a bridge device, then this is a host bridge, and if you have a forward dev defined, this is using macvtap). It was also possible to put <ip>, <dns>, and <domain> elements in this definition, although those aren't supported by the current driver (although it's conceivable that some other driver might support that). The items that are invalid by definition, are now checked in the XML parser (since they will definitely *always* be wrong), and the others are checked in networkValidate() in the network driver (since, as mentioned, it's possible that some other network driver, or even this one, could some day support setting those).
-
由 Gene Czarcinski 提交于
This patch adds the capability for virtual guests to do IPv6 communication via a virtual network interface with no IPv6 (gateway) addresses specified. This capability has always been enabled by default for IPv4, but disabled for IPv6 for security concerns, and because it requires the ip6tables command to be operational (which isn't the case on a system with the ipv6 module completely disabled). This patch adds a new attribute "ipv6" at the toplevel of a <network> object. If ipv6='yes', the extra ip6tables rules required to permite inter-guest communications are added when the network is started. If it is 'no', or not present, those rules will not be added; thus the default behavior doesn't change, so there should be no compatibility issues with any existing installations. Note that virtual guests cannot communication with the virtualization host via this interface, because the following kernel tunable has been set: net.ipv6.conf.<bridge_interface_name>.disable_ipv6 = 1 This assures that the bridge interface will not have an IPv6 link-local (fe80::) address. To control this behavior so that it is not enabled by default, the parameter ipv6='yes' on the <network> statement has been added. Documentation related to this patch has been updated. The network schema has also been updated.
-
由 Osier Yang 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=832302 It's odd to fall through to buildVol, and the existed file is removed when buildVol fails. This checks if the volume target path already exists in createVol. The reason for not using error like "Volume already exists" is that there isn't volume maintained by libvirt for the path until a operation like pool-refresh, using error like that will just cause confusion.
-
由 Daniel P. Berrange 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=866524 Since the virConnect object is not locked wholely when doing virConenctDispose, a thread can get the lock and thus might cause the race. Detected by valgrind: ==23687== Invalid read of size 4 ==23687== at 0x38BAA091EC: pthread_mutex_lock (pthread_mutex_lock.c:61) ==23687== by 0x3FBA919E36: remoteClientCloseFunc (remote_driver.c:337) ==23687== by 0x3FBA936BF2: virNetClientCloseLocked (virnetclient.c:688) ==23687== by 0x3FBA9390D8: virNetClientIncomingEvent (virnetclient.c:1859) ==23687== by 0x3FBA851AAE: virEventPollRunOnce (event_poll.c:485) ==23687== by 0x3FBA850846: virEventRunDefaultImpl (event.c:247) ==23687== by 0x40CD61: vshEventLoop (virsh.c:2128) ==23687== by 0x3FBA8626F8: virThreadHelper (threads-pthread.c:161) ==23687== by 0x38BAA077F0: start_thread (pthread_create.c:301) ==23687== by 0x33F68E570C: clone (clone.S:115) ==23687== Address 0x4ca94e0 is 144 bytes inside a block of size 312 free'd ==23687== at 0x4A0595D: free (vg_replace_malloc.c:366) ==23687== by 0x3FBA8588B8: virFree (memory.c:309) ==23687== by 0x3FBA86AAFC: virObjectUnref (virobject.c:145) ==23687== by 0x3FBA8EA767: virConnectClose (libvirt.c:1458) ==23687== by 0x40C8B8: vshDeinit (virsh.c:2584) ==23687== by 0x41071E: main (virsh.c:3022) The above race is caused by the eventLoop thread tries to handle the net client event by calling the callback set by: virNetClientSetCloseCallback(priv->client, remoteClientCloseFunc, conn, NULL); I.E. remoteClientCloseFunc, which lock/unlock the virConnect object. This patch is to fix the bug by setting the callback to NULL when doRemoteClose.
-
- 05 12月, 2012 2 次提交
-
-
由 Peter Krempa 提交于
The pciWrite32 function assembled the array of data to be written to the fd with a bad offset on the last byte. This issue was probably caused by a typo (14, 24).
-
由 Jiri Denemark 提交于
Directly open and close PCI config file in the APIs that need it rather than keeping the file open for the whole life of PCI device structure.
-