- 12 3月, 2019 19 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1564270 Now that everything is prepared for qemu driver we can enable parser feature to allow users define such domains. At the same time, introduce bunch of tests to test the feature. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
The firmware selection code will enable the feature if needed. There's no need to require SMM to be enabled in that case. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
-
由 Michal Privoznik 提交于
When preparing domain call qemuFirmwareFillDomain() to fill in desired firmware. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
And finally the last missing piece. This is what puts it all together. At the beginning, qemuFirmwareFillDomain() loads all possible firmware description files based on algorithm described earlier. Then it tries to find description which matches given domain. The criteria are: - firmware is the right type (e.g. it's bios when bios was requested in domain XML) - firmware is suitable for guest architecture/machine type - firmware allows desired guest features to stay enabled (e.g. if s3/s4 is enabled for guest then firmware has to support it too) Once the desired description has been found it is then used to set various bits of virDomainDef so that proper qemu cmd line is constructed as demanded by the description file. For instance, secure boot enabled firmware might request SMM -> it will be enabled if needed. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
Implementation for yet another part of firmware description specification. This one covers selecting which files to parse. There are three locations from which description files can be loaded. In order of preference, from most generic to most specific these are: /usr/share/qemu/firmware /etc/qemu/firmware $XDG_CONFIG_HOME/qemu/firmware If a file is found in two or more locations then the most specific one is used. Moreover, if file is empty then it means it is overriding some generic description and disabling it. Again, this is described in more details and with nice examples in firmware.json specification (qemu commit 3a0adfc9bf). However, there's one slight difference - for the root user the home directory is not searched. This follows rules laid out by similar look up processes, e.g. PKI x509 certs are not searched in /root but they are looked for under /home. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
-
由 Michal Privoznik 提交于
Test firmware description parsing so far. The test files come from three locations: 1) ovmf-sb-keys.json and ovmf-sb.json come from OVMF package from RHEL-7 (with slight name change to reflect their features in filename too), 2) bios.json and aavmf.json come from example JSON documents from firmware.json from qemu's git (3a0adfc9bf), 3) ovmf.json is then copied from ovmf-sb.json and stripped of SECURE_BOOT and REQUIRES_SMM flags, OVMF path change, description update and machine type expanded for both pc and q35 machine types. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Acked-by: NLaszlo Ersek <lersek@redhat.com>
-
由 Michal Privoznik 提交于
The firmware description is a JSON file which follows specification from qemu.git/docs/interop/firmware.json. The description file basically says: Firmware file X is {bios|uefi}, supports these targets and machine types, requires these features to be enabled on qemu cmd line and this is how you put it onto qemu cmd line. The firmware.json specification covers more (i.e. how to select the right firmware) but that will be covered and implemented in next commits. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
The idea is that using this attribute users enable libvirt to automagically select firmware image for their domain. For instance: <os firmware='efi'> <type arch='x86_64' machine='pc-q35-4.0'>hvm</type> <loader secure='no'/> </os> <os firmware='bios'> <type arch='x86_64' machine='pc-q35-4.0'>hvm</type> </os> (The automagic of selecting firmware image will be described in later commits.) Accepted values are 'bios' and 'efi' to let libvirt select corresponding type of firmware. I know it is a good sign to introduce xml2xml test case when changing XML config parser but that will have to come later. Firmware auto selection is not enabled for any driver just yet so any xml2xml test would fail right away. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
This is going to extend virDomainLoader enum. The reason is that once loader path is NULL its type makes no sense. However, since value of zero corresponds to VIR_DOMAIN_LOADER_TYPE_ROM the following XML would be produced: <os> <loader type='rom'/> ... </os> To solve this, introduce VIR_DOMAIN_LOADER_TYPE_NONE which would correspond to value of zero and then use post parse callback to set the default loader type to 'rom' if needed. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
Except not really. At least for now. In the future, the firmware will be selected automagically. Therefore, it makes no sense to require the pathname of a specific firmware binary in the domain XML. But since it is not implemented do not really allow the path to be NULL. Only move code around to prepare it for further expansion. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
In some cases, the string representing architecture is different in qemu and libvirt. That is the reason why we have virQEMUCapsArchFromString() and virQEMUCapsArchToString(). So far, we did not need them outside of qemu_capabilities code, but this will change shortly. Expose them then. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
Move the code that (possibly) generates filename of NVRAM VAR store into a single function so that it can be re-used later. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Peter Krempa 提交于
It's meant for testing, not for production builds. Also we have a helper for reporting OOM errors. Introduced by 23e0bf1cSigned-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Andrea Bolognani 提交于
In qemuxml2xmltest, both activeVcpus and blockjobs members of the testInfo struct have been entirely unused ever since commit d1a7fc8b. Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
-
由 Eric Blake 提交于
In local testing, I accidentally introduced a self-test failure, and spent way too much time debugging it. Make sure the testsuite log includes some hint as to why command option validation failed. Lone exception: allocation failure is unlikely during self-test, and if it happens, we are better off asserting (vsh.c can do this, even if libvirt.so cannot). Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Martin Kletzander 提交于
Forgot to remove this before pushing. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Martin Kletzander 提交于
Similarly to CAT, when you set some values in an group, remove the group and recreate it, the previous values will be kept there. In order to not get values from a previous setting (a previous VM, for example), we need to set them to sensible defaults. The same way we do that for CAT, just set the same values as the default group has. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Martin Kletzander 提交于
For CAT we calculate unallocated parts of the cache, however with MBA this does not make sense as the purpose of that is to limit the bandwidth and the setting is only proportional relative to bandwidth settings for other groups. This means it makes sense to set the values to 100% even if there are other groups with some allocations and that we don't need to find the available (unallocated) bandwidth in all the groups. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 11 3月, 2019 6 次提交
-
-
由 Shotaro Gotanda 提交于
So far we are providing the suppressions file with a relative path to valgrind. This apparently doesn't work on some distros like Ubuntu and its derivates. Providing the absolute path fixes the problem. Signed-off-by: NShotaro Gotanda <g.sho1500@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Andrea Bolognani 提交于
The existing behavior for ppc64 guests is to always add a USB keyboard and mouse combo if graphics are present; unfortunately, this means any attempt to use a USB tablet will cause both pointing devices to show up in the guest, which in turn will result in poor user experience. We can't just stop adding the USB mouse or start adding a USB tablet instead, because existing applications and users might rely on the current behavior; however, we can avoid adding the USB mouse if a USB tablet is already present, thus allowing users and applications to create guests that contain a single pointing device. https://bugzilla.redhat.com/show_bug.cgi?id=1683681Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Andrea Bolognani 提交于
These are similar to the existing simple headless guests, but also include a graphical output and some input devices. Input files were generated by running $ virt-install \ --name guest --os-variant fedora29 \ --vcpus 4 --memory 4096 --disk size=5 \ --graphics vnc \ --print-xml followed by minor tweaks. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Andrea Bolognani 提交于
Some devices (namely virtio-scsi, virtio-gpu, virtio-keyboard, virtio-tablet and virtio-mouse, plus virtio-crypto which is not supported by libvirt) don't follow the same rules as all other virtio devices, which is something that ought to be documented. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Andrea Bolognani 提交于
While the parser and schema have to accept all possible models, virtio-(non-)transitional models are only applicable to type=passthrough and should be otherwise rejected. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
- 08 3月, 2019 15 次提交
-
-
由 Cole Robinson 提交于
Reviewed-by: NErik Skultety <eskultet@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Pavel Hrdina 提交于
Only PCI devices have '/sys/class/net/<ifname>/device/resource' so we need to skip this check for all other network devices. Without this patch and RDMA enabled libvirt will not detect any network device that doesn't have the path above which includes 'lo', 'virbr', 'tun', etc. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1639258Reviewed-by: NAndrea Bolognani <abologna@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
If we pass XML to virDomainDefineXML API with these two elements: ... <title></title> <description></description> ... libvirt correctly ignores these two elements and they will not appear in the parsed XML. However, if we use virDomainSetMetadata API and with "" as value for title or description we will end up with the parsed XML that contains these empty elements. Let's fix the behavior of this API to behave the same as virDomainDefineXML. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1518042Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Thomas Huth 提交于
When running virt-host-validate on an s390x host, the tool currently warns that it is "Unknown if this platform has IOMMU support". We can use the common check for entries in /sys/kernel/iommu_groups here, too, but it only makes sense to check it if there are also PCI devices available. It's also common on s390x that there are no PCI devices assigned to the LPAR, and in that case there is no need for the PCI-related IOMMU, so without PCI devices we should simply skip this test. Signed-off-by: NThomas Huth <thuth@redhat.com> Reviewed-by: NBjoern Walk <bwalk@linux.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Eric Blake 提交于
Fix an incorrect @xmlDesc comment, as well as adding more details about which XML element should be root. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Add a new function to make it possible to parse a list of snapshots at once. This is a counterpart to an earlier patch making it possible to produce all snapshots in a single XML string, and intentionally parses the same top-level element <snapshots> with an optional attribute current='name'. Note that since we know we started with no relations at all, and since checking parent relationships per-snapshot is not viable as we don't control which order the snapshots appear in, that we are fine with doing a final pass to update all parent/child relationships among the definitions. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
Pull out the portion of virDomainSnapshotRefinePrep() that deals with definition sanity into a separate helper routine that can be reused with bulk redefine, leaving behind only the code specific to loop checking and in-place updates that are only needed in single-definition handling. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
Right now, the only callers of qemuDomainSnapshotDiscardAllMetadata() are right before freeing the virDomainSnapshotObjList, so it did not matter if the list's metaroot (which points to all the defined root snapshots) is left inconsistent. But an upcoming patch will want to clear all snapshots if a bulk redefine fails partway through, in which case things must be reset. Make this work by teaching the existing virDomainSnapshotUpdateRelations() to be safe regardless of the incoming state of the metaroot (since we don't want to leak that internal detail into qemu code), then fixing the qemu code to use it after deleting all snapshots. Additionally, the qemu code must reset vm->current_snapshot if the current snapshot was removed, regardless of whether the overall removal succeeded or failed later. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
Add a new function to output all of the domain's snapshots in one buffer. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
Split out an internal helper that produces format into a virBuffer, similar to what domain_conf.c does, and making the next patch easier to write. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
virDomainSnapshotDefFormat currently takes two sets of knobs: an 'unsigned int flags' argument that can currently just be VIR_DOMAIN_DEF_FORMAT_SECURE, and an 'int internal' argument used as a bool to determine whether to output an additional element. It then reuses the 'flags' knob to call into virDomainDefFormatInternal(), which takes a different set of flags. In fact, prior to commit 0ecd6851 (1.2.12), the 'flags' argument actually took the public VIR_DOMAIN_XML_SECURE, which was even more confusing. Let's borrow from the style of that earlier commit, by introducing a function for translating from the public flags (VIR_DOMAIN_SNAPSHOT_XML_SECURE was just recently introduced) into a new enum specific to snapshot formatting, and adjust all callers to use snapshot-specific enum values when formatting, and where the formatter now uses a new variable 'domainflags' to make it obvious when we are translating from snapshot flags back to domain flags. We don't even have to use the conversion function for drivers that don't accept the public VIR_DOMAIN_SNAPSHOT_XML_SECURE flag. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
Clean up the previous patch which abused switch on virDomainState while working with a variable containing virDomainSnapshotState, by converting the two affected switch statements to now use the right enum. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
The existing virDomainSnapshotState is a superset of virDomainState, adding one more state (disk-snapshot) on top of valid domain states. But as written, the enum cannot be used for gcc validation that all enum values are covered in a strongly-typed switch condition, because the enum does not explicitly include the values it is adding to. Copy the style used in qemu_blockjob.h of creating new enum names for every inherited value, and update most clients to use the new enum names anywhere snapshot state is referenced. The exception is two switch statements in qemu code, which instead gain a fixme comment about odd type usage (which will be cleaned up in the next patch). The rest of the patch is fairly mechanical (I actually did it by temporarily s/state/xstate/ in snapshot_conf.h to let the compiler find which spots in the code used the field, did the obvious search and replace in those functions, then undid the rename). Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
qemuDomainSnapshotWriteMetadata does not modify the directory name, and making it const-correct aids in writing an upcoming patch. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
The current qemu code rejects the combination of the two flags VIR_DOMAIN_SNAPSHOT_CREATE_LIVE in tandem with VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE, but rather late in the cycle (after the snapshot was already parsed), and with a rather confusing message (complaining that live snapshots require external storage, even if the redefined snapshot already declares external storage). Hoist the rejection message to occur earlier (before parsing any XML, which also aids upcoming patches that will implement bulk redefine), and with a more typical error message about mutually exclusive flags. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-