summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Rework s390 architecture checkingv1.2.13-rc1Stefan Zimmermann2015-02-231-4/+3
| | | | | | | | Making use of the ARCH_IS_S390 macro introduced with e808357528d8be1ebc3970424b4a7b7c04eda2b6 Signed-off-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
* Prevent default creation of usb controller on s390 and s390xStefan Zimmermann2015-02-235-4/+11
| | | | | | | | | | | | Since s390 does not support usb the default creation of a usb controller for a domain should not occur. Also adjust s390 test cases by removing usb device instances since usb devices are no longer created by default for s390 the s390 test cases need to be adjusted. Signed-off-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
* man: moved virsh command cpu-modelsDaniel Hansel2015-02-231-4/+4
| | | | | | | | | The description of the virsh command 'cpu-models' was written in the wrong context (i.e. beside the domain states). This patch moves the command description just to the cpu related commands like 'cpu-baseline' and 'cpu-compare'. Signed-off-by: Daniel Hansel <daniel.hansel@linux.vnet.ibm.com>
* po: Add config file for zanataDaniel P. Berrange2015-02-231-0/+106
| | | | | Add configuration file for use with https://fedora.zanata.org translation system
* libvirt-guests: Allow time sync on guests resumeMichal Privoznik2015-02-232-0/+12
| | | | | | | | | | | | | | | | | | Well, imagine domains were running, and as the host went down, they were managesaved. Later, after some time, the host went up again and domains got restored. But without correct time. And depending on how long was the host shut off, it may take some time for ntp to sync the time too. But hey, wait a minute. We have an API just for that! So: 1) Introduce SYNC_TIME variable in libvirt-guests.sysconf to allow users control over the new functionality 2) Call 'virsh domtime --sync $dom' in the libvirt-guests script. Unfortunately, this is all-or-nothing approach (just like anything else with the script). Domains are required to have configured and running qemu-ga inside. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* qemu: Fix AAVMF/OVMF #define namesCole Robinson2015-02-211-8/+8
| | | | | The AAVMF and OVMF names were swapped. Reorder the one usage where it matters so behavior doesn't change.
* libxl: support backend domain setting for disk and net devicesMarek Marczykowski2015-02-201-0/+24
| | | | | | | | | | | This implement handling of <backenddomain name=''/> parameter introduced in previous patch. Works on Xen >= 4.3, because only there libxl supports setting backend domain by name. Specifying backend domain by ID or UUID is currently not supported. Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
* conf: support backend domain name in disk and network devicesMarek Marczykowski2015-02-204-0/+68
| | | | | | | | | | | | | | | | | | | | At least Xen supports backend drivers in another domain (aka "driver domain"). This patch introduces an XML config option for specifying the backend domain name for <disk> and <interface> devices. E.g. <disk> <backenddomain name='diskvm'/> ... </disk> <interface type='bridge'> <backenddomain name='netvm'/> ... </interface> In the future, same option will be needed for USB devices (hostdev objects), but for now libxl doesn't have support for PVUSB. Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
* network: allow <pf> together with <interface>/<address> in network statusLaine Stump2015-02-202-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function that parses the <forward> subelement of a network used to fail/log an error if the network definition contained both a <pf> element as well as at least one <interface> or <address> element. That check was present because the configuration of a network should have either one <pf>, one or more <interface>, or one or more <address>, but never combinations of multiple kinds. This caused a problem when libvirtd was restarted with a network already active - when a network with a <pf> element is started, the referenced PF (Physical Function of an SRIOV-capable network card) is checked for VFs (Virtual Functions), and the <forward> is filled in with a list of all VFs for that PF either in the form of their PCI addresses (a list of <address>) or their netdev names (a list of <interface>); the <pf> element is not removed though. When libvirtd is restarted, it parses the network status and finds both the original <pf> from the config, as well as the list of either <address> or <interface>, fails the parse, and the network is not added to the active list. This failure is often obscured because the network is marked as autostart so libvirt immediately restarts it. It seems odd to me that <interface> and <address> are stored in the same array rather than keeping two separate arrays, and having separate arrays would have made the check much simpler. However, changing to use two separate arrays would have required changes in more places, potentially creating more conflicts and (more importantly) more possible regressions in the event of a backport, so I chose to keep the existing data structure in order to localize the change. It appears that this problem has been in the code ever since support for <pf> was added (0.9.10), but until commit 34cc3b2f106e296df5e64309620c79d16fd76c85 (first in libvirt 1.2.4) networks with interface pools were not properly marked as active on restart anyway, so there is no point in backporting this patch any further than that.
* qemu: caps: Add capability bit for the "pc-dimm" devicePeter Krempa2015-02-203-0/+4
| | | | The pc-dimm device represents a RAM memory module.
* conf: Hoist validation of memory size into the post parse callbackPeter Krempa2015-02-201-21/+20
| | | | | | Later patches will need to access the full definition to do check the memory size and thus the checking needs to be done after the whole definition including devices is known.
* conf: numa: Check ABI stability of NUMA configurationPeter Krempa2015-02-204-0/+46
| | | | | Add helper to compare initial sizes of indivitual NUMA nodes and the map of belonging vCPUs. Other configuration is not ABI.
* conf: ABI: Hugepage backing definition is not guest ABIPeter Krempa2015-02-201-24/+0
| | | | | The backing of the vm's memory isn't influencing the guest ABI thus shouldn't be checked.
* conf: Move all NUMA configuration to virDomainNumaPeter Krempa2015-02-209-96/+63
| | | | | | | | | For historical reasons data regarding NUMA configuration were split between the CPU definition and numatune. We cannot do anything about the XML still being split, but we certainly can at least store the relevant data in one place. This patch moves the NUMA stuff to the right place.
* conf: numa: Add setter/getter for NUMA node memory sizePeter Krempa2015-02-204-5/+35
| | | | | Add the helpers and refactor places where the value is accessed without them.
* conf: numa: Add accessor to NUMA node's memory access modePeter Krempa2015-02-204-3/+16
|
* conf: numa: Add accessor for the NUMA node cpu maskPeter Krempa2015-02-204-3/+15
| | | | | Add virDomainNumaGetNodeCpumask() and refactor a few places that would get the cpu mask without the helper.
* conf: numa: Add helper to get guest NUMA node count and refactor usersPeter Krempa2015-02-205-6/+21
| | | | Add an accessor so that a later refactor is simpler.
* qemu: command: Unify retrieval of NUMA cell count in qemuBuildNumaArgStrPeter Krempa2015-02-201-6/+7
| | | | | The function uses the cell count in 6 places. Add a temp variable to hold the count as it will greatly simplify the refactor.
* conf: numa: Don't pass double pointer to virDomainNumatuneParseXMLPeter Krempa2015-02-203-14/+13
| | | | | virDomainNumatuneParseXML now doesn't allocate the def->numa object any longer so we don't need to pass a double pointer.
* numa: conf: Tweak parameters of virDomainNumatuneSetPeter Krempa2015-02-204-19/+17
| | | | | | | | | As virDomainNumatuneSet now doesn't allocate the virDomainNuma object any longer it's not necessary to pass the pointer to a pointer to store the object as it will not change any longer. While touching the parameter definitions I've also changed the name of the parameter to "numa".
* conf: numa: Always allocate the NUMA configPeter Krempa2015-02-204-25/+24
| | | | | | | | | Since our formatter now handles well if the config is allocated and not filled we can safely always-allocate the NUMA config and remove the ad-hoc allocation code. This will help in later patches as the parser will be refactored to just fill the data.
* conf: Allocate domain definition with the new helperPeter Krempa2015-02-2013-16/+16
| | | | | Use the virDomainDefNew() helper to allocate the definition instead of doing it via VIR_ALLOC.
* conf: Separate helper for creating domain objectsPeter Krempa2015-02-206-15/+29
| | | | | | Move the existing virDomainDefNew to virDomainDefNewFull as it's setting a few things in the conf and re-introduce virDomainDefNew as a function without parameters for common use.
* conf: numa: Format <numatune> XML only if necessaryPeter Krempa2015-02-201-0/+11
| | | | | | Do a content-aware check if formatting of the <numatune> element is necessary. Later on the def->numa structure will be always present so we cannot decide only on the basis whether it's allocated.
* conf: numa: Refactor logic in virDomainNumatuneParseXMLPeter Krempa2015-02-201-32/+21
| | | | | | Shuffling around the logic will allow to simplify the code quite a bit. As an additional bonus the change in the logic now reports an error if automatic placement is selected and individual placement is configured.
* conf: numa: Reformat virDomainNumatuneParseXMLPeter Krempa2015-02-201-20/+12
| | | | Collapse few of the conditions so that the program flow is more clear.
* conf: numa: Improve error message in case a numa node doesn't have cpusPeter Krempa2015-02-201-1/+6
| | | | | | | Currently the code would exit without reporting an error as virBitmapParse reports one only if it fails to parse the bitmap, whereas the code was jumping to the error label even in case 0 cpus were correctly parsed in the map.
* conf: numa: Recalculate rather than remember total NUMA cpu countPeter Krempa2015-02-206-10/+21
| | | | | | It's easier to recalculate the number in the one place it's used as having a separate variable to track it. It will also help with moving the NUMA code to the separate module.
* conf: Move enum virMemAccess to the NUMA code and rename itPeter Krempa2015-02-205-25/+23
| | | | | | | | Name it virNumaMemAccess and add it to conf/numa_conf.[ch] Note that to avoid a circular dependency the type of the NUMA cell memAccess variable was changed to int. It will be turned back later after the circular dependency will not exist.
* conf: numa: Rename virDomainNumatune to virDomainNumaPeter Krempa2015-02-2013-95/+95
| | | | | The structure will gradually become the only place for NUMA related config, thus rename it appropriately.
* conf: Move NUMA cell formatter to numa_confPeter Krempa2015-02-203-25/+42
| | | | | Move the code that formats the /domain/cpu/numa element to numa_conf as it belongs there.
* conf: numa: Don't duplicate NUMA cell cpumaskPeter Krempa2015-02-205-13/+10
| | | | | | | | | The mask was stored both as a bitmap and as a string. The string is used for XML output only. Remove the string, as it can be reconstructed from the bitmap. The test change is necessary as the bitmap formatter doesn't "optimize" using the '^' operator.
* conf: Refactor virDomainNumaDefCPUParseXMLPeter Krempa2015-02-204-74/+59
| | | | | | | | | | Rewrite the function to save a few local variables and reorder the code to make more sense. Additionally the ncells_max member of the virCPUDef structure is used only for tracking allocation when parsing the numa definition, which can be avoided by switching to VIR_ALLOC_N as the array is not resized after initial allocation.
* conf: Move NUMA cell parsing code from cpu conf to numa confPeter Krempa2015-02-204-96/+126
| | | | | | | | | For weird historical reasons NUMA cells are added as a subelement of <cpu> while the actual configuration is done in <numatune>. This patch splits out the cell parser code from cpu config to NUMA config. Note that the changes to the code are minimal just to make it work and the function will be refactored in the next patch.
* conf: Move numatune_conf to numa_confPeter Krempa2015-02-206-12/+12
| | | | | | | | | For a while now there are two places that gather information about NUMA related guest configuration. While the XML can't be changed we can at least store the data in one place in the definition. Rename the numatune_conf.[ch] files to numa_conf as later patches will move the rest of the definitions from the cpu definition to this one.
* virsh: fix vcpupin infoPavel Hrdina2015-02-202-42/+35
| | | | | | | | | | | | | | The "virDomainGetInfo" will get for running domain only live info and for offline domain only config info. There was no way how to get config info for running domain. We will use "vshCPUCountCollect" instead to get the correct cpu count that we need to pass to "virDomainGetVcpuPinInfo". Also cleanup some unnecessary variables and checks that are done by drivers. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1160559 Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* virQEMUCapsCacheLookupCopy: Filter qemuCaps based on machineTypeMichal Privoznik2015-02-203-1/+42
| | | | | | | | | | | | | Not all machine types support all devices, device properties, backends, etc. So until we create a matrix of [machineType, qemuCaps], lets just filter out some capabilities before we return them to the consumer (which is going to make decisions based on them straight away). Currently, as qemu is unable to tell which capabilities are (not) enabled for given machine types, it's us who has to hardcode the matrix. One day maybe the hardcoding will go away and we can create the matrix dynamically on the fly based on a few monitor calls. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* virQEMUCapsCacheLookupCopy: Pass machine typeMichal Privoznik2015-02-204-6/+13
| | | | | | | It will come handy in the near future when we will filter some capabilities based on it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* virsh-edit: Make force editing usableMartin Kletzander2015-02-204-12/+47
| | | | | | | | | | | | | When editing a domain with 'virsh edit' and failing validation, the usual message pops up: Failed. Try again? [y,n,f,?]: Turning off validation can be useful, mainly for testing (but other purposes too), so this patch adds support for relaxing definition in virsh-edit and makes 'virsh edit <domain>' more usable. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
* parallels: Set the first HDD from XML as bootableMikhail Feoktistov2015-02-191-4/+91
| | | | | | | | | 1. Delete all boot devices for VM instance 2. Find the first HDD from XML and set it as bootable Now we support only one boot device and it should be HDD. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* parallels: Use IS_CT() macro instead of STREQ("exe")Mikhail Feoktistov2015-02-191-5/+4
|
* parallels: code aligmentMikhail Feoktistov2015-02-191-8/+8
|
* Search for schemas and cpu_map.xml in source treeJiri Denemark2015-02-1912-24/+27
| | | | | | | | | | | Not all files we want to find using virFileFindResource{,Full} are generated when libvirt is built, some of them (such as RNG schemas) are distributed with sources. The current API was not able to find source files if libvirt was built in VPATH. Both RNG schemas and cpu_map.xml are distributed in source tarball. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* qemuMigrationDriveMirror: Listen to eventsMichal Privoznik2015-02-191-20/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1179678 When migrating with storage, libvirt iterates over domain disks and instruct qemu to migrate the ones we are interested in (shared, RO and source-less disks are skipped). The disks are migrated in series. No new disk is transferred until the previous one hasn't been quiesced. This is checked on the qemu monitor via 'query-jobs' command. If the disk has been quiesced, it practically went from copying its content to mirroring state, where all disk writes are mirrored to the other side of migration too. Having said that, there's one inherent error in the design. The monitor command we use reports only active jobs. So if the job fails for whatever reason, we will not see it anymore in the command output. And this can happen fairly simply: just try to migrate a domain with storage. If the storage migration fails (e.g. due to ENOSPC on the destination) we resume the host on the destination and let it run on partly copied disk. The proper fix is what even the comment in the code says: listen for qemu events instead of polling. If storage migration changes state an event is emitted and we can act accordingly: either consider disk copied and continue the process, or consider disk mangled and abort the migration. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* qemuProcessHandleBlockJob: Take status into accountMichal Privoznik2015-02-191-1/+2
| | | | | | | | | | | | | | | | | | | Upon BLOCK_JOB_COMPLETED event delivery, we check if the job has completed (in qemuMonitorJSONHandleBlockJobImpl()). For better image, the event looks something like this: "timestamp": {"seconds": 1423582694, "microseconds": 372666}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "drive-virtio-disk0", "len": 8412790784, "offset": 409993216, "speed": 8796093022207, "type": "mirror", "error": "No space left on device"}} If "len" does not equal "offset" it's considered an error, and we can clearly see "error" field filled in. However, later in the event processing this case was handled no differently to case of job being aborted via separate API. It's time that we start differentiate these two because of the future work. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* qemuProcessHandleBlockJob: Set disk->mirrorState more oftenMichal Privoznik2015-02-191-15/+20
| | | | | | | | | | | | | | | | | | | Currently, upon BLOCK_JOB_* event, disk->mirrorState is not updated each time. The callback code handling the events checks if a blockjob was started via our public APIs prior to setting the mirrorState. However, some block jobs may be started internally (e.g. during storage migration), in which case we don't bother with setting disk->mirror (there's nothing we can set it to anyway), or other fields. But it will come handy if we update the mirrorState in these cases too. The event wasn't delivered just for fun - we've started the job after all. So, in this commit, the mirrorState is set to whatever job status we've obtained. Of course, there are some actions on some statuses that we want to perform. But instead of if {} else if {} else {} ... enumeration, let's move to switch(). Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* qemu: Exit job on error path of qemuDomainSetVcpusFlags()Peter Krempa2015-02-181-3/+3
| | | | | Commit e105dc981438bc33fa771bd67cece6234dbf6c8d moved some code but didn't adjust the jump labels so that the job would be terminated.
* daemon: Fix segfault by reloading daemon right after startPavel Hrdina2015-02-181-1/+8
| | | | | | | | | | | | | | | | | | | Libvirt could crash with segfault if user issue "service reload" right after "service start". One possible way to crash libvirt is to run reload during initialization of QEMU driver. It could happen when qemu driver will initialize qemu_driver_lock but don't have a time to set it's "config" and the SIGHUP arrives. The reload handler tries to get qemu_drv->config during "virStorageAutostart" and dereference it which ends with segfault. Let's ignore all reload requests until all drivers are initialized. In addition set driversInitialized before we enter virStateCleanup to ignore reload request while we are shutting down. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1179981 Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* docs: clarify nat range behaviorJán Tomko2015-02-181-0/+2
| | | | | | | All the addresses from the range are used, not just those that are in use on the host. https://bugzilla.redhat.com/show_bug.cgi?id=1079917