[PATCH 0/2] Add support for discard_no_unref qcow2 option
by Jean-Louis Dupond
Qemu 8.1.0 will have a new qcow2 option named discard-no-unref.
https://gitlab.com/qemu-project/qemu/-/commit/42a2890a76f4783cd1c212f2785...
Enabling this option wil change the way qemu handles guest discards
inside the qcow2 image and will highly improve the fragmentation within
the qcow2 image.
We want to be able to enable this option (which is off by default) via
libvirt, so this patch adds this option in libvirt.
Jean-Louis Dupond (2):
Add discard_no_unref option for qcow2 images
Update NEWS with new discard_no_unref option
NEWS.rst | 2 +
docs/formatdomain.rst | 6 +++
src/conf/domain_conf.c | 8 +++
src/conf/domain_conf.h | 1 +
src/conf/domain_validate.c | 15 ++++++
src/conf/schemas/domaincommon.rng | 8 +++
src/conf/storage_source_conf.c | 1 +
src/conf/storage_source_conf.h | 1 +
src/qemu/qemu_block.c | 11 ++---
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_driver.c | 4 +-
src/vz/vz_utils.c | 6 +++
tests/qemusecuritytest.c | 1 +
.../disk-discard_no_unref.x86_64-latest.args | 39 +++++++++++++++
.../disk-discard_no_unref.xml | 39 +++++++++++++++
tests/qemuxml2argvtest.c | 1 +
.../disk-discard_no_unref.x86_64-latest.xml | 49 +++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
18 files changed, 187 insertions(+), 7 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-discard_no_unref.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-discard_no_unref.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-discard_no_unref.x86_64-latest.xml
--
2.41.0
1 year, 6 months
[PATCH 0/3] qemu: Be more generous on cpuset.mems
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (3):
qemu: Don't try to 'fix up' cpuset.mems after QEMU's memory allocation
qemu: Allow more generous cpuset.mems for vCPUs and IOThreads
qemu: Drop @unionMems argument from qemuProcessSetupPid()
src/qemu/qemu_hotplug.c | 7 +++----
src/qemu/qemu_process.c | 45 +++++++++++++----------------------------
src/qemu/qemu_process.h | 3 +--
3 files changed, 18 insertions(+), 37 deletions(-)
--
2.39.3
1 year, 6 months
[libvirt PATCH] conf: virtiofs: validate that the target dir is unique even for hotplug
by Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=2171384
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/conf/domain_validate.c | 28 ++++++++++++++++++++--------
src/conf/domain_validate.h | 2 ++
src/libvirt_private.syms | 1 +
3 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index 80d6a2ffd9..4c76eb7f46 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -1735,8 +1735,9 @@ virDomainDefIOMMUValidate(const virDomainDef *def)
}
-static int
-virDomainDefFSValidate(const virDomainDef *def)
+int
+virDomainDefFSValidate(const virDomainDef *def,
+ const virDomainFSDef *newfs)
{
size_t i;
g_autoptr(GHashTable) dsts = virHashNew(NULL);
@@ -1754,8 +1755,18 @@ virDomainDefFSValidate(const virDomainDef *def)
return -1;
}
- if (virHashAddEntry(dsts, fs->dst, (void *) 0x1) < 0)
+ if (virHashAddEntry(dsts, fs->dst, (void *) fs) < 0)
+ return -1;
+ }
+
+ if (newfs) {
+ const virDomainFSDef *fs = g_hash_table_lookup(dsts, newfs->dst);
+ if (fs && fs != newfs) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("filesystem target '%1$s' specified twice"),
+ newfs->dst);
return -1;
+ }
}
return 0;
@@ -1856,9 +1867,6 @@ virDomainDefValidateInternal(const virDomainDef *def,
if (virDomainNumaDefValidate(def->numa) < 0)
return -1;
- if (virDomainDefFSValidate(def) < 0)
- return -1;
-
if (virDomainDefValidateIOThreads(def) < 0)
return -1;
@@ -2573,7 +2581,8 @@ virDomainShmemDefValidate(const virDomainShmemDef *shmem)
}
static int
-virDomainFSDefValidate(const virDomainFSDef *fs)
+virDomainFSDefValidate(const virDomainDef *def,
+ const virDomainFSDef *fs)
{
if (fs->dst == NULL) {
const char *source = fs->src->path;
@@ -2592,6 +2601,9 @@ virDomainFSDefValidate(const virDomainFSDef *fs)
return -1;
}
+ if (virDomainDefFSValidate(def, fs) < 0)
+ return -1;
+
return 0;
}
@@ -2885,7 +2897,7 @@ virDomainDeviceDefValidateInternal(const virDomainDeviceDef *dev,
return virDomainShmemDefValidate(dev->data.shmem);
case VIR_DOMAIN_DEVICE_FS:
- return virDomainFSDefValidate(dev->data.fs);
+ return virDomainFSDefValidate(def, dev->data.fs);
case VIR_DOMAIN_DEVICE_AUDIO:
return virDomainAudioDefValidate(def, dev->data.audio);
diff --git a/src/conf/domain_validate.h b/src/conf/domain_validate.h
index fc441cef5b..437cbe4d2e 100644
--- a/src/conf/domain_validate.h
+++ b/src/conf/domain_validate.h
@@ -47,3 +47,5 @@ int virDomainDiskDefSourceLUNValidate(const virStorageSource *src);
int virDomainDefOSValidate(const virDomainDef *def,
virDomainXMLOption *xmlopt);
+int virDomainDefFSValidate(const virDomainDef *def,
+ const virDomainFSDef *newfs);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 436d5a0770..65089c1aaa 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -793,6 +793,7 @@ virDomainDefPostParse;
# conf/domain_validate.h
virDomainActualNetDefValidate;
+virDomainDefFSValidate;
virDomainDefOSValidate;
virDomainDefValidate;
virDomainDeviceValidateAliasForHotplug;
--
2.40.1
1 year, 6 months
[PATCH] scripts: QMP schema query string helper script
by Peter Krempa
The script generates all query strings in same format as used for
querying qemu capabilities for a given .replies file.
The output can be used to either aid in creation of the query strings as
well as to generate diff between the schema, which is useful when adding
a new capability dump.
The script also validates that all of the schema is supported by our
tools so that we can always adapt.
The output looks like:
$ ./scripts/qapi-schema-diff-gen.py tests/qemucapabilitiesdata/caps_8.0.0_x86_64.replies
[...]
query-yank
query-yank/ret-type/type
query-yank/ret-type/type/^block-node
query-yank/ret-type/type/^chardev
query-yank/ret-type/type/^migration
query-yank/ret-type/+block-node
query-yank/ret-type/+block-node/node-name
query-yank/ret-type/+block-node/node-name/!str
query-yank/ret-type/+chardev
query-yank/ret-type/+chardev/id
query-yank/ret-type/+chardev/id/!str
query-yank/ret-type/+migration
[...]
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
scripts/meson.build | 1 +
scripts/qapi-schema-diff-gen.py | 313 ++++++++++++++++++++++++++++++++
tests/meson.build | 12 ++
3 files changed, 326 insertions(+)
create mode 100755 scripts/qapi-schema-diff-gen.py
diff --git a/scripts/meson.build b/scripts/meson.build
index 05b71184f1..c216c7e1ff 100644
--- a/scripts/meson.build
+++ b/scripts/meson.build
@@ -30,6 +30,7 @@ scripts = [
'meson-timestamp.py',
'mock-noinline.py',
'prohibit-duplicate-header.py',
+ 'qapi-schema-diff-gen.py',
]
foreach name : scripts
diff --git a/scripts/qapi-schema-diff-gen.py b/scripts/qapi-schema-diff-gen.py
new file mode 100755
index 0000000000..bde130e33c
--- /dev/null
+++ b/scripts/qapi-schema-diff-gen.py
@@ -0,0 +1,313 @@
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# A tool to help with creating query strings for querying the QMP schema (as
+# returned by 'query-qmp-schema' QMP command). In default mode it generates all
+# the possible query strings for a QMP schema in the ".replies" format as
+# generated by 'tests/qemucapsprobe.c'. This can be either used by users to
+# find the desired schema query string or to see what changed between two
+# versions.
+#
+# In the '--validate' mode the script doesn't output the schema query strings.
+# This invokes just the validator that everything in the schema is supported by
+# the tool.
+#
+# Note: Any change to the 'validate_schema' function below to make it accept
+# new schema components most likely requires change to either
+# 'src/qemu/qemu_qapi.c' or 'tests/testutilsqemuschema.c' to accept the new
+# schema components.
+
+from pathlib import Path
+import argparse
+import json
+import sys
+
+
+# Finds the apropriate call to 'query-qmp-schema' in the '.replies' file and
+# returns the JSON blob following the command invocation.
+def load_schema_json_list(filename):
+ found = False
+
+ with open(filename, "r") as fh:
+ jsonstr = ''
+ for line in fh:
+ jsonstr += line
+
+ if line != '}\n':
+ continue
+
+ if found:
+ return json.loads(jsonstr)["return"]
+
+ cmdobj = json.loads(jsonstr)
+ jsonstr = ""
+
+ if isinstance(cmdobj, dict) and cmdobj.get('execute', '') == 'query-qmp-schema':
+ found = True
+
+
+# Validates that 'entry' (an member of the QMP schema):
+# - checks that it's a Dict (imported from a JSON object)
+# - checks that all 'mandatory' fields are present and their types match
+# - checks the types of all 'optional' fields
+# - checks that no unknown fields are present
+def check_keys(entry, mandatory, optional):
+ keys = set(entry.keys())
+
+ for k, t in mandatory:
+ try:
+ keys.remove(k)
+ except KeyError:
+ raise Exception("missing mandatory key '%s' in schema '%s'" % (k, entry))
+
+ if not isinstance(entry[k], t):
+ raise Exception("key '%s' is not of the expected type '%s' in schema '%s'" % (k, t, entry))
+
+ for k, t in optional:
+ if k in keys:
+ keys.discard(k)
+
+ if t is not None:
+ if not isinstance(entry[k], t):
+ raise Exception("key '%s' is not of the expected type '%s' in schema '%s'" % (k, t, entry))
+
+ if len(keys) > 0:
+ raise Exception("unhandled keys '%s' in schema '%s'" % (','.join(list(keys)), entry))
+
+
+# Validates the optional 'features' and that they consist only of strings
+def check_features_list(entry):
+ for f in entry.get('features', []):
+ if not isinstance(f, str):
+ raise Exception("broken 'features' list in schema entry '%s'" % entry)
+
+
+# Validate that the passed schema has only supported members. This is useful to
+# stay up to date with any changes to the schema.
+def validate_schema(schemalist):
+ for entry in schemalist:
+ if not isinstance(entry, dict):
+ raise Exception("schema entry '%s' is not a JSON Object (dict)" % (entry))
+
+ match entry.get('meta-type', None):
+ case 'command':
+ check_keys(entry,
+ mandatory=[('name', str),
+ ('meta-type', str),
+ ('arg-type', str),
+ ('ret-type', str)],
+ optional=[('features', list),
+ ('allow-oob', bool)])
+
+ check_features_list(entry)
+
+ case 'event':
+ check_keys(entry,
+ mandatory=[('name', str),
+ ('meta-type', str),
+ ('arg-type', str)],
+ optional=[('features', list)])
+
+ check_features_list(entry)
+
+ case 'object':
+ check_keys(entry,
+ mandatory=[('name', str),
+ ('meta-type', str),
+ ('members', list)],
+ optional=[('tag', str),
+ ('variants', list),
+ ('features', list)])
+
+ check_features_list(entry)
+
+ for m in entry.get('members', []):
+ check_keys(m,
+ mandatory=[('name', str),
+ ('type', str)],
+ optional=[('default', None),
+ ('features', list)])
+ check_features_list(m)
+
+ for m in entry.get('variants', []):
+ check_keys(m,
+ mandatory=[('case', str),
+ ('type', str)],
+ optional=[])
+
+ case 'array':
+ check_keys(entry,
+ mandatory=[('name', str),
+ ('meta-type', str),
+ ('element-type', str)],
+ optional=[])
+
+ case 'enum':
+ check_keys(entry,
+ mandatory=[('name', str),
+ ('meta-type', str)],
+ optional=[('members', list),
+ ('values', list)])
+
+ for m in entry.get('members', []):
+ check_keys(m,
+ mandatory=[('name', str)],
+ optional=[('features', list)])
+ check_features_list(m)
+
+ case 'alternate':
+ check_keys(entry,
+ mandatory=[('name', str),
+ ('meta-type', str),
+ ('members', list)],
+ optional=[])
+
+ for m in entry.get('members', []):
+ check_keys(m,
+ mandatory=[('type', str)],
+ optional=[])
+ case 'builtin':
+ check_keys(entry,
+ mandatory=[('name', str),
+ ('meta-type', str),
+ ('json-type', str)],
+ optional=[])
+
+ case _:
+ raise Exception("unknown or missing 'meta-type' in schema entry '%s'" % entry)
+
+
+# Convert a list of QMP schema entries into a dict organized via 'name' member
+def load_schema_json_dict(schemalist):
+ schemadict = {}
+
+ for memb in schemalist:
+ schemadict[memb['name']] = memb
+
+ return schemadict
+
+
+# loads and validates the QMP schema from the .replies file 'filename'
+def load_schema(filename):
+ schemalist = load_schema_json_list(filename)
+
+ if not schemalist:
+ raise Exception("QMP schema not found in '%s'" % (filename))
+
+ validate_schema(schemalist)
+
+ return load_schema_json_dict(schemalist)
+
+
+# Recursively traverse the schema and print out the schema query strings for
+# the corresponding entries. In certain cases the schema references itself,
+# which is handled by passing a 'trace' list which contains the current path
+def iterate_schema(name, cur, trace, schema):
+ obj = schema[name]
+
+ if name in trace:
+ print('%s (recursion)' % cur)
+ return
+
+ trace = trace + [name]
+
+ match obj['meta-type']:
+ case 'command' | 'event':
+ arguments = obj.get('arg-type', None)
+ returns = obj.get('ret-type', None)
+
+ print(name)
+
+ for f in obj.get('features', []):
+ print('%s/$%s' % (cur, f))
+
+ if arguments:
+ iterate_schema(arguments, cur + '/arg-type', trace, schema)
+
+ if returns:
+ iterate_schema(returns, cur + '/ret-type', trace, schema)
+
+ case 'object':
+ members = sorted(obj.get('members', []), key=lambda d: d['name'])
+ variants = sorted(obj.get('variants', []), key=lambda d: d['case'])
+
+ for f in obj.get('features', []):
+ print('%s/$%s' % (cur, f))
+
+ for memb in members:
+ membpath = "%s/%s" % (cur, memb['name'])
+ print(membpath)
+
+ for f in memb.get('features', []):
+ print('%s/$%s' % (membpath, f))
+
+ iterate_schema(memb['type'], membpath, trace, schema)
+
+ for var in variants:
+ varpath = "%s/+%s" % (cur, var['case'])
+ print(varpath)
+ iterate_schema(var['type'], varpath, trace, schema)
+
+ case 'enum':
+ members = sorted(obj.get('members', []), key=lambda d: d['name'])
+
+ for m in members:
+ print('%s/^%s' % (cur, m['name']))
+
+ for f in m.get('features', []):
+ print('%s/^%s/$%s' % (cur, m['name'], f))
+
+ case 'array':
+ iterate_schema(obj['element-type'], cur, trace, schema)
+
+ case 'builtin':
+ print('%s/!%s' % (cur, name))
+
+ case 'alternate':
+ for var in obj['members']:
+ iterate_schema(var['type'], cur, trace, schema)
+
+ case _:
+ raise Exception("unhandled 'meta-type' '%s'" % obj.get('meta-type', '<missing>'))
+
+
+def process_one_schema(schemafile, validate_only):
+ try:
+ schema = load_schema(schemafile)
+ except Exception as e:
+ raise Exception("Failed to load schema '%s': %s" % (schemafile, e))
+
+ if validate_only:
+ return
+
+ toplevel = []
+
+ for k, v in schema.items():
+ if v['meta-type'] == 'command' or v['meta-type'] == 'event':
+ toplevel.append(k)
+
+ toplevel.sort()
+
+ for c in toplevel:
+ iterate_schema(c, c, [], schema)
+
+
+parser = argparse.ArgumentParser(description='A tool to generate QMP schema query strins and validator of schema coverage')
+parser.add_argument('--validate', action="store_true", help='only load the schema and validate it')
+parser.add_argument('--schemadir', default='',
+ help='directory containing .replies files')
+parser.add_argument('schema', nargs='?', help='path to .replies file to use')
+args = parser.parse_args()
+
+if not args.schema and not args.schemadir:
+ parser.print_help()
+ sys.exit(1)
+
+if args.schema:
+ process_one_schema(args.schema, args.validate)
+else:
+ files = Path(args.schemadir).glob('*.replies')
+
+ for file in files:
+ process_one_schema(str(file), args.validate)
diff --git a/tests/meson.build b/tests/meson.build
index 0082446029..25e7ccd312 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -598,6 +598,18 @@ foreach data : tests
test(data['name'], test_bin, env: tests_env, timeout: timeout, depends: tests_deps)
endforeach
+test(
+ 'qapi-schema-check',
+ python3_prog,
+ args: [
+ qapi_schema_diff_gen_prog.full_path(),
+ '--validate',
+ '--schemadir',
+ meson.project_source_root() / 'tests' / 'qemucapabilitiesdata'
+ ],
+ env: runutf8,
+)
+
# helpers:
# each entry is a dictionary with following items:
--
2.40.1
1 year, 6 months
[PATCH 0/2] qemu: Update capabilities for the 8.1 dev cycle
by Peter Krempa
Peter Krempa (2):
qemumonitorjsontest: Work around deprecation of 'vcpu' argument of
'trace-event-get-state'
qemucapabilitiestest: Add data for the qemu-8.1
.../domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 286 +
.../domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 287 +
tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 286 +
.../caps_8.1.0_x86_64.replies | 42336 ++++++++++++++++
.../caps_8.1.0_x86_64.xml | 3757 ++
tests/qemumonitorjsontest.c | 4 +-
.../cpu-host-model.x86_64-latest.args | 2 +-
7 files changed, 46954 insertions(+), 4 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml
create mode 100644 tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml
create mode 100644 tests/domaincapsdata/qemu_8.1.0.x86_64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_8.1.0_x86_64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
--
2.40.1
1 year, 6 months
[PATCH] virnetsshsession: Adapt to changed libssh2 API
by Michal Privoznik
In one of its commits [1] libssh2 changed the 'text' member of
LIBSSH2_USERAUTH_KBDINT_PROMPT struct from 'char' to 'unsigned
char'. But we g_strdup() the member in order to fill 'prompt'
member of virConnectCredential struct. Typecast the value to
avoid warnings. Also, drop @prompt variable, as it's needless.
1: https://github.com/libssh2/libssh2/commit/83853f8aea0e2f739cacd491632eb7f...
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Here's a somewhat green CI:
https://gitlab.com/MichalPrivoznik/libvirt/-/pipelines/889599454
I mean, we still have failures on rawhide, but that's because numad was
temporarily removed from repos, but they are bringing it back. So ignore
that part. Apparently our CI images were not rebuilt this morning.
src/rpc/virnetsshsession.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c
index f84805825b..1df43bb044 100644
--- a/src/rpc/virnetsshsession.c
+++ b/src/rpc/virnetsshsession.c
@@ -216,9 +216,7 @@ virNetSSHKbIntCb(const char *name G_GNUC_UNUSED,
/* fill data structures for auth callback */
for (i = 0; i < num_prompts; i++) {
- char *prompt;
- prompt = g_strdup(prompts[i].text);
- askcred[i].prompt = prompt;
+ askcred[i].prompt = g_strdup((char*)prompts[i].text);
/* remove colon and trailing spaces from prompts, as default behavior
* of libvirt's auth callback is to add them */
--
2.39.3
1 year, 6 months
[libvirt PATCH] ci: fix Cirrus CI jobs run from merge requests
by Daniel P. Berrangé
Preferentially fetch from $CI_MERGE_REQUEST_REF_PATH if it is
defined, otherwise use $CI_COMMIT_REF_NAME
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
ci/cirrus/build.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ci/cirrus/build.yml b/ci/cirrus/build.yml
index 9332e968bd..519e5ae144 100644
--- a/ci/cirrus/build.yml
+++ b/ci/cirrus/build.yml
@@ -4,6 +4,7 @@
env:
CI_REPOSITORY_URL: "@CI_REPOSITORY_URL@"
CI_COMMIT_REF_NAME: "@CI_COMMIT_REF_NAME@"
+ CI_MERGE_REQUEST_REF_PATH: "@CI_MERGE_REQUEST_REF_PATH@"
CI_COMMIT_SHA: "@CI_COMMIT_SHA@"
PATH: "@PATH@"
PKG_CONFIG_PATH: "@PKG_CONFIG_PATH@"
@@ -20,7 +21,7 @@ build_task:
- if test -n "@PYPI_PKGS@" ; then @PIP3@ install @PYPI_PKGS@ ; fi
clone_script:
- git clone --depth 100 "$CI_REPOSITORY_URL" .
- - git fetch origin "$CI_COMMIT_REF_NAME"
+ - git fetch origin "${CI_MERGE_REQUEST_REF_PATH:-$CI_COMMIT_REF_NAME}"
- git reset --hard "$CI_COMMIT_SHA"
build_script:
- meson setup build
--
2.40.1
1 year, 6 months
[PATCH] qemu: Set proper PCI backend for <interface/>-s that are actually hostdevs
by Michal Privoznik
When starting a domain, it's done so in two steps (actually more,
but lets focus on just the following two):
1) qemuProcessPrepareDomain(), followed by
2) qemuProcessPrepareHost().
Now, in the first step (PrepareDomain()), PCI backends for all
hostdevs is set (qemuProcessPrepareDomain() ->
qemuProcessPrepareDomainHostdevs() -> qemuDomainPrepareHostdev()
-> qemuDomainPrepareHostdevPCI()). Perfect.
But then, additional hostdevs may appear, because in the host
prepare phase we may insert some hostdevs into domain definition
(qemuProcessPrepareHost() -> qemuProcessNetworkPrepareDevices()).
Now, these additional hostdevs don't undergo the same prepare as
hostdevs that were already present in the domain definition (i.e.
in qemuProcessPrepareDomain() phase). Therefore, we have to call
corresponding prepare function explicitly.
NB, the interface hotplug code (qemuDomainAttachNetDevice()) does
not suffer from this problem, because it calls top level
qemuDomainAttachHostDevice() which is used to hotplug regular
hostdevs too and as such calls qemuDomainPrepareHostdev().
Fixes: 3b87709c768480e085556e06bd8d08f62270d42d
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2209853
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_process.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 730e59eb7e..1431fa8310 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5834,6 +5834,13 @@ qemuProcessNetworkPrepareDevices(virQEMUDriver *driver,
net->data.network.name, def->name);
return -1;
}
+
+ /* For hostdev present in qemuProcessPrepareDomain() phase this was
+ * done already, but this code runs after that, so we have to call
+ * it ourselves. */
+ if (qemuDomainPrepareHostdevPCI(hostdev, priv) < 0)
+ return -1;
+
if (virDomainHostdevInsert(def, hostdev) < 0)
return -1;
} else if (actualType == VIR_DOMAIN_NET_TYPE_USER &&
--
2.39.3
1 year, 6 months
[PATCH 00/15] XML parser cleanups (part 1)
by Peter Krempa
Peter Krempa (15):
virNetDevBandwidthParse: Don't validate element name
virNetDevBandwidthParse: Use 'virXMLPropUInt' to parse 'classID'
virNetDevBandwidthParseRate: Refactor parsing
virNetDevBandwidthParse: Use virXMLNodeGetSubelement instead of looped
parser
virNetworkDHCPDefParseXML: Refactor cleanup
util: xml: Introduce virXMLNodeGetSubelementList
nwfilterxml2xmltest: Add test case for parser and formatter quirks
conf: network: Refactor XML parsing in virNetworkDHCPDefParseXML
conf: nwfilter: Refactor XML formatting in virNWFilterRuleDefFormat
virNWFilterRuleDef: Turn 'action' and 'tt' into proper enum types
virNWFilterRuleParse: Parse 'priority' via 'virXMLPropInt'
virNWFilterRuleParse: Refactor attribute parser
virNWFilterRuleDefDetailsFormat: Refactor formatter
conf: nwfilter: Refactor virNWFilterIncludeParse
conf: nwfilter: Refactor virNWFilterFormatParamAttributes
src/conf/netdev_bandwidth_conf.c | 141 ++-----
src/conf/network_conf.c | 74 ++--
src/conf/nwfilter_conf.c | 410 ++++++++------------
src/conf/nwfilter_conf.h | 4 +-
src/conf/nwfilter_params.c | 45 +--
src/libvirt_private.syms | 1 +
src/nwfilter/nwfilter_ebiptables_driver.c | 5 +
src/util/virxml.c | 34 ++
src/util/virxml.h | 5 +
tests/nwfilterxml2xmlin/quirks-invalid.xml | 13 +
tests/nwfilterxml2xmlout/quirks-invalid.xml | 7 +
tests/nwfilterxml2xmltest.c | 5 +
12 files changed, 326 insertions(+), 418 deletions(-)
create mode 100644 tests/nwfilterxml2xmlin/quirks-invalid.xml
create mode 100644 tests/nwfilterxml2xmlout/quirks-invalid.xml
--
2.40.1
1 year, 6 months
[PATCH 00/18] QMP schema validation fixes
by Peter Krempa
Turns out we still had wired up use of 'device' argument of
block_set_io_throttle which got deprecated and our valiator didn't catch
it due to multiple reasons. Address all of that.
Peter Krempa (18):
qemuMonitorTestAddItemVerbatim: Simplify cleanup
qemuMonitorTestAddHandler: Remove return value
virRaiseErrorLog: Don't skip error printing when enabling debug
logging env variable
testQemuMonitorJSONAttachChardev: Move all setup code under virTestRun
qemuMonitorJSONTestAttachOneChardev: Rewrite using
qemuMonitorTestAddItemVerbatim
qemuMonitorTestAddItemExpect: Remove unused helper
testQemuAgentCPU: Rewrite using qemuMonitorTestAddItemVerbatim
testQemuAgentFSTrim: Rewrite using qemuMonitorTestAddItemVerbatim
testQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime: Rewrite using
qemuMonitorTestAddItemVerbatim
testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle: Rewrite using
qemuMonitorTestAddItemVerbatim
Drop unused qemuMonitorTestAddItemParams
qemumonitorjsontest: Drop 'schema-meta' case
qemuDiskConfigBlkdeviotuneEnabled: Make 'disk' argument const
qemu: Refuse setting <iotune> for 'SD' disks
qemumonitorjsontest: Use 'id' instead of deprecated 'device' argument
of 'block_set_io_throttle'
qemuMonitorGetBlockIoThrottle: Drop 'diskalias' argument
qemuMonitorSetBlockIoThrottle: Drop 'diskalias' argument
testQEMUSchemaValidateObjectMember: validate QMP object member
deprecation
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_command.h | 2 +-
src/qemu/qemu_driver.c | 40 ++----
src/qemu/qemu_hotplug.c | 4 +-
src/qemu/qemu_monitor.c | 12 +-
src/qemu/qemu_monitor.h | 2 -
src/qemu/qemu_monitor_json.c | 14 +-
src/qemu/qemu_monitor_json.h | 2 -
src/qemu/qemu_process.c | 12 +-
src/qemu/qemu_validate.c | 8 ++
src/util/virerror.c | 4 +-
tests/qemuagenttest.c | 92 ++++++------
tests/qemumonitorjsontest.c | 153 ++++++++++----------
tests/qemumonitortestutils.c | 266 +++--------------------------------
tests/qemumonitortestutils.h | 16 +--
tests/testutilsqemuschema.c | 4 +
16 files changed, 191 insertions(+), 442 deletions(-)
--
2.40.1
1 year, 6 months