]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
13 months agovirt-admin: Annodate 'unwanted_positional' arguments
Peter Krempa [Thu, 14 Mar 2024 16:17:19 +0000 (17:17 +0100)]
virt-admin: Annodate 'unwanted_positional' arguments

Historically the command parser in virsh parses/fills even optional
arguments with values as if they were positional unless opted out using
VSH_OFLAG_REQ_OPT. This creates unexpected situations when commands can
break in this unwanted semantics:

 $ virsh snapshot-create-as --print-xml 1 2 3
 <domainsnapshot>
   <name>2</name>
   <description>3</description>
 </domainsnapshot>

To prevent any further addition annotate the rest of the arguments with
the 'unwanted_positional' flag, so that the parser can keep parsing them
as such but any further optional argument will not have this behaviour.

Certain arguments where it makes sense are annotated as 'positional' too
in this patch.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Annodate 'unwanted_positional' arguments
Peter Krempa [Thu, 14 Mar 2024 16:17:19 +0000 (17:17 +0100)]
virsh: Annodate 'unwanted_positional' arguments

Historically the command parser in virsh parses/fills even optional
arguments with values as if they were positional unless opted out using
VSH_OFLAG_REQ_OPT. This creates unexpected situations when commands can
break in this unwanted semantics:

 $ virsh snapshot-create-as --print-xml 1 2 3
 <domainsnapshot>
   <name>2</name>
   <description>3</description>
 </domainsnapshot>

To prevent any further addition annotate the rest of the arguments with
the 'unwanted_positional' flag, so that the parser can keep parsing them
as such but any further optional argument will not have this behaviour.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Annotate "unwanted_positional" arguments for 'pool-(define|create)-as' commands
Peter Krempa [Wed, 13 Mar 2024 21:54:05 +0000 (22:54 +0100)]
virsh: Annotate "unwanted_positional" arguments for 'pool-(define|create)-as' commands

Annotate arguments which can be unintentionally parsed positionally.
(See previous commits for explanation.)

All of these options were added in order thus we must declare all of
them as 'unwanted_positional'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: volume: Mark optional 'pool' argument as 'positional'
Peter Krempa [Thu, 14 Mar 2024 14:34:03 +0000 (15:34 +0100)]
virsh: volume: Mark optional 'pool' argument as 'positional'

Annotate arguments which can be unintentionally parsed positionally.
(See previous commits for explanation.)

The pool name is optional but in all cases it can be promoted to an
optional positional argument so that it can be properly aligned with the
expectations of the parser.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Annotate some optional arguments as positional
Peter Krempa [Thu, 14 Mar 2024 16:13:05 +0000 (17:13 +0100)]
virsh: Annotate some optional arguments as positional

Make certain optional arguments truly positional in cases when it makes
semantic sense.

Previously it wasn't possible to have optional positional arguments, but
the parser filled them regardless, thus this preserves functionality.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh-backup: Fix argument annotations of 'backup-begin' command
Peter Krempa [Thu, 14 Mar 2024 17:05:07 +0000 (18:05 +0100)]
virsh-backup: Fix argument annotations of 'backup-begin' command

Mark the 'backupxml' as positional optional and the 'checkpointxml' as
'unwanted_positional' to preserve the positional parsing quirk.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Make '(snapshot|checkpoint)-create' 'xmlfile' argument positional
Peter Krempa [Thu, 14 Mar 2024 16:25:02 +0000 (17:25 +0100)]
virsh: Make '(snapshot|checkpoint)-create' 'xmlfile' argument positional

The argument is optional thus couldn't be marked as positional until now,
despite being parsed positionally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: snapshot: Make 'snapshotname' argument positional
Peter Krempa [Wed, 13 Mar 2024 22:01:18 +0000 (23:01 +0100)]
virsh: snapshot: Make 'snapshotname' argument positional

The 'snapshotname' argument is optional as by default "current" snapshot
is considered. Regardless of that we should treat it as positional as
it's the common usage. This is now possible as we can have one optional
positional argument.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovsh: Make the only argument of 'connect', 'cd', and 'help' commands positional
Peter Krempa [Thu, 14 Mar 2024 15:58:40 +0000 (16:58 +0100)]
vsh: Make the only argument of 'connect', 'cd', and 'help' commands positional

The intended use of those commands is to use the argument directly
without the flag. Since the argument is optional in all cases we
couldn't declare them as positional until now.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovsh: Allow one optional positional argument
Peter Krempa [Thu, 14 Mar 2024 15:21:58 +0000 (16:21 +0100)]
vsh: Allow one optional positional argument

We already allow a optional positional _ARGV argument but there's no
reason why any other argument type could not be allowed this way.

Add checks that there's just one such argument and it's placed after
required positional arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh-checkpoint: Make 'checkpointname' positional and required
Peter Krempa [Thu, 14 Mar 2024 15:56:16 +0000 (16:56 +0100)]
virsh-checkpoint: Make 'checkpointname' positional and required

The argument was being parsed positionally due to the command parser
quirk as we didn't opt out of it.

Since the code in virshLookupCheckpoint requires that the checkpointname
is present we can mark all the options as positional and required and
remove the redundant check from virshLookupCheckpoint.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Require option flags for all optional arguments of 'attach-disk'
Peter Krempa [Wed, 13 Mar 2024 21:57:04 +0000 (22:57 +0100)]
virsh: Require option flags for all optional arguments of 'attach-disk'

Annotate arguments which can be unintentionally parsed positionally.
(See previous commits for explanation.)

Currently virsh accepts the arguments such as:

 $ virsh attach-disk --print-xml 1 2 3 4 5 6 7 8 9 10
 <disk type='file' device='10'>
   <driver name='5' type='6' iothread='7' cache='8' io='9'/>
   <source file='2'/>
   <target dev='3' bus='4'/>
 </disk>

While making virsh require the flags is technically a breaking change,
there were multiple instances where arguments were added to the argument
list thus changing the order the positional arguments would be
interpreted as. Examples are commits: 7e157858b4bbc5a8090afa,
ca21d75d25. As of such there are multiple breaks of compatibility for
the positional arguments.

As of such, require the option flag for all optional arguments with
value for 'virsh attach-disk'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Fix "positional" argument annotations for 'migrate' command
Peter Krempa [Wed, 13 Mar 2024 21:52:12 +0000 (22:52 +0100)]
virsh: Fix "positional" argument annotations for 'migrate' command

Annotate arguments which can be unintentionally parsed positionally.
(See previous commits for explanation.)

Annotate '--migrateuri', '--graphicsuri', '--listen-address', '-dname',
'--timeout', '--xml', '--migrate-disks' and '--disks port' as
'unwanted_positional'. These were declared in chronological order per
git history.

All others are annotated with VSH_OFLAG_REQ_OPT which makes the parser
require the '--optionname'. This is due to the fact that '--disks-uri'
was introduced later and put in front of others declared earlier
breaking the order they would be accepted, thus changing the behaviour
between versions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Require option flags for 'blkdeviotune' arguments
Peter Krempa [Wed, 13 Mar 2024 21:50:02 +0000 (22:50 +0100)]
virsh: Require option flags for 'blkdeviotune' arguments

Make all of the tunable parameter flags require the option name (don't
parse them positionally).

While techically this would be a breaking change if anyone were to
specify the tunable values positionally this is not the case as the
first two tunables are not compatible with each other:

  $ virsh blkdeviotune cd vda 4 5
  error: Unable to change block I/O throttle
  error: invalid argument: total and read/write of bytes_sec cannot be set at the same time

The above is produced by all implementations of the API (qemu and test
drivers). It is true that the first tunable can be specified
positionally (--total-bytes-sec) but it is misleading and shoud not be
allowed either.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovsh: Fix option formatting for 'VHS_OT_ARGV' options
Peter Krempa [Wed, 13 Mar 2024 15:58:52 +0000 (16:58 +0100)]
vsh: Fix option formatting for 'VHS_OT_ARGV' options

While previous fixes kept the help output unchanged as base for the
refactors it turns out that the formatting of help for argv options is
wrong.

Specifically in SYNOPSIS the non-positional _ARGV would have the option
name in square brackets (which in other cases means that given thing is
optional) despite being required.

Similarly in the DESCRIPTION section positional versions would not show
the optional argument name and also didn't use the three dots to signal
that it can be used multiple times.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Annotate rest of _ARGV arguments as positional
Peter Krempa [Wed, 13 Mar 2024 21:45:04 +0000 (22:45 +0100)]
virsh: Annotate rest of _ARGV arguments as positional

In most cases it's the usual/recommended way to use those commands:

 $ virsh qemu-monitor-command VMNAME cmd args args args

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Annotate '--diskspec' _ARGV options as unwanted positional
Peter Krempa [Wed, 13 Mar 2024 21:44:44 +0000 (22:44 +0100)]
virsh: Annotate '--diskspec' _ARGV options as unwanted positional

Our documentation in most places explicitly mentions --diskspec and it
was never meant to be positional, although we can't change the parser
any more. Annotate them as 'unwanted_positional'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovsh: Introduce annotation for vsh options which are unexpectedly parsed positionally
Peter Krempa [Wed, 13 Mar 2024 21:31:20 +0000 (22:31 +0100)]
vsh: Introduce annotation for vsh options which are unexpectedly parsed positionally

Based on the rationale in previous commit, all commands which were
parsed as positional but not documented as such will be annotated with
this flag.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovsh: Introduce tool to find unwanted positional arguments to 'self-test'
Peter Krempa [Wed, 13 Mar 2024 20:13:44 +0000 (21:13 +0100)]
vsh: Introduce tool to find unwanted positional arguments to 'self-test'

While the virsh option definitions specify (either explicitly after
recent refactors, or implicitly before) whether an argument is
positional or not, the actual parser is way more lax and actually and
allows also arguments which were considered/documented as non-positional
to be filled positionally unless VSH_OFLAG_REQ_OPT is used in the flags.

This creates situations such as 'snapshot-create-as' which has the
following docs:

SYNOPSIS
  snapshot-create-as <domain> [--name <string>] [--description <string>]
    [--print-xml] [--no-metadata] [--halt] [--disk-only]
    [--reuse-external] [--quiesce] [--atomic] [--live] [--validate]
    [--memspec <string>] [[--diskspec] <string>]...

Thus showing as if '--name' and '--description' required the option, but
in fact the following happens when only positionals are passed:

  $ virsh snapshot-create-as --print-xml 1 2 3 4 5
  <domainsnapshot>
    <name>2</name>
    <description>3</description>
    <disks>
      <disk name='4'/>
      <disk name='5'/>
    </disks>
  </domainsnapshot>

In the above example e.g. '--memspec' is not populated.

This disconnect makes it impossible to refactor the parser itself and
allows users to write buggy interactions with virsh.

In order to address this we'll be annotating every single of these
unwanted positional options as such so that this doesn't happen in the
future, while still preserving the quirk in the parser.

This patch introduces a tool which outputs list of options which are not
marked as positional but are lacking the VSH_OFLAG_REQ_OPT flag.

This tool will be removed once all the offenders found by it will be
addressed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Inline VIRSH_COMMON_OPT_NETWORK_OT_STRING macro
Peter Krempa [Thu, 14 Mar 2024 21:22:08 +0000 (22:22 +0100)]
virsh: Inline VIRSH_COMMON_OPT_NETWORK_OT_STRING macro

The macro is used in just one place and the definition of the option is
going to be modified. Inline the macro.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Inline VIRSH_COMMON_OPT_FILE_FULL macro
Peter Krempa [Thu, 14 Mar 2024 21:14:31 +0000 (22:14 +0100)]
virsh: Inline VIRSH_COMMON_OPT_FILE_FULL macro

The macro is used in one place only and the command definition will be
altered. Inline it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirsh: Inline VIRSH_COMMON_OPT_DOMAIN_OT_STRING macro
Peter Krempa [Thu, 14 Mar 2024 21:09:06 +0000 (22:09 +0100)]
virsh: Inline VIRSH_COMMON_OPT_DOMAIN_OT_STRING macro

Upcoming patches will need to tweak some of the properties of the
command. Since the macro is used in just two places expand it inline.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovshCmddefCheckInternals: Improve some checks
Peter Krempa [Thu, 14 Mar 2024 09:31:17 +0000 (10:31 +0100)]
vshCmddefCheckInternals: Improve some checks

 - move the check that completer_flags are 0 if no completer is set
   into a common place and remove duplication
 - add check that _BOOL arguments are not positional
 - add missing checks to _ALIAS

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovshCmddefHelp: Drop empty line at the end
Peter Krempa [Wed, 13 Mar 2024 14:54:47 +0000 (15:54 +0100)]
vshCmddefHelp: Drop empty line at the end

All virsh commands in non-quiet mode append another separator line thus
having two is unnecessary and in quiet mode it still has a trailing
blank line. Remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agoqemu_snapshot: correctly update metadata when deleting external snapshot with multipl...
Pavel Hrdina [Wed, 21 Feb 2024 16:45:50 +0000 (17:45 +0100)]
qemu_snapshot: correctly update metadata when deleting external snapshot with multiple branches

XML metadata for snapshot contains only single list of disk overlays
from the moment when the snapshot was taken. When user creates multiple
branches of snapshots the parent snapshot will still list only the
original disk overlays. This may cause an issue in a specific scenario:

     s1
      |
      +- s2
      +- s3 (active)

For this snapshot topology when we delete s2 metadata for s1 are not
updated. Now when we delete s1 the code operated with incorrect
overlays from s1 metadata in order to update s3 metadata resulting in no
changes to s3 metadata.

Now when user tries to delete s3 it fails with following error:

    error: Failed to delete snapshot s3
    error: operation failed: snapshot VM disk source and parent disk source are not the same

For the actual deletion there is a code to figure out the correct disk
source but it was not used to update metadata as well. Due to reasons
how block commit in libvirt works we need to create a copy of that disk
source in order to have it available when updating metadata as the
original source will be freed at that point.

Resolves: https://issues.redhat.com/browse/RHEL-26276
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
13 months agoqemu_snapshot: call qemuSnapshotDeleteUpdateDisks only for external snapshots
Pavel Hrdina [Wed, 21 Feb 2024 16:45:08 +0000 (17:45 +0100)]
qemu_snapshot: call qemuSnapshotDeleteUpdateDisks only for external snapshots

Calling this function when deleting internal snapshot isn't required
because with internal snapshots all changes are done within the file
itself so there is no file deletion and no need to update snapshot
metadata.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
13 months agoPost-release version bump to 10.3.0
Jiri Denemark [Tue, 2 Apr 2024 11:43:31 +0000 (13:43 +0200)]
Post-release version bump to 10.3.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
13 months agoRelease of libvirt-10.2.0
Jiri Denemark [Tue, 2 Apr 2024 11:38:48 +0000 (13:38 +0200)]
Release of libvirt-10.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
13 months agoTranslated using Weblate (Korean)
김인수 [Fri, 29 Mar 2024 14:36:18 +0000 (15:36 +0100)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10438 of 10438 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
13 months agoNEWS: Update
Ján Tomko [Wed, 27 Mar 2024 15:05:51 +0000 (16:05 +0100)]
NEWS: Update

Update NEWS with new news.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
13 months agoNEWS: Mention fix for PCI VPD error reporting
Peter Krempa [Wed, 27 Mar 2024 15:39:55 +0000 (16:39 +0100)]
NEWS: Mention fix for PCI VPD error reporting

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agopci: Remove error reporting from PCI VPD parsing
Peter Krempa [Tue, 26 Mar 2024 14:06:58 +0000 (15:06 +0100)]
pci: Remove error reporting from PCI VPD parsing

The PCI VPD (Vital Product Data) may be missing or the kernel can report
presence but not actually have the data. Also the data is specified by
the device vendor and thus may be invalid in some cases.

To avoid log spamming, since the only usage in the node device driver is
ignoring errors, remove all error reporting.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/607
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agovirpcivpd: Revert error reporting from PCI VPD parser
Peter Krempa [Wed, 27 Mar 2024 12:52:54 +0000 (13:52 +0100)]
virpcivpd: Revert error reporting from PCI VPD parser

The VPD parsing is fragile and depends on hardware vendor's adherance to
standards. Since libvirt only ever uses this data to report it in the
nodedev XML which ignores any errors there's no much point in having
error reporting which I've added recently.

Turn the errors into VIR_DEBUG statements in preparation for upcoming
patch which completely removes the expectation to report errors.

This effectively reverts commits dfc85658bd0 and f85a382a0e7.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Wed, 27 Mar 2024 17:36:11 +0000 (18:36 +0100)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10438 of 10438 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/uk/

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
13 months agoTranslated using Weblate (Korean)
김인수 [Wed, 27 Mar 2024 17:36:10 +0000 (18:36 +0100)]
Translated using Weblate (Korean)

Currently translated at 99.5% (10394 of 10438 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
13 months agovirsh: cmdDomdisplayReload: Require option name for --type
Peter Krempa [Wed, 13 Mar 2024 16:55:53 +0000 (17:55 +0100)]
virsh: cmdDomdisplayReload: Require option name for --type

As this command was introduced in this release add the flag requiring to
pass optionname.

This is needed to actually disallow positional parsing of the value
despite documenting that the flag name is required.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 months agoUpdate translation files
Weblate [Mon, 25 Mar 2024 11:29:40 +0000 (12:29 +0100)]
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
13 months agopo: Refresh potfile for v10.2.0
Jiri Denemark [Mon, 25 Mar 2024 11:33:31 +0000 (12:33 +0100)]
po: Refresh potfile for v10.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
13 months agoqemuDomainChangeNet: Error when boot index changes in live XML
Adam Julis [Fri, 22 Mar 2024 08:12:26 +0000 (09:12 +0100)]
qemuDomainChangeNet: Error when boot index changes in live XML

If the original code detected a missing or null boot index in the
new XML, it automatically added the current value. This
autocompletion was incorrect because it was impossible to
distinguish between user intent and user error - changing the
boot order itself is forbidden and should always be an error.

Resolves: https://issues.redhat.com/browse/RHEL-23416
Fixes: aa3e07caec6179dfa6479deab14a21a493637d53
Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoNEWS: Mention loongarch64 guest support
Andrea Bolognani [Thu, 21 Mar 2024 14:37:50 +0000 (15:37 +0100)]
NEWS: Mention loongarch64 guest support

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoNEWS: Fix spacing
Andrea Bolognani [Thu, 21 Mar 2024 13:47:23 +0000 (14:47 +0100)]
NEWS: Fix spacing

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoqemu: warn on pausing of guest due to watchdog or io error
Lennart Fricke [Thu, 21 Mar 2024 12:46:28 +0000 (13:46 +0100)]
qemu: warn on pausing of guest due to watchdog or io error

Change the log level for pauses of guests due to watchdog timeouts
or io errors from debug to warn to enhance the visibility of such
events.

Signed-off-by: Lennart Fricke <lennart.fricke@drehpunkt.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoAdd test script for loongarch
Xianglai Li [Thu, 21 Mar 2024 03:30:29 +0000 (11:30 +0800)]
Add test script for loongarch

Add domaincapstest qemuxml2argvtest qemuxml2xmltest
related test cases for loongarch.

Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
13 months agoImplement the method of getting host info for loongarch
Xianglai Li [Thu, 21 Mar 2024 03:30:28 +0000 (11:30 +0800)]
Implement the method of getting host info for loongarch

Implement method for loongarch to get host info, such as
cpu frequency, system info, etc.

Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
13 months agoSupport for loongarch64 in the QEMU driver
Xianglai Li [Thu, 21 Mar 2024 03:30:27 +0000 (11:30 +0800)]
Support for loongarch64 in the QEMU driver

Implement support for loongarch64 in the QEMU driver.

Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
13 months agoAdd loongarch cpu support
Xianglai Li [Thu, 21 Mar 2024 03:30:26 +0000 (11:30 +0800)]
Add loongarch cpu support

Add loongarch cpu support, Define new cpu type 'loongarch64'
and implement it's driver functions.

Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
13 months agoremote: check for negative array lengths before allocation
Daniel P. Berrangé [Fri, 15 Mar 2024 10:47:50 +0000 (10:47 +0000)]
remote: check for negative array lengths before allocation

While the C API entry points will validate non-negative lengths
for various parameters, the RPC server de-serialization code
will need to allocate memory for arrays before entering the C
API. These allocations will thus happen before the non-negative
length check is performed.

Passing a negative length to the g_new0 function will usually
result in a crash due to the negative length being treated as
a huge positive number.

This was found and diagnosed by ALT Linux Team with AFLplusplus.

CVE-2024-2494
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Found-by: Alexandr Shashkin <dutyrok@altlinux.org>
Co-developed-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
13 months agoqemu: Tweak augeas schema
Andrea Bolognani [Tue, 28 Nov 2023 15:09:43 +0000 (16:09 +0100)]
qemu: Tweak augeas schema

Current entries should always be listed before obsolete ones.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
13 months agosecurity: Drop virSecurity(DAC|SELinux)SetImageLabelRelative()
Andrea Bolognani [Tue, 21 Nov 2023 17:20:32 +0000 (18:20 +0100)]
security: Drop virSecurity(DAC|SELinux)SetImageLabelRelative()

The single caller for each function passes the same value
for @src and @parent, which means that we don't really need
the additional API.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
13 months agosecurity: Drop virSecurity(DAC|SELinux)RestoreImageLabelSingle()
Andrea Bolognani [Mon, 20 Nov 2023 18:17:02 +0000 (19:17 +0100)]
security: Drop virSecurity(DAC|SELinux)RestoreImageLabelSingle()

Each one only has a single, trivial caller.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
13 months agosecurity: Fix name for _virSecurityDACChardevCallbackData
Andrea Bolognani [Tue, 21 Nov 2023 16:36:56 +0000 (17:36 +0100)]
security: Fix name for _virSecurityDACChardevCallbackData

It was clearly copied over from the SELinux driver without
updating its name in the process.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
13 months agosecurity: Fix alignment
Andrea Bolognani [Tue, 21 Nov 2023 16:17:10 +0000 (17:17 +0100)]
security: Fix alignment

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
13 months agoNEWS: Mention save & restore support for ch driver
Purna Pavan Chandra Aekkaladevi [Mon, 11 Mar 2024 09:44:07 +0000 (09:44 +0000)]
NEWS: Mention save & restore support for ch driver

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agodocs: Update doc for virDomainSave and virDomainRestore
Purna Pavan Chandra Aekkaladevi [Mon, 11 Mar 2024 09:44:06 +0000 (09:44 +0000)]
docs: Update doc for virDomainSave and virDomainRestore

ch_driver expects path to be of a dir for save/restore. So, update
the documentation at global API as well.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoch_driver: Add additional validation for save/restore
Purna Pavan Chandra Aekkaladevi [Mon, 11 Mar 2024 09:44:05 +0000 (09:44 +0000)]
ch_driver: Add additional validation for save/restore

Save & Restore are supported without any network and hostdev config
defined. So, add a validation for it before performing save.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoch_driver: cleanup any stale managed save dir before VM creation
Purna Pavan Chandra Aekkaladevi [Mon, 11 Mar 2024 09:44:04 +0000 (09:44 +0000)]
ch_driver: cleanup any stale managed save dir before VM creation

There are chances that libvirt process is killed and it resulting in
stale managed save dirs. So check for it, and cleanup it there's any.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoch_driver: Implement domain restore callbacks
Purna Pavan Chandra Aekkaladevi [Mon, 11 Mar 2024 09:44:03 +0000 (09:44 +0000)]
ch_driver: Implement domain restore callbacks

Following callbacks have been implemented
* domainRestore
* domainRestoreFlags
The path parameter to these callbacks has to be of the directory where
libvirt has performed save. Additionally, call restore in `domainCreate`
if the domain has managedsave.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoch_driver: Refactor virCHProcessStart
Purna Pavan Chandra Aekkaladevi [Mon, 11 Mar 2024 09:44:02 +0000 (09:44 +0000)]
ch_driver: Refactor virCHProcessStart

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoch_driver: Implement more save callbacks
Purna Pavan Chandra Aekkaladevi [Mon, 11 Mar 2024 09:44:01 +0000 (09:44 +0000)]
ch_driver: Implement more save callbacks

Following callbacks have been implemented
* domainSaveImageGetXMLDesc
* domainManagedSaveRemove
* domainManagedSaveGetXMLDesc
* domainHasManagedSaveImage

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoch_driver: Add domainManagedSave callback
Purna Pavan Chandra Aekkaladevi [Mon, 11 Mar 2024 09:44:00 +0000 (09:44 +0000)]
ch_driver: Add domainManagedSave callback

Create libvirt managed saveDir and pass it to CH to save the VM

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoch_driver: Add domainSave, domainSaveFlags callbacks
Purna Pavan Chandra Aekkaladevi [Mon, 11 Mar 2024 09:43:59 +0000 (09:43 +0000)]
ch_driver: Add domainSave, domainSaveFlags callbacks

Implemented save callbacks. CH's vmm.snapshot API is called to save the
domain state. The path passed to these callbacks has to be of directory
as CH takes dir as input to snapshot and saves multiple files under it.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoch_driver: Pass virCHDriverConfig to virCHMonitorNew
Purna Pavan Chandra Aekkaladevi [Mon, 11 Mar 2024 09:43:58 +0000 (09:43 +0000)]
ch_driver: Pass virCHDriverConfig to virCHMonitorNew

Pass virCHDriverConfig to VirCHMonitorNew instead of just stateDir so
that the cfg can be used for any additional purposes.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoch_driver: Support Save, Restore VM actions from monitor
Purna Pavan Chandra Aekkaladevi [Mon, 11 Mar 2024 09:43:57 +0000 (09:43 +0000)]
ch_driver: Support Save, Restore VM actions from monitor

Implement folowing API calls from CH monitor
* vmm.snapshot -> to save a domain
* vmm.restore -> to restore saved domain

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoNEWS: Announce support for MTP filesystem driver type
Rayhan Faizel [Tue, 19 Mar 2024 19:43:22 +0000 (01:13 +0530)]
NEWS: Announce support for MTP filesystem driver type

Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agomeson: Check for sched_get_priority_min()
Andrea Bolognani [Tue, 27 Feb 2024 14:58:27 +0000 (15:58 +0100)]
meson: Check for sched_get_priority_min()

virProcessSetScheduler() uses not just sched_setscheduler() but
also sched_get_priority_{min,max}(). Currently we assume that
the former being available implies that the latter are as well,
but that's not the case for at least GNU/Hurd.

Make sure all functions are actually available before
attempting to use them.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agomeson: Restore check for sched_getaffinity()
Andrea Bolognani [Tue, 27 Feb 2024 14:52:15 +0000 (15:52 +0100)]
meson: Restore check for sched_getaffinity()

Commit c07cf0a68693 replaced this check with one for the
presence of cpu_set_t.

The idea at the time was that only sched_{get,set}affinity()
were visible by default, while making cpu_set_t visible required
defining _WITH_CPU_SET_T. So libvirt would detect the function
and attempt to use it, but the code would not compile because
the necessary data type had not been made accessible.

The commit in question brought three FreeBSD commits as evidence
of this. While [1] and [2] do indeed seem to support this
explanation, [3] from just a few days later made it so that not
just cpu_set_t, but also the functions, required user action to
be visible. This arguably would have made the change unnecessary.

However, [4] from roughly a month later changed things once
again: it completely removed _WITH_CPU_SET_T, making both the
functions and the data type visible by default.

This is the status quo that seems to have persisted until
today. If one were to check any recent FreeBSD build job
performed as part of our CI pipeline, for example [5] and [6]
for FreeBSD 13 and 14 respectively, they would be able to
confirm that in both cases cpu_set_t is detected as available.

Since there is no longer a difference between the availability
of the functions and that of the data type, go back to what we
had before.

This has the interesting side-effect of fixing a bug
introduced by the commit in question.

When detection was changed from the function to the data type,
most uses of WITH_SCHED_GETAFFINITY were replaced with uses of
WITH_DECL_CPU_SET_T, but not all of them: specifically, those
that decided whether qemuProcessInitCpuAffinity() would be
actually implemented or replaced with a no-op stub were not
updated, which means that we've been running the stub version
everywhere except on FreeBSD ever since.

The code has been copied to the Cloud Hypervisor driver in
the meantime, which is similarly affected. Now that we're
building the actual implementation, we need to add virnuma.h
to the includes.

As a nice bonus this also makes things work correctly on
GNU/Hurd, where cpu_set_t is available but
sched_{get,set}affinity() are non-working stubs.

[1] https://cgit.freebsd.org/src/commit/?id=160b4b922b6021848b6b48afc894d16b879b7af2
[2] https://cgit.freebsd.org/src/commit/?id=43736b71dd051212d5c55be9fa21c45993017fbb
[3] https://cgit.freebsd.org/src/commit/?id=90fa9705d5cd29cf11c5dc7319299788dec2546a
[4] https://cgit.freebsd.org/src/commit/?id=5e04571cf3cf4024be926976a6abf19626df30be
[5] https://gitlab.com/libvirt/libvirt/-/jobs/6266401204
[6] https://gitlab.com/libvirt/libvirt/-/jobs/6266401205

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoutil: Add debug print missing from BSD
Andrea Bolognani [Fri, 23 Feb 2024 00:41:15 +0000 (01:41 +0100)]
util: Add debug print missing from BSD

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
13 months agoutil: Prefer cpuset_{get,set}affinity() on BSD
Andrea Bolognani [Fri, 23 Feb 2024 00:37:22 +0000 (01:37 +0100)]
util: Prefer cpuset_{get,set}affinity() on BSD

FreeBSD 14 implements sched_{get,set}affinity() for
compatibility with Linux, but we should still use the native
syscalls instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
13 months agoutil: Accept TIDs for virProcess{Get,Set}Affinity() on BSD
Andrea Bolognani [Fri, 23 Feb 2024 00:29:28 +0000 (01:29 +0100)]
util: Accept TIDs for virProcess{Get,Set}Affinity() on BSD

Depending on the situation, the IDs that we pass to these
functions can be either referring to processes or threads.

Linux doesn't have separate interfaces for one or the other,
but FreeBSD does and we're explicitly telling it that the ID
refers to a process. When it refers to a thread instead, the
call will fail, and the VM will not be able to start.

Luckily, another possible choice is CPU_WHICH_TIDPID, which
makes things behave the same as Linux.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
13 months agoqemu_command: Generate command line for MTP filesystem
Rayhan Faizel [Tue, 19 Mar 2024 15:16:30 +0000 (16:16 +0100)]
qemu_command: Generate command line for MTP filesystem

The source tag sets the rootdir property of the device, which is
the directory exposed to the guest via the MTP device. The target
tag sets the desc property.  This device supports read-only mode
as well. Like virtiofs, it does not support additional access
modes.

Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoconf: Introduce support for usb-mtp devices
Rayhan Faizel [Tue, 19 Mar 2024 15:15:50 +0000 (16:15 +0100)]
conf: Introduce support for usb-mtp devices

Expose usb-mtp device as another type of <filesystem/>.

Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoqemu_capabilities: Add QEMU_CAPS_DEVICE_USB_MTP capability
Rayhan Faizel [Fri, 8 Mar 2024 20:16:45 +0000 (01:46 +0530)]
qemu_capabilities: Add QEMU_CAPS_DEVICE_USB_MTP capability

This capability reflects presence of -device usb-mtp.

Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agovirt-admin: Fix segfault when libvirtd dies
Adam Julis [Tue, 19 Mar 2024 11:02:51 +0000 (12:02 +0100)]
virt-admin: Fix segfault when libvirtd dies

vshAdmCatchDisconnect requires non-NULL structure vshControl for
getting connection name (stored at opaque), but
virAdmConnectRegisterCloseCallback at vshAdmConnect called it
with NULL.

Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
13 months agonode_device_driver: use g_autofree instead of VIR_FREE()
Karim Taha [Sun, 17 Mar 2024 15:19:21 +0000 (17:19 +0200)]
node_device_driver: use g_autofree instead of VIR_FREE()

Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoopenvz_driver: use g_autofree instead of VIR_FREE()
Karim Taha [Sun, 17 Mar 2024 15:19:20 +0000 (17:19 +0200)]
openvz_driver: use g_autofree instead of VIR_FREE()

Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoqemu: virtiofs: error out if getting the group or user name fails
Ján Tomko [Thu, 7 Mar 2024 12:36:45 +0000 (13:36 +0100)]
qemu: virtiofs: error out if getting the group or user name fails

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoqemu: virtiofs: set correct label when creating the socket
Ján Tomko [Wed, 6 Mar 2024 16:26:40 +0000 (17:26 +0100)]
qemu: virtiofs: set correct label when creating the socket

Use svirt_t instead of virtd_t, since virtd_t is not available in the
session mode and qemu with svirt_t won't be able to talk to unconfined_t
socket.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoqemu: virtiofs: do not crash if cgroups are missing
Ján Tomko [Tue, 5 Mar 2024 13:55:26 +0000 (14:55 +0100)]
qemu: virtiofs: do not crash if cgroups are missing

On domain startup, qemuSetupCgroupForExtDevices checks
if a cgroup controller is present and skips the setup if not.

Add a similar check to qemuVirtioFSSetupCgroup to prevent
crashing when hotplugging a virtiofs filesystem.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agovirthreadpool: create threads from the newly expanded workers
Wei Gong [Mon, 18 Mar 2024 13:31:14 +0000 (21:31 +0800)]
virthreadpool: create threads from the newly expanded workers

when the thread pool is dynamically expanded, threads should
not be created from the existing workers; they should be created
from the newly expanded workers

Signed-off-by: Wei Gong <gongwei833x@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoopenvz_conf: Use g_autofree
Rayhan Faizel [Thu, 14 Mar 2024 20:22:49 +0000 (01:52 +0530)]
openvz_conf: Use g_autofree

Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 months agoNEWS: Document the fix for migration or vmx enabled domains
Jiri Denemark [Tue, 12 Mar 2024 16:54:41 +0000 (17:54 +0100)]
NEWS: Document the fix for migration or vmx enabled domains

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to Westmere*
Jiri Denemark [Thu, 7 Mar 2024 13:03:38 +0000 (14:03 +0100)]
Add vmx-* features to Westmere*

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to Snowridge
Jiri Denemark [Thu, 7 Mar 2024 13:05:53 +0000 (14:05 +0100)]
Add vmx-* features to Snowridge

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to Skylake*
Jiri Denemark [Thu, 7 Mar 2024 13:00:53 +0000 (14:00 +0100)]
Add vmx-* features to Skylake*

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to SapphireRapids
Jiri Denemark [Thu, 7 Mar 2024 13:05:34 +0000 (14:05 +0100)]
Add vmx-* features to SapphireRapids

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to SandyBridge*
Jiri Denemark [Thu, 7 Mar 2024 13:03:18 +0000 (14:03 +0100)]
Add vmx-* features to SandyBridge*

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to Penryn
Jiri Denemark [Thu, 7 Mar 2024 13:05:20 +0000 (14:05 +0100)]
Add vmx-* features to Penryn

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to Nehalem*
Jiri Denemark [Thu, 7 Mar 2024 13:04:21 +0000 (14:04 +0100)]
Add vmx-* features to Nehalem*

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to kvm*
Jiri Denemark [Thu, 7 Mar 2024 13:06:37 +0000 (14:06 +0100)]
Add vmx-* features to kvm*

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to IvyBridge*
Jiri Denemark [Thu, 7 Mar 2024 13:04:01 +0000 (14:04 +0100)]
Add vmx-* features to IvyBridge*

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to Icelake*
Jiri Denemark [Thu, 7 Mar 2024 13:02:47 +0000 (14:02 +0100)]
Add vmx-* features to Icelake*

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to Haswell*
Jiri Denemark [Thu, 7 Mar 2024 13:01:50 +0000 (14:01 +0100)]
Add vmx-* features to Haswell*

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to core{,2}duo
Jiri Denemark [Thu, 7 Mar 2024 13:06:13 +0000 (14:06 +0100)]
Add vmx-* features to core{,2}duo

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to Cooperlake
Jiri Denemark [Thu, 7 Mar 2024 13:05:01 +0000 (14:05 +0100)]
Add vmx-* features to Cooperlake

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to Conroe
Jiri Denemark [Thu, 7 Mar 2024 13:04:45 +0000 (14:04 +0100)]
Add vmx-* features to Conroe

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to Cascadelake*
Jiri Denemark [Thu, 7 Mar 2024 13:01:25 +0000 (14:01 +0100)]
Add vmx-* features to Cascadelake*

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoAdd vmx-* features to Broadwell*
Jiri Denemark [Thu, 7 Mar 2024 13:00:15 +0000 (14:00 +0100)]
Add vmx-* features to Broadwell*

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agocpu_map: Do not ignore VMX features in sync_qemu_models script
Jiri Denemark [Thu, 7 Mar 2024 12:21:31 +0000 (13:21 +0100)]
cpu_map: Do not ignore VMX features in sync_qemu_models script

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
13 months agoqemu: domain: Drop added features from migratable CPU
Jiri Denemark [Mon, 11 Mar 2024 16:04:48 +0000 (17:04 +0100)]
qemu: domain: Drop added features from migratable CPU

Features marked with added='yes' in CPU model definitions have to be
removed before migration, otherwise older libvirt would complain about
unknown CPU features. We only do this for features that were enabled for
a given CPU model even with older libvirt, which just ignored the
features. And only for features we added ourselves when updating CPU
definition during domain startup, that is we do not remove features
which were explicitly mentioned by a user.

That said, this is not the safest thing we could do, but it's
effectively the same thing we did before the affected features were
added: we ignored them completely on both sides of migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
13 months agoconf: cpu: Introduce virCPUDefListFeatures
Jiri Denemark [Mon, 11 Mar 2024 14:37:32 +0000 (15:37 +0100)]
conf: cpu: Introduce virCPUDefListFeatures

The function returns a list of explicitly mentioned features in the CPU
definition.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>