Commit Graph

45419 Commits

Author SHA1 Message Date
Peter Krempa
2d345da361 tests: qemucapabilities: Update qemu caps dump for the qemu-7.0.0 release on x86_64
Few minor changes in qemu since the last update:
    - 'cocoa' display and corresponding props (not present in this build)

Changes in build:
    - dbus display driver re-enabled
    - gtk display support re-disabled
    - xen support re-disabled

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-26 09:23:52 +02:00
Peter Krempa
3974911773 virHostCPUGetCPUIDFilterVolatile: Filter out topology data on AMD
AMD cpus report Core (compute unit) identifiers of the cpu running the
instruction under leaf 0x8000001e. This data is not needed for libvirt
and actually breaks caching of the qemu capabilities where we check that
all of the CPU flags to be identical.

Mask out all of leaf 0x8000001e.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:38:01 +02:00
Peter Krempa
d946aa27c2 virHostCPUGetCPUID: Limit the buffer size ranges
Raise the lower bound to '64' as that seems to currently be the first
size that can fit the CPU data for a modern cpu.

Lower the upper bound to an arbitrary 65536. So many cpu features ougth
to be enough for everyone.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:38:01 +02:00
Peter Krempa
fe91f0999c virHostCPUGetCPUID: Fix possible allocation of huge amount of memory
In case when the 'KVM_GET_SUPPORTED_CPUID' ioctl on /dev/kvm would
fail for other reason than the documented E2BIG, our code would continue
looping and calling it while always increasing the memory buffer even
when that will not help.

Rewrite the function to allow another iteration only with the correct
errno.

Additionally rename the 'i' variable to 'alloc_size' as it's not a pure
iterator.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:38:01 +02:00
Peter Krempa
231a6db96d util: virhostcpu: Extract filtering of the returned data from virHostCPUGetCPUID
Move the filtering code into virHostCPUGetCPUIDFilterVolatile.

This also removes a safe but very questionable reuse of 'i' iterator in
the both the top level and nested loop. It's safe for now as the to
level loop will not iterate any more in the current state.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:38:01 +02:00
Peter Krempa
25327c9d69 virHostCPUGetCPUID: Add comment on how KVM_GET_SUPPORTED_CPUID works
The commit adding the code fetching host CPU flags via the
KVM_GET_SUPPORTED_CPUID didn't describe at all why such an alghorithm is
needed.

Add a comment from the documentation outlining how the userspace
function is expected to allocate memory here.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:38:01 +02:00
Peter Krempa
fe027c9b0a virCPUx86DataGetHost: Fix construction of the returned data
The function returns 'virCPUData' but doesn't do two important steps
which other code takes:

1) leaves with all-zero data is stripped from the XML output
2) the data is expected to be sorted in the array

Now the 'virHostCPUGetCPUID' helper returns both all 0 leaves and
doesn't order them as we expect.

If this is then used in conjunction with 'virCPUx86DataIsIdentical'
together with data which made a roundtrip to XML and back the result
will be always false even if the data itself is identical.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:38:01 +02:00
Peter Krempa
210a195394 virCPUx86DataIsIdentical: Add debug output
Without this it's impossible to debug scenarios when this function
returns a mismatch but the formatted data looks identical.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:38:01 +02:00
Peter Krempa
9223ebbc85 virsh: cmdBlockcopy: Fix generator of block copy disk XML
In a recent commit I've attempted to rewrite the XML generator to use
virXMLFormatElement instead of manual steps. Unfortunately the commit
had multiple problems resulting in a garbled XML:

1) in certain cases the wrong buffer was used resulting in misplaced
   snippets
2) the child element buffer was improperly set up so sub-elements were
   not indented

This resulted in following XML being generated:

 $ virsh blockcopy cd vda /tmp/test.copy --raw --print-xml
 type='file''/tmp/test.copy'/>
 <driver type='raw'/>
 <disk>
 <source file=</disk>

To fix this we'll generate the '<source>' element in one go and use the
proper buffer for it and other places.

Fixes: 1cd95f858a
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2078274
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:37:05 +02:00
Peter Krempa
69ee066523 virsh: cmdBlockcopy: Add '--print-xml' flag
Useful for knowing how to construct the XML and debugging.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:37:05 +02:00
Peter Krempa
f0c3398bc4 tests: qemuxml2*: Add testing of authenticated http/ftp disks
Extend the 'disk-cdrom-network' to cover this instance. This also
validates that the parameters of -blockdev conform to the QAPI schema.

Also add the xml2xml variant of this test case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-25 16:34:59 +02:00
Peter Krempa
ddf5673e4e conf: schema: Allow authentication for FTP(S) and HTTP(S) disks
The code already handles this so we just need to allow it in the schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-25 16:34:59 +02:00
Peter Krempa
22eec2ae0e conf: schemas: Split out definition for 'ftp' protocol
Separate it so that further addition can target 'ftp' only.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-25 16:34:59 +02:00
Peter Krempa
ad957d92a6 qemu: domain: Inline qemuDomainStorageSourceHasAuth
The iSCSI hostdev code doesn't require the check for the empty drive
and the check for the protocol because those are already guaranteed at
that point.

In qemuDomainSecretStorageSourcePrepare we don't need to check the
network disk type either as it's now guaranteed by the definition
validator.

Thus both callers can simply check whether src->auth is present and the
helper can be removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-25 16:34:59 +02:00
Peter Krempa
3172b0ed3f qemu: domain: Inline qemuDomainDiskHasEncryptionSecret
Since we are already checking that the encryption format can be only
_LUKS and _LUKS2 this wrapper function doesn't make much sense any more.

The only one caller can do this internally.

The move of virStorageSourceIsEmpty is correct as there are no secrets
to setup if the disk is empty anyways.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-25 16:34:59 +02:00
Peter Krempa
6fe2ca9ac1 qemuDomainStorageSourceHasAuth: Don't decide based on protocol
The validation should be the only point to decide whether authentication
is supported for a disk backing protocol. The rest of the code can then
simply always enable it.

This also fixes a crash when authentication is requested e.g. for a HTTP
backed disk as the blockdev props formatter expects that it was already
set up.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-25 16:34:59 +02:00
Peter Krempa
4c6498d48a virDomainDiskDefValidateSourceChainOne: Reject authentication for protocols which don't support it
Only certain disk protocols support authentication. Add validation for
this field.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-25 16:34:59 +02:00
Peter Krempa
b1f5f14a5c qemuBlockStorageSourceGetRBDProps: Simplify handling of encryption format
Remove the impossible error message about the 'qcow2' encryption format
not being supported. We validated before that it can't happen.

Additionally the code can be simplified by removing error handling from
impossible code paths as the last resort is virJSONValueCreate not
allowing NULL argument with the 's:' modifier.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-25 16:34:59 +02:00
Peter Krempa
487f15b26a qemuDomainValidateStorageSource: Add validation of 'encryption' support
Reject encryption requests for unsupported image format types.

Add negative test for the rejected cases as well as modify
'disk-network-rbd-encryption' case to validate that with librbd
encryption the format doesn't matter.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-25 16:34:59 +02:00
Peter Krempa
7c9459b88b qemuDomainValidateStorageSource: Reorganize encryption config validation
Move the two ad-hoc checks below into the block which already tests
whether encryption is requested.

If we first disallow the old-style qcow2 encryption we can remove a
whole block of validation later on.

Also the capability check for qcow2+luks can be simplified by moving it
into the same block.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-25 16:34:59 +02:00
Peter Krempa
a2b85fcc48 conf: schema: Fix alignment in 'diskSourceNetworkProtocolHTTPS' schema definition
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-25 16:34:59 +02:00
Peter Krempa
3fdedbe6c6 docs: formatdomain: Remove old unreferenced HTML anchors
Most of the anchors that were forward ported to formatdomain.rst when it
was converted are not actually referenced by our documentation. Since
it's now quite some time after the conversion was done we can remove
them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
13608488f8 docs: bugs: Remove raw HTML anchor 'quality'
Modify the gitlab templates linking to it and remove the raw HTML.

Note that also the default template needs to be changed directly in
gitlab.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
f843cdab7f docs: contact: Remove HTML anchors and adjust documents using them
Modify the name of the 'IRC discussion' paragraph to just 'IRC' so that
the links keep working and remove the raw HTML anchors.

Adjustment is needed for documents which were using the '#email' anchor
which has now become '#mailing-lists'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
fb2ebfd927 docs: governance: Remove unused HTML anchors
The 'codeofconduct' anchor is unused as of 523f2de82e .

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
d30be2cf25 docs: uri: Rewrite section about transport protocols and extra parameters
Avoid the table and add a brief description of the transport protocol.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
e40645c105 docs: uri: Move the 'test' hypervisor under a 'local hypervisors heading
Add a new heading 'Local hypervisor URIs' and move the sections about
'qemu', 'xen' and 'test' under it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
339a2e7d65 docs: uri: Consolidate paragraphs on Xen URIs
Mention the legacy 'xen' string usage under the Xen hypervisor uri
section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
a18324f7e8 docs: uri: Remove old 'NULL URI' section
We now have an paragraph about default URI choice if the passed pointer
is NULL. Add the two related bits from the 'NULL and empty string URIs'
from the legacy section to the current one and remove the old stuff.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
ab301453bc docs: Convert 'uri' page to rst
Adjust links in the process.

Note that the conversion to the table is temporary and upcoming patch
will modify it for better readability.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
51ed2a01d7 docs: remote: Remove 'Limitations' paragraph
The paragraph talks about lack of fine grained access control which was
already added a long time ago.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
eefe52b8f0 docs: Convert 'remote' page to rst
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Pavel Hrdina
52b1f222df docs: Convert 'storage' page to rst
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Pavel Hrdina
6479917212 docs: storage: rename headers to remove duplicate names
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
fb4d109648 Correct links to TLS certificate setup page
When the setup of TLS certs was originally split out of
'docs/remote.html' ( df99aa311a ) links refering to it were not
fixed.

Adjust them to point to the correct document.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Peter Krempa
aa2b8e3b0b docs: formatsecret: Correct link to storage volume XML definition
The anchor name was not fixed when the 'formatstorage' document was
converted to rst.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-25 16:33:01 +02:00
Andrea Bolognani
de0a50833f include: Fix vertical spacing between comments and symbols
There should be no empty lines between a docstring comment and
the symbol it documents.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-22 15:04:07 +02:00
Andrea Bolognani
db56fa77e9 include: Fix vertical spacing inside comments
There should be no empty lines between the Since tag in a
docstring comment and the end marker.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-22 15:04:04 +02:00
Victor Toso
02411a4597 docstring: Fix generated documentation of virStorageVolInfoFlags
The API xml description file generator doesn't properly handle cases
when there's either a single comment or mixed use of pre- and post-
comments explaining the values.

Modify the comments to avoid the problem and also append version
information for the exposed values.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-22 10:04:18 +02:00
Victor Toso
4b120e51f1 docstring: libvirt-common: Add 'Since version' metadata
Similarly to previous commits but with the targeting libvirt-common
in a batch.

Either create or append to existing docstring, the version (git tag)
that a given typedef, enum value, macro or function was introduced
in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-22 10:03:50 +02:00
Victor Toso
36dbddec24 docstring: function: lxc: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given function was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-22 10:02:55 +02:00
Victor Toso
5e6a75ae1c docstring: function: qemu: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given function was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-22 10:02:22 +02:00
Victor Toso
d0c2a7c1db docstring: typedef: qemu:: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given typedef was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-22 10:00:57 +02:00
Victor Toso
034432e47b docstring: typedef: libvirt:: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given typedef was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-22 10:00:34 +02:00
Victor Toso
7a1dbde50e docstring: macros: libvirt: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given macro was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-22 09:52:05 +02:00
Victor Toso
c061b628eb docstring: enums: qemu: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given enum value was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-22 09:45:09 +02:00
Victor Toso
89f35b1214 docstring: variable: Move docstring from source to header file
virConnectAuthPtrDefault is the only variable that we export and
with the documentation being at the C file, it makes harder to find
it.

With this patch, the documentation of this variable can be found by
those who look at the header file for guidance plus, it will also be
included in the XML API, as the followup patch will fix apibuild.py
to store what is documented in the header file for this variable.

Note that the apibuild, does not do the same with .c files. It'd
require adding it for (parsing) recursion, similar to what is done
for functions.  Considering the pros/cons, seems more reasonable to
move the docstring to the header file instead.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-22 09:45:00 +02:00
Victor Toso
c08dad9ae2 docstring: Fix generated documentation of virConnectListAllNodeDeviceFlags
scripts/apibuild.py does not handle well enum's with comments
between values.  The outcome depends on whether the enum value has
its own docstring or not and if there is spaces between the enum
values or not.

Either way, virConnectListAllNodeDeviceFlags documentation is
explicit that this enum is about filtering node devices. We can move
the information that it is either by "capability" or "active" state
to the block of comment above.

Using git diff --word-diff to show the fixed ouput xml (redacted).

  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_ACTIVE' ... [-info='Inactive-]{+info='Active+} devices'/>
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD' ... [-info='vDPA-]{+info='s390 AP Card+} device'/>
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX' ... [-Queue'/>-]{+Matrix'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE' ... [-Card device'/>-]{+Queue'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV' ... [-info='Mediated-]{+info='CCW+} device'/>
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV' ... [-info='CCW-]{+info='CSS+} device'/>
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM' ... [-info='Capable of scsi_generic'/>-]{+info='DRM device'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST' ... [-info='Storage device'/>-]{+info='FC Host Bus Adapter'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV' ... [-info='Capable of mediated devices'/>-]{+info='Mediated device'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES' ... [-info='DRM device'/>-]{+info='Capable of mediated devices'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET' ... [-info='USB interface'/>-]{+info='Network device'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV' ... [-info='System capability'/>-]{+info='PCI device'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI' ... [-Target'/>-]{+device'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC' ... [-vport'/>-]{+scsi_generic'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST' ... [-info='Network device'/>-]{+info='SCSI Host Bus Adapter'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET' ... [-Host Bus Adapter'/>-]{+Target'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE' ... [-info='SCSI-]{+info='Storage+} device'/>
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM' ... [-info='filter the devices by cap type'/>-]{+info='System capability'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV' ... [-info='PCI-]{+info='USB+} device'/>
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE' ... [-device'/>-]{+interface'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA' ... [-info='CSS-]{+info='vDPA+} device'/>
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPD' ... [-info='s390 AP Matrix'/>-]{+info='Device with VPD'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS' ... [-info='FC Host Bus Adapter'/>-]{+info='Capable of vport'/>+}
  <enum name='VIR_CONNECT_LIST_NODE_DEVICES_INACTIVE' ... [-info='Device with VPD filter the devices by active state'/>-]{+info='Inactive devices'/>+}

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-04-21 19:02:08 +02:00
Maxim Nestratov
ea42cc69cc qemu: disarm fake reboot flag on reset
This is a quite an old (created at 2016) patch fixing an issue for at
that time contemporary Fedora 23. virsh reboot returns success (yet
after hanging for a while), VM is rebooted sucessfully too but then
shutdown from inside guest causes reboot and not shutdown.

VM has agent installed. So virsh reboot first tries to reboot VM thru
the agent. The agent calls 'shutdown -r' command. Typically it returns
instantly but on this distro for some reason it takes time. I did not
investigate the cause but the command waits in dbus client code,
probably waits for reply. The libvirt waits 60s for agent command to
execute and then errors out. Next reboot API falls back to ACPI shutdown
which returns successfully thus the reboot command return success too.

Yet shutdown command in guest eventually successfull and guest is truly
rebooted. So libvirt does not receive SHUTDOWN event and fake reboot
flag which is armed on fallback path stays armed. Thus next shutdown
from guest leads to reboot.

The issue has 100% repro on Fedora 23. On modern distros I can't
reproduce it at all. Shutdown command is asynchronous and returns
immediately even if I start some service that ignores TERM signal and
thus shutdown procedure waits for 90s (if I not mistaken) before sending
KILL.

Yet I guess it is nice to have this patch to be more robust.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Nikolay Shirokovskiy <nikolay.shirokovskiy@openvz.org>
2022-04-21 16:25:29 +01:00
Justin Gatzen
04736179b2 qemu: Check usage count of qemu:override node
When <qemu:override> is the only usage of the qemu namespace the entire
section is mistakenly removed. Add check for use count.

Signed-off-by: Justin Gatzen <justin.gatzen@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-04-21 11:09:54 +02:00