- 07 6月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
When using an enum in a struct field, the compiler is free to decide to make it an unsigned type if it desires. This in turn leads to bugs when code does if ((def->foo = virDomainFooTypeFromString(str)) < 0) ... because 'def->foo' can't technically have an unsigned value from the compiler's POV. While it is possible to add (int) casts in the code example above, this is not desirable because it is easy to miss out such casts. eg the code fixed here caused an error with clang builds ../../src/conf/domain_conf.c:12838:73: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare] if ((def->version = virDomainTPMVersionTypeFromString(version)) < 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 06 6月, 2018 2 次提交
-
-
由 Stefan Berger 提交于
This patch extends the TPM's device XML with TPM 2.0 support. This only works for the emulator type backend and looks as follows: <tpm model='tpm-tis'> <backend type='emulator' version='2.0'/> </tpm> The swtpm process now has --tpm2 as an additional parameter: system_u:system_r:svirt_t:s0:c597,c632 tss 18477 11.8 0.0 28364 3868 ? Rs 11:13 13:50 /usr/bin/swtpm socket --daemon --ctrl type=unixio,path=/var/run/libvirt/qemu/swtpm/testvm-swtpm.sock,mode=0660 --tpmstate dir=/var/lib/libvirt/swtpm/testvm/tpm2,mode=0640 --log file=/var/log/swtpm/libvirt/qemu/testvm-swtpm.log --tpm2 --pid file=/var/run/libvirt/qemu/swtpm/testvm-swtpm.pid The version of the TPM can be changed and the state of the TPM is preserved. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Stefan Berger 提交于
This patch adds support for an external swtpm TPM emulator. The XML for this type of TPM looks as follows: <tpm model='tpm-tis'> <backend type='emulator'/> </tpm> The XML will currently only define a TPM 1.2. Extend the documentation. Add a test case testing the XML parser and formatter. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 05 6月, 2018 1 次提交
-
-
由 Ján Tomko 提交于
Introduce a function for comparing two vsock definitions. https://bugzilla.redhat.com/show_bug.cgi?id=1291851Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 29 5月, 2018 5 次提交
-
-
由 Ján Tomko 提交于
Add a new 'vsock' element for the vsock device. The 'model' attribute is optional. A <source cid> subelement should be used to specify the guest cid, or <source auto='yes'/> should be used. https://bugzilla.redhat.com/show_bug.cgi?id=1291851Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
An object for storing driver-specific data in the vsock definition. https://bugzilla.redhat.com/show_bug.cgi?id=1291851Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
A type to represent the new vsock device. Also implement an allocation function to allow future addition of private data. https://bugzilla.redhat.com/show_bug.cgi?id=1291851Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
The status XML parser function virDomainObjParseXML could not pass in parseOpaque into the post parse callbacks. Add a callback which will allow hypervisor drivers to fill it from the 'virDomainObj' data. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Ján Tomko 提交于
Further patches will introduce validation and a default setting of def->os.bootDevs in postParse. Introduce a feature flag to opt out of this and set it in the vmx driver, otherwise we would be adding it <boot dev='hd'/> into every vmx config despite having no way to change it. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 25 5月, 2018 1 次提交
-
-
由 John Ferlan 提交于
The VM Generation ID is a mechanism to provide a unique 128-bit, cryptographically random, and integer value identifier known as the GUID (Globally Unique Identifier) to the guest OS. The value is used to help notify the guest operating system when the virtual machine is executed with a different configuration. This patch adds support for a new "genid" XML element similar to the "uuid" element. The "genid" element can have two forms "<genid/>" or "<genid>$GUID</genid>". If the $GUID is not provided, libvirt will generate one and save it in the XML. Since adding support for a generated GUID (or UUID like) value to be displayed modifying the xml2xml test to include virrandommock.so is necessary since it will generate a "known" value. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 23 5月, 2018 2 次提交
-
-
由 Peter Krempa 提交于
It will be used when parsing the migration private data. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Filip Alac 提交于
Introduce support for codec type 'output' ('hda-output' in QEMU) for ich6 and ich9 sound devices, which only advertises a line-out in the guest. This has been available in QEMU since 0.14. Signed-off-by: NFilip Alac <filipalac@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 16 5月, 2018 2 次提交
-
-
由 Peter Krempa 提交于
Extract the lookup code so that it can be reused later. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Maciej Wolny 提交于
Support OpenGL accelerated rendering when using SDL graphics in the domain config. Add associated test and documentation. Signed-off-by: NMaciej Wolny <maciej.wolny@codethink.co.uk> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 14 5月, 2018 1 次提交
-
-
由 Michal Privoznik 提交于
QEMU has possibility to call madvise(.., MADV_REMOVE) in some cases. Expose this feature to users by new element/attribute discard. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 04 5月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
All the code now just uses the virHashTablePtr type directly. Reviewed-by: NJiri Denemark <jdenemar@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 03 5月, 2018 1 次提交
-
-
由 Stefan Berger 提交于
Enable the TPM CRB to be specified in the domain XML. This now allows to describe the TPM device like this: <tpm model='tpm-crb'> <backend type='passthrough'> <device path='/dev/tpm0'/> </backend> </tpm> Extend the XML schema to also allow tpm-crb. Extend the documentation. Add a test case for testing the XML parser and formatter. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 02 5月, 2018 1 次提交
-
-
由 Ján Tomko 提交于
Unused since its introduction in commit <76b644c3>. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 18 4月, 2018 3 次提交
-
-
由 Peter Krempa 提交于
Currently it is not used in backing chains and does not seem that we will need to use it so return it back to the disk definition. Thankfully most accesses are done via the accessors. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Peter Krempa 提交于
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Clementine Hayat 提交于
Add a function named virDomainObjCheckIsActive in src/conf/domain_conf.c. It calls virDomainObjIsActive, raises error if necessary and returns. There is a lot of occurence of this pattern and it will save 3 lines on each call. Signed-off-by: NClementine Hayat <clem@lse.epita.fr> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 12 4月, 2018 1 次提交
-
-
由 Michal Privoznik 提交于
In 2ada9ef1 we've tried to turn virDomainChrSourceDef into virObject. Well, this requires 'virObject' member to be stored on the first position of the struct. This adjustment is missing in the original commit leading to all sorts of funny memleaks and data corruptions. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
-
- 10 4月, 2018 1 次提交
-
-
由 John Ferlan 提交于
Rather than VIR_ALLOC, use the New function for allocation. We already use the Free function anyway. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org> Reviewed-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
-
- 06 4月, 2018 1 次提交
-
-
由 Andrea Bolognani 提交于
The new controller will not yet be used automatically by libvirt, but at this point it's already possible to configure a guest to use it. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 03 4月, 2018 2 次提交
-
-
由 Peter Krempa 提交于
For some reason we've decided to silently translate the disk detect_zeroes mode if it would be invalid. Extract the logic so that it does not need to be copypasta'd across the code base. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Peter Krempa 提交于
Make the function more usable by returning the full disk definition and fix the only caller for the new semantics. The new name for the function is virDomainDiskDefParse. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
- 14 3月, 2018 1 次提交
-
-
由 Peter Krempa 提交于
Move out formatting of 'startuPolicy' which is a property of the disk out of the <source> element. Extracting the code formating the content and attributes will also allow reuse in other parts of the code. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
- 13 3月, 2018 1 次提交
-
-
由 Ján Tomko 提交于
To match the rest of the file. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 07 3月, 2018 1 次提交
-
-
由 Ján Tomko 提交于
If the user tries to define a domain that has <controller type='usb' model='none'/> and also some USB devices, we report an error: error: internal error: No free USB ports Which is technically still correct for a domain with no USB ports. Change it to: USB is disabled for this domain, but USB devices are present in the domain XML https://bugzilla.redhat.com/show_bug.cgi?id=1347550Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 06 3月, 2018 1 次提交
-
-
由 Andrea Bolognani 提交于
Pretty much any reasonable compiler would do this automatically, but there's no harm in being explicit about it. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org>
-
- 23 2月, 2018 1 次提交
-
-
由 Jiri Denemark 提交于
When calling virDomainDefCompatibleDevice to check a new device during device update, we need to pass the original device which is going to be updated in addition to the new device. Otherwise, the function can report false conflicts. The new argument is currently ignored by virDomainDefCompatibleDevice, but this will change in the following patch. https://bugzilla.redhat.com/show_bug.cgi?id=1546971Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 20 2月, 2018 2 次提交
-
-
由 Daniel P. Berrangé 提交于
The controller model is slightly unusual in that the default value is -1, not 0. As a result the default value is not covered by any of the existing enum cases. This in turn means that any switch() statements that think they have covered all cases, will in fact not match the default value at all. In the qemuDomainDeviceCalculatePCIConnectFlags() method this has caused a serious mistake where we fallthrough from the SCSI controller case, to the VirtioSerial controller case, and from the USB controller case to the IDE controller case. By adding explicit enum constant starting at -1, we can ensure switches remember to handle the default case. Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Laine Stump 提交于
Commit 7e62c4cd (first appearing in libvirt-3.9.0 as a resolution to rhbz #1343919) added a "generated" attribute to virMacAddr that was set whenever a mac address was auto-generated by libvirt. This knowledge was used in a single place - when trying to match a NetDef from the Domain to Delete with user-provided XML. Since the XML parser always auto-generates a MAC address for NetDefs when none is provided, it was previously impossible to make a search where the MAC address isn't significant, but the addition of the "generated" attribute made it possible for the search function to ignore auto-generated MACs. This implementation had a problem though - it was adding a field to a "low level" struct - virMacAddr - which is used in other places with the assumption that it contains exactly a 6 byte MAC address and nothing else. In particular, virNWFilterSnoopEthHdr uses virMacAddr as part of the definition of an ethernet packet header, whose layout must of course match an actual ethernet packet. Adding the extra bools into virNWFilterSnoopEthHdr caused the nwfilter driver's "IP discovery via DHCP packet snooping" functionality to mysteriously stop working. In order to fix that behavior, and prevent potential future similar odd behavior, this patch moves the "generated" member out of virMacAddr (so that it is again really is just a MAC address) into virDomainNetDef, and sets it only when virDomainNetGenerateMAC() is called from virDomainNetDefParseXML() (which is the only time we care about it). Resolves: https://bugzilla.redhat.com/1529338 (It should also be applied to any maintenance branch that applies commit 7e62c4cd and friends to resolve https://bugzilla.redhat.com/1343919) Signed-off-by: NLaine Stump <laine@laine.org>
-
- 19 2月, 2018 2 次提交
-
-
由 Daniel P. Berrangé 提交于
Rather than expecting callers to pass a virConnectPtr into the virDomainDiskTranslateSourcePool() method, just acquire a connection to the storage driver when needed. Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Now that we have the ability to easily open connections to secondary drivers, eg network:///system, it is possible to reimplement the virDomainNetResolveActualType method in terms of the public API. This avoids the need to have the network driver provide a callback for it. Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 13 2月, 2018 2 次提交
-
-
由 Andrea Bolognani 提交于
Instead of storing separately whether the feature is enabled or not and what resizing policy should be used, store both of them in a single place. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Andrea Bolognani 提交于
Instead of storing separately whether the feature is enabled or not and what driver should be used, store both of them in a single place. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 09 2月, 2018 3 次提交
-
-
由 Daniel P. Berrangé 提交于
The virStorageTranslateDiskSourcePool method modifies a virDomainDiskDef to resolve any storage pool reference. For some reason this was added into the storage driver code, despite working entirely in terms of the public APIs. Move it into the domain conf file and rename it to match the object it modifies. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Currently the QEMU driver will call directly into the network driver impl to modify resolve the atual type of NICs with type=network. It has todo this before it has allocated the actual NIC. This introduces a callback system to allow us to decouple the QEMU driver from the network driver. This is a short term step, as it ought to be possible to achieve the same end goal by simply querying XML via the public network API. The QEMU code in question though, has no virConnectPtr conveniently available at this time. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Currently the QEMU driver will call directly into the network driver impl to modify network device bandwidth for interfaces with type=network. This introduces a callback system to allow us to decouple the QEMU driver from the network driver. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-