- 14 3月, 2019 11 次提交
-
-
由 Andrea Bolognani 提交于
LIBVIRT_DRIVER_DIR is defined as (what is for all intents and purposes equivalent to) "$(abs_top_builddir)/src/.libs"; however, as of commit bc6e2063, virDriverLoadModule() will search that directory automatically, which means passing it through the environment is no longer necessary. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Andrea Bolognani 提交于
It's no longer used as of commit a9694a8e. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Eric Blake 提交于
Use VIR_AUTOFREE and saner formatting. No semantic change. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
An upcoming patch wants to reuse XML parsing of both unix and tcp network host descriptions in the context of setting up a backup NBD server. Make that easier by refactoring the existing parser. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
We copy-and-paste a lot of our docs, as evidenced by the number of *GetXMLDesc() functions which had the same unusual indentation and missing capital in the second sentence of the returns paragraph. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Commit 09eb1ae0 added a new enum type for xenbus, and adjusted affected switch statements in the qemu driver, but failed to notice that the vbox driver had a similar switch statement. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Jim Fehlig 提交于
Add support in the domXML<->native config converter for max_grant_frames. Include a test for the conversion. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Jim Fehlig 提交于
Add support for setting max_grant_frames in libxl domain config object and include a test to check that it is properly converted from XML to libxl domain config. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Jim Fehlig 提交于
All Xen domains have a xenbus device. Implicitly add one if not already explicitly specified in the domain config. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Jim Fehlig 提交于
xenbus is virtual controller (akin to virtio controllers) for Xen paravirtual devices. Although all Xen VMs have a xenbus, it has never been modeled in libvirt, or in Xen native VM config format for that matter. Recently there have been requests to support Xen's max_grant_frames setting in libvirt. max_grant_frames is best modeled as an attribute of xenbus. It describes the maximum IO buffer space (or DMA space) available in xenbus for use by connected paravirtual devices. This patch introduces a new xenbus controller type that includes a maxGrantFrames attribute. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Jim Fehlig 提交于
Commit a3ab6d42 changed the libvirtd profile to a named profile, breaking the apparmor driver's ability to detect if the profile is active. When the apparmor driver loads it checks the status of the libvirtd profile using the full binary path, which fails since the profile is now referenced by name. If the apparmor driver is explicitly requested in /etc/libvirt/qemu.conf, then libvirtd fails to load too. Instead of only checking the profile status by full binary path, also check by profile name. The full path check is retained in case users have a customized libvirtd profile with full path. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Acked-by: NJamie Strandboge <jamie@canonical.com>
-
- 13 3月, 2019 20 次提交
-
-
由 Shotaro Gotanda 提交于
This helper performs a conversion from a "yes|no" string to a corresponding boolean. This allows us to drop several repetitive if-then-else string->bool conversion blocks. Signed-off-by: NShotaro Gotanda <g.sho1500@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
This is mostly to avoid a memleak that is not a true memleak anyway - prefixes will be freed by kernel upon test exit. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMartin Kletzander <mkletzan@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
This enables us to simplify the code a bit. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
In theory, it's nice to have virFileWrapperAddPrefix() return a value that indicates if the function succeeded or not. But in practice, nobody checks for that and in fact blindly believes that the function succeeded. Therefore, make the function return nothing and just abort() if it would fail. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMartin Kletzander <mkletzan@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
Luckily, the function returns only 0 or -1 so all the checks work as expected. Anyway, our rule is that a positive value means success so if the function ever returns a positive value these checks will fail. Make them check for a negative value properly. At the same time fix qemuDomainDetachExtensionDevice() reval check. It is somewhat related to the aim of this patch. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
The qemuFirmwareFetchConfigs() function is supposed to fetch all firmware descriptions from paths defined by firmware.json specification. This includes user's $HOME directory. However, it was agreed that if libvirtd is running as privileged user then his $HOME is ignored (thus $HOME is included in the search only for regular users). Well, I got the condition wrong - it should have been reversed. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
由 Andrea Bolognani 提交于
With only a couple minor tweaks, we can make the existing doCapsTest() functions with testQemuCapsIterate() and finally remove the need to manually adjust the test programs every time a new input file is introduced; moreover, this means that the two lists can't possibly get out of sync anymore. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Andrea Bolognani 提交于
This function iterates over a directory containing capabilities-related data, extract some useful bits of information from the file name, and calls a user-provided callback. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Andrea Bolognani 提交于
We're not using any of the functionality offered by the module at the moment, but we will in just a second. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Andrea Bolognani 提交于
This removes the awkard escaping and will allow us to perform some more refactoring later on. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Andrea Bolognani 提交于
We're using static string concatenation at the moment, but that will no longer be a possibility in a bit. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Andrea Bolognani 提交于
This removes a little duplication right away, and will allow us to avoid introducing more later on. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Andrea Bolognani 提交于
This is not particularly useful right now, but will allow us to refactor some functionality later on. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Andrea Bolognani 提交于
These functions don't do anything too interesting right now, but will be extended later on. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Eric Blake 提交于
For snapshots, virsh already has a (shockingly naive [1]) client-side topological sorter with the --tree option. But as a series of REDEFINE calls must be presented in topological order, it's worth letting the server do the work for us, especially since the server can give us a topological sorting with less effort than our naive client reconstruction. [1] The XXX comment in virshSnapshotListCollect() about --tree being O(n^3) is telling; https://en.wikipedia.org/wiki/Topological_sorting is an interesting resource describing Kahn's algorithm and other approaches for O(n) topological sorting for anyone motivated to use a more elegant algorithm than brute force - but that doesn't affect this patch. For now, I am purposefully NOT implementing virsh fallback code to provide a topological sort when the flag was rejected as unsupported; we can worry about that down the road if users actually demonstrate that they use new virsh but old libvirt to even need the fallback. (The code we use for --tree could be repurposed to be such a fallback, whether or not we keep it naive or improve it to be faster - but again, no one should spend time on a fallback without evidence that we need it.) The test driver makes it easy to test: $ virsh -c test:///default ' snapshot-create-as test a snapshot-create-as test c snapshot-create-as test b snapshot-list test snapshot-list test --topological snapshot-list test --descendants a snapshot-list test --descendants a --topological snapshot-list test --tree snapshot-list test --tree --topological ' Without any flags, virsh does client-side sorting alphabetically, and lists 'b' before 'c' (even though 'c' is the parent of 'b'); with the flag, virsh skips sorting, and you can now see that the server handed back data in a correct ordering. As shown here with a simple linear chain, there isn't any other possible ordering, so --tree mode doesn't seem to care whether --topological is used. But it is possible to compose more complicated DAGs with multiple children to a parent (representing reverting back to a snapshot then creating more snapshots along those divergent execution timelines), where it is then possible (but not guaranteed) that adding the --topological flag changes the --tree output (the client-side --tree algorithm breaks ties based on alphabetical sorting between two nodes that share the same parent, while the --topological sort skips the client-side alphabetical sort and ends up exposing the server's internal order for siblings, whether that be historical creation order or dependent on a random hash seed). But even if the results differ, they will still be topologically correct. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Eric Blake 提交于
snapshot_conf does all the hard work, the qemu driver just has to accept the new flag. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Eric Blake 提交于
snapshot_conf does all the hard work, the test driver just has to accept the new flag. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Eric Blake 提交于
Wire up support for VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL in the domain-agnostic support code. Clients of snapshot_conf using virDomainSnapshotForEachDescendant() are using a depth-first visit but with postfix visits of a given node. Changing this to a prefix visit of the given node instantly turns this into a topologically-ordered visit. (A prefix breadth-first visit would also be topologically sorted, but that requires a queue while our recursion naturally has a stack). With that change, we now always have a topological sort for virDomainSnapshotListAllChildren() regardless of the new public API flag. Then with one more tweak, we can also get a topological rather than a faster random hash visit for virDomainListAllSnapshots(), by doing a descendent walk from our internal metaroot (there, we let the public API flag control behavior, because a topological sort DOES require more stack and slightly more time). Note that virDomainSnapshotForEach() still uses a random hash visit; we could change that signature to take a tri-state for random, prefix, or postfix visit if we ever had clients that cared about the distinctions, but for now, none of the drivers seem to care. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Eric Blake 提交于
When using virDomainSnapshotCreateXML with the REDEFINE flag on multiple snapshot metadata XML descriptions, we require that a child cannot be redefined before its parent. Since libvirt already tracks a DAG, it is more convenient if we can ensure that virDomainListAllSnapshots() and friends have a way to return data in an order that we can directly reuse, rather than having to post-process the data ourselves to reconstruct the DAG. Add VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL as our new guarantee (well, a guarantee at the time of the API call conclusion; there's always a possible TOCTTOU race where someone redefining snapshots in between the API results and the client actually using the list might render the list out-of-date). Four listing APIs are directly benefitted by the new flag; additionally, since we document that the older racy ListNames interfaces should be sized by using the same flags on their Num counterparts, the Num interfaces must document when they accept (and ignore) the flag. We could have supported the new flag just for the ListAll APIs (to discourage people from using the older racy Num/ListNames APIs), but it feels weird to special-case this flag value as being applicable to only a subset of the API while all other List-related flags are trivially applicable to all 6. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 12 3月, 2019 9 次提交
-
-
由 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>
-