[PATCH] qemu: save status xml after generating taint message
by Kristina Hanicova
We didn't always save status xml after generating new taint
message, which resulted in it being deleted in case of a libvirtd
restart. Some taint messages were preserved thanks to saving
status xml separately at the end of the calling functions (which
makes sense, because qemuDomainObjTaint was usually called there
multiple times). But for special cases (e.g. When only few taint
messages are generated) we need a separate function for
generating them and saving status xml explicitly.
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1965589
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/qemu/qemu_domain.c | 11 +++++++++++
src/qemu/qemu_domain.h | 5 +++++
src/qemu/qemu_driver.c | 4 ++--
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ac1d8ef151..4b9e717c16 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6468,6 +6468,17 @@ void qemuDomainObjTaint(virQEMUDriver *driver,
qemuDomainObjTaintMsg(driver, obj, taint, logCtxt, NULL);
}
+void qemuDomainObjTaintAndSave(virQEMUDriver *driver,
+ virDomainObj *obj,
+ virDomainTaintFlags taint,
+ qemuDomainLogContext *logCtxt)
+{
+ g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
+
+ qemuDomainObjTaintMsg(driver, obj, taint, logCtxt, NULL);
+ ignore_value(virDomainObjSave(obj, driver->xmlopt, cfg->stateDir));
+}
+
void qemuDomainObjTaintMsg(virQEMUDriver *driver,
virDomainObj *obj,
virDomainTaintFlags taint,
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index acf6ca5ab6..9bd711cbd4 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -568,6 +568,11 @@ void qemuDomainObjTaint(virQEMUDriver *driver,
virDomainTaintFlags taint,
qemuDomainLogContext *logCtxt);
+void qemuDomainObjTaintAndSave(virQEMUDriver *driver,
+ virDomainObj *obj,
+ virDomainTaintFlags taint,
+ qemuDomainLogContext *logCtxt);
+
void qemuDomainObjTaintMsg(virQEMUDriver *driver,
virDomainObj *obj,
virDomainTaintFlags taint,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 521063d438..8652bdc3d8 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14010,7 +14010,7 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd,
priv = vm->privateData;
- qemuDomainObjTaint(driver, vm, VIR_DOMAIN_TAINT_CUSTOM_MONITOR, NULL);
+ qemuDomainObjTaintAndSave(driver, vm, VIR_DOMAIN_TAINT_CUSTOM_MONITOR, NULL);
hmp = !!(flags & VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP);
@@ -16877,7 +16877,7 @@ qemuDomainQemuAgentCommand(virDomainPtr domain,
if (!qemuDomainAgentAvailable(vm, true))
goto endjob;
- qemuDomainObjTaint(driver, vm, VIR_DOMAIN_TAINT_CUSTOM_GA_COMMAND, NULL);
+ qemuDomainObjTaintAndSave(driver, vm, VIR_DOMAIN_TAINT_CUSTOM_GA_COMMAND, NULL);
agent = qemuDomainObjEnterAgent(vm);
ret = qemuAgentArbitraryCommand(agent, cmd, &result, timeout);
--
2.31.1
3 years, 5 months
[libvirt PATCH 00/38] virHashNew refactorings - part VII
by Tim Wiederhake
"virHashNew" cannot return NULL, yet we check for NULL in various places.
See https://listman.redhat.com/archives/libvir-list/2021-July/msg00074.html.
Not split up further as per
https://listman.redhat.com/archives/libvir-list/2021-July/msg00575.html
Tim Wiederhake (38):
virSystemdActivationNew: `virHashNew` cannot return NULL
virSystemdActivationNew: Use automatic memory management
virSystemdActivationNew: Remove superfluous `goto`s
virNWFilterCreateVarsFrom: `virHashNew` cannot return NULL
virNWFilterCreateVarsFrom: Use automatic memory management
virNWFilterCreateVarsFrom: Remove superfluous `goto`s
virNWFilterRuleDefToRuleInst: `virHashNew` cannot return NULL
ebiptablesApplyNewRules: `virHashNew` cannot return NULL
hypervCreateEmbeddedParam: `virHashNew` cannot return NULL
qemusecuritymock: init_hash: `virHashNew` cannot return NULL
libxlLoggerNew: `virHashNew` cannot return NULL
qemuBlockNodeNamesDetect: `virHashNew` cannot return NULL
qemuBlockNodeNameGetBackingChain: `virHashNew` cannot return NULL
qemuDomainObjPrivateAlloc: `virHashNew` cannot return NULL
qemuInteropFetchConfigs: `virHashNew` cannot return NULL
virChrdevAlloc: `virHashNew` cannot return NULL
virCloseCallbacksNew: `virHashNew` cannot return NULL
virDomainCCWAddressSetCreate: `virHashNew` cannot return NULL
virDomainDefBootOrderPostParse: `virHashNew` cannot return NULL
virDomainDefValidateAliases: `virHashNew` cannot return NULL
virDomainMomentObjListNew: `virHashNew` cannot return NULL
virDomainObjListNew: `virHashNew` cannot return NULL
virFileCacheNew: `virHashNew` cannot return NULL
virHashAtomicNew: `virHashNew` cannot return NULL
virInterfaceObjListNew: `virHashNew` cannot return NULL
virLockDaemonNew: `virHashNew` cannot return NULL
virLockDaemonNewPostExecRestart: `virHashNew` cannot return NULL
virLockSpaceNew: `virHashNew` cannot return NULL
virLockSpaceNewPostExecRestart: `virHashNew` cannot return NULL
virNetDaemonNew: `virHashNew` cannot return NULL
virNetworkObjListNew: `virHashNew` cannot return NULL
virNetworkObjNew: `virHashNew` cannot return NULL
virNodeDeviceObjListNew: `virHashNew` cannot return NULL
virQEMUCapsProbeQMPHostCPU: `virHashNew` cannot return NULL
virSecuritySELinuxLXCInitialize: `virHashNew` cannot return NULL
virSecuritySELinuxQEMUInitialize: `virHashNew` cannot return NULL
virStoragePoolObjListNew: `virHashNew` cannot return NULL
virStorageVolObjListNew: `virHashNew` cannot return NULL
src/conf/domain_addr.c | 7 +------
src/conf/domain_conf.c | 5 +----
src/conf/domain_validate.c | 3 +--
src/conf/virchrdev.c | 6 +-----
src/conf/virdomainmomentobjlist.c | 4 ----
src/conf/virdomainobjlist.c | 8 ++------
src/conf/virinterfaceobj.c | 5 +----
src/conf/virnetworkobj.c | 8 ++------
src/conf/virnodedeviceobj.c | 5 +----
src/conf/virstorageobj.c | 17 +++++------------
src/hyperv/hyperv_wmi.c | 6 +-----
src/hypervisor/virclosecallbacks.c | 4 ----
src/libxl/libxl_logger.c | 4 +---
src/locking/lock_daemon.c | 6 ++----
src/nwfilter/nwfilter_ebiptables_driver.c | 3 ---
src/nwfilter/nwfilter_gentech_driver.c | 18 ++++++------------
src/qemu/qemu_block.c | 15 +++------------
src/qemu/qemu_capabilities.c | 3 +--
src/qemu/qemu_domain.c | 3 +--
src/qemu/qemu_interop_config.c | 5 +----
src/rpc/virnetdaemon.c | 3 +--
src/security/security_selinux.c | 6 ++----
src/util/virfilecache.c | 7 +------
src/util/virhash.c | 5 +----
src/util/virlockspace.c | 6 ++----
src/util/virsystemd.c | 16 +++++-----------
tests/qemusecuritymock.c | 17 +++--------------
27 files changed, 46 insertions(+), 149 deletions(-)
--
2.31.1
3 years, 5 months
[libvirt PATCH] virsh: fix setmem flags logic
by Pavel Hrdina
When we dropped virDomainSetMemory usage it got kind of tricky to
figure out the flags correctly.
Originally the logic was following:
no option | --current | --live | --config | --live --config
----------+-----------+--------+----------+----------------
LIVE | CURRENT | LIVE | CONFIG | LIVE & CONFIG
But after the commit removing virDomainSetMemory usage it changed to:
no option | --current | --live | --config | --live --config
----------+-----------+--------+-----------------+----------------
LIVE | CURRENT | LIVE | LIVE & CONFIG | LIVE & CONFIG
This commit fixes the logic back to the original behavior except for
ESX, HyperV and Virtuozzo drivers where virDomainSetMemory() default
behavior was CURRENT instead of LIVE.
Fixes: ce8138564bba0def7d7195814fba4555915d60d5
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1980199
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
tools/virsh-domain.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 6fb057736b..f9962f0515 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -9005,10 +9005,15 @@ cmdSetmem(vshControl *ctl, const vshCmd *cmd)
VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
VSH_EXCLUSIVE_OPTIONS_VAR(current, config);
- if (current)
+ if (config || live || current) {
flags = VIR_DOMAIN_AFFECT_CURRENT;
- if (config)
- flags |= VIR_DOMAIN_AFFECT_CONFIG;
+
+ if (config)
+ flags |= VIR_DOMAIN_AFFECT_CONFIG;
+
+ if (live)
+ flags |= VIR_DOMAIN_AFFECT_LIVE;
+ }
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
--
2.31.1
3 years, 5 months
Re: [PULL 37/48] usb: build usb-host as module
by Peter Krempa
adding libvirt-list
On Thu, Jul 08, 2021 at 17:17:37 +0200, Paolo Bonzini wrote:
> From: Gerd Hoffmann <kraxel(a)redhat.com>
>
> Drop one more shared library dependency (libusb) from core qemu.
>
> Signed-off-by: Gerd Hoffmann <kraxel(a)redhat.com>
> Reviewed-by: Jose R. Ziviani <jziviani(a)suse.de>
> Message-Id: <20210624103836.2382472-34-kraxel(a)redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
> ---
> hw/usb/host-libusb.c | 1 +
> hw/usb/meson.build | 8 ++++++--
> 2 files changed, 7 insertions(+), 2 deletions(-)
After this commit libvirt is no longer detecting the 'hostdevice'
property of 'usb-host'. In fact 'device-list-properties' is returning:
"desc": "Device 'usb-host' not found"
> diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
> index 2b7f87872c..c0f314462a 100644
> --- a/hw/usb/host-libusb.c
> +++ b/hw/usb/host-libusb.c
> @@ -1777,6 +1777,7 @@ static TypeInfo usb_host_dev_info = {
> .class_init = usb_host_class_initfn,
> .instance_init = usb_host_instance_init,
> };
> +module_obj(TYPE_USB_HOST_DEVICE);
>
> static void usb_host_register_types(void)
> {
> diff --git a/hw/usb/meson.build b/hw/usb/meson.build
> index 817f3e027a..3ca6127937 100644
> --- a/hw/usb/meson.build
> +++ b/hw/usb/meson.build
> @@ -72,8 +72,12 @@ if usbredir.found()
> endif
>
> # usb pass-through
> -softmmu_ss.add(when: ['CONFIG_USB', libusb],
> - if_true: files('host-libusb.c'))
> +if config_host.has_key('CONFIG_USB_LIBUSB')
The problem is in this condition as it's evaluated as false. When I
replace it with libusb.found(), everything works as it used to.
Unfortunately I don't know what the real goa behind using
CONFIG_USB_LIBUSB here was to see whether my approach is good.
> + usbhost_ss = ss.source_set()
> + usbhost_ss.add(when: ['CONFIG_USB', libusb],
> + if_true: files('host-libusb.c'))
> + hw_usb_modules += {'host': usbhost_ss}
> +endif
>
> softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN', libusb], if_true: files('xen-usb.c'))
>
> --
> 2.31.1
>
>
>
3 years, 5 months
[libvirt PATCH] nodedev: Handle inactive mdevs with the same UUID
by Jonathon Jongsma
Unfortunately, mdevctl supports defining more than one mdev with the
same UUID as long as they have different parent devices. So we can't use
the UUID alone as a way to uniquely identify these node devices. Append
the parent name to ensure uniqueness. For example:
Before: mdev_88a6b868_46bd_4015_8e5b_26107f82da38
After: mdev_88a6b868_46bd_4015_8e5b_26107f82da38_0000_00_02_0
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1979440
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
QUESTION: Is there any expectation of stability in these device names? I'm not
sure to what extent these changes might affect users. Given that support for
persistent mdevs is fairly new, there are likely not many users yet.
src/node_device/node_device_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index b4dd57e5f4..89dc704162 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -1038,7 +1038,7 @@ nodeDeviceGetMdevctlListCommand(bool defined,
static void mdevGenerateDeviceName(virNodeDeviceDef *dev)
{
- nodeDeviceGenerateName(dev, "mdev", dev->caps->data.mdev.uuid, NULL);
+ nodeDeviceGenerateName(dev, "mdev", dev->caps->data.mdev.uuid, dev->parent);
}
--
2.31.1
3 years, 5 months
[libvirt PATCH] ci: Adapt to lcitool command line changes
by Andrea Bolognani
lcitool now uses the term "target" instead of "host" to refer to
the various operating systems it supports, and we need to adapt
our helper script so that it works with the new command line
interface.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Getting this ready for when
https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/92
is merged.
ci/helper | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/ci/helper b/ci/helper
index 2c3a9f8db4..441258f511 100755
--- a/ci/helper
+++ b/ci/helper
@@ -190,18 +190,18 @@ class Application:
output = subprocess.check_output([self._args.lcitool] + args)
return output.decode("utf-8")
- def _lcitool_get_hosts(self):
- output = self._lcitool_run(["hosts"])
+ def _lcitool_get_targets(self):
+ output = self._lcitool_run(["targets"])
return output.splitlines()
- def _generate_dockerfile(self, host, cross=None):
- args = ["dockerfile", host, "libvirt"]
+ def _generate_dockerfile(self, target, cross=None):
+ args = ["dockerfile", target, "libvirt"]
outdir = self._basedir.joinpath("containers")
- outfile = f"{host}.Dockerfile"
+ outfile = f"{target}.Dockerfile"
if cross:
args.extend(["--cross", cross])
- outfile = f"{host}-cross-{cross}.Dockerfile"
+ outfile = f"{target}-cross-{cross}.Dockerfile"
outpath = outdir.joinpath(outfile)
if not self._args.quiet:
@@ -211,10 +211,10 @@ class Application:
with open(outpath, "w") as f:
f.write(output)
- def _generate_vars(self, host):
- args = ["variables", host, "libvirt"]
+ def _generate_vars(self, target):
+ args = ["variables", target, "libvirt"]
outdir = self._basedir.joinpath("cirrus")
- outfile = f"{host}.vars"
+ outfile = f"{target}.vars"
outpath = outdir.joinpath(outfile)
if not self._args.quiet:
@@ -241,37 +241,37 @@ class Application:
"mingw64",
]
- for host in self._lcitool_get_hosts():
- if host.startswith("freebsd-") or host.startswith("macos-"):
+ for target in self._lcitool_get_targets():
+ if target.startswith("freebsd-") or target.startswith("macos-"):
continue
- self._generate_dockerfile(host)
+ self._generate_dockerfile(target)
- if host == "fedora-rawhide":
+ if target == "fedora-rawhide":
for cross in fedora_cross:
- self._generate_dockerfile(host, cross)
+ self._generate_dockerfile(target, cross)
- if host.startswith("debian-"):
+ if target.startswith("debian-"):
for cross in debian_cross:
- if host == "debian-sid" and cross == "mips":
+ if target == "debian-sid" and cross == "mips":
continue
- self._generate_dockerfile(host, cross)
+ self._generate_dockerfile(target, cross)
def _refresh_cirrus(self):
- for host in self._lcitool_get_hosts():
- if not (host.startswith("freebsd-") or host.startswith("macos-")):
+ for target in self._lcitool_get_targets():
+ if not (target.startswith("freebsd-") or target.startswith("macos-")):
continue
- self._generate_vars(host)
+ self._generate_vars(target)
def _check_stale_images(self):
namespace = self._args.namespace
gitlab_uri = self._args.gitlab_uri
registry_uri = util.get_registry_uri(namespace, gitlab_uri)
- lcitool_hosts = self._lcitool_get_hosts()
+ lcitool_targets = self._lcitool_get_targets()
stale_images = util.get_registry_stale_images(registry_uri,
- lcitool_hosts)
+ lcitool_targets)
if stale_images:
spacing = "\n" + 4 * " "
stale_fmt = [f"{k} (ID: {v})" for k, v in stale_images.items()]
--
2.31.1
3 years, 5 months
[PATCH v3] nodedev: fix internal error when no defined mdevs exist
by Boris Fiuczynski
Commit e9b534905f4 introduced an error when parsing an empty list
returned from mdevctl.
This occurs e.g. if nodedev-undefine is used to undefine the last
defined mdev which causes the following error messages
libvirtd[33143]: internal error: Unexpected format for mdevctl response
libvirtd[33143]: internal error: failed to query mdevs from mdevctl:
libvirtd[33143]: mdevctl failed to updated mediated devices
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
Reviewed-by: Shalini Chellathurai Saroja <shalini(a)linux.ibm.com>
Reviewed-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/node_device/node_device_driver.c | 6 ++++++
tests/nodedevmdevctldata/mdevctl-list-empty.json | 1 +
tests/nodedevmdevctldata/mdevctl-list-empty.out.xml | 0
tests/nodedevmdevctltest.c | 1 +
4 files changed, 8 insertions(+)
create mode 100644 tests/nodedevmdevctldata/mdevctl-list-empty.json
create mode 100644 tests/nodedevmdevctldata/mdevctl-list-empty.out.xml
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 17a7aea2bb..6f8968f1f0 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -1139,6 +1139,12 @@ nodeDeviceParseMdevctlJSON(const char *jsonstring,
goto error;
}
+ if (virJSONValueArraySize(json_devicelist) == 0) {
+ VIR_DEBUG("mdevctl has no defined mediated devices");
+ *devs = NULL;
+ return 0;
+ }
+
/* mdevctl list --dumpjson produces an output that is an array that
* contains only a single object which contains a property for each parent
* device */
diff --git a/tests/nodedevmdevctldata/mdevctl-list-empty.json b/tests/nodedevmdevctldata/mdevctl-list-empty.json
new file mode 100644
index 0000000000..fe51488c70
--- /dev/null
+++ b/tests/nodedevmdevctldata/mdevctl-list-empty.json
@@ -0,0 +1 @@
+[]
diff --git a/tests/nodedevmdevctldata/mdevctl-list-empty.out.xml b/tests/nodedevmdevctldata/mdevctl-list-empty.out.xml
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/nodedevmdevctltest.c b/tests/nodedevmdevctltest.c
index 8ba1d2da70..e246de4d87 100644
--- a/tests/nodedevmdevctltest.c
+++ b/tests/nodedevmdevctltest.c
@@ -360,6 +360,7 @@ mymain(void)
DO_TEST_LIST_DEFINED();
+ DO_TEST_PARSE_JSON("mdevctl-list-empty");
DO_TEST_PARSE_JSON("mdevctl-list-multiple");
DO_TEST_DEFINE("mdev_d069d019_36ea_4111_8f0a_8c9a70e21366");
--
2.31.1
3 years, 5 months
Re: [PULL 36/40] vl: switch -M parsing to keyval
by Peter Krempa
CC libvir-list
On Tue, Jul 06, 2021 at 12:01:37 +0200, Paolo Bonzini wrote:
> Switch from QemuOpts to keyval. This enables the introduction
> of non-scalar machine properties, and JSON syntax in the future.
>
> For JSON syntax to be supported right now, we would have to
> consider what would happen if string-based dictionaries (produced by
> -M key=val) were to be merged with strongly-typed dictionaries
> (produced by -M {'key': 123}).
>
> The simplest way out is to never enter the situation, and only allow one
> -M option when JSON syntax is in use. However, we want options such as
> -smp to become syntactic sugar for -M, and this is a problem; as soon
> as -smp becomes a shortcut for -M, QEMU would forbid using -M '{....}'
> together with -smp. Therefore, allowing JSON syntax right now for -M
> would be a forward-compatibility nightmare and it would be impossible
> anyway to introduce -M incrementally in tools.
>
> Instead, support for JSON syntax is delayed until after the main
> options are converted to QOM compound properties. These include -boot,
> -acpitable, -smbios, -m, -semihosting-config, -rtc and -fw_cfg. Once JSON
> syntax is introduced, these options will _also_ be forbidden together
> with -M '{...}'.
>
> Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
> ---
> softmmu/vl.c | 315 ++++++++++++++++++++++++---------------------------
> 1 file changed, 146 insertions(+), 169 deletions(-)
This patch breaks detection of certain machine options features in
libvirt which were being detected from 'query-command-line-options'.
I presume the change simply removed this from the output of
query-command-line-options due to the historical cruft how the
aforementioned command works.
Unfortunately I didn't find any suitable replacement from what we are
querying.
The entries which we now lack detection are:
{ "machine", "mem-merge", QEMU_CAPS_MEM_MERGE },
{ "machine", "aes-key-wrap", QEMU_CAPS_AES_KEY_WRAP },
{ "machine", "dea-key-wrap", QEMU_CAPS_DEA_KEY_WRAP },
{ "machine", "kernel_irqchip", QEMU_CAPS_MACHINE_KERNEL_IRQCHIP },
{ "machine", "loadparm", QEMU_CAPS_LOADPARM },
Note that the oldest supported qemu version in libvirt is 2.11 at this
point and all the above flags are included in 2.11 and later.
This means we can theoretically remove the detection and always assume
the flags in case when they are unlikely to be removed in the future.
Alternatively if you can suggest an option how to detect this it will be
welcome.
Thanks
Peter
3 years, 5 months
[PATCH] qemuxml2argvmock: Deduplicate some code
by Michal Privoznik
A stub implementation for virQEMUCapsGetKVMSupportsSecureGuest()
was added recently. However, the very same implementation was
added to domaincapsmock.c which is also loaded by
qemuxml2argvtest and thus one occurrence of the stub can be
dropped.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/qemuxml2argvmock.c | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
index d7f77eabf7..9235c785b2 100644
--- a/tests/qemuxml2argvmock.c
+++ b/tests/qemuxml2argvmock.c
@@ -302,18 +302,3 @@ virIdentityEnsureSystemToken(void)
{
return g_strdup("3de80bcbf22d4833897f1638e01be9b2");
}
-
-static bool (*real_virQEMUCapsGetKVMSupportsSecureGuest)(virQEMUCaps *qemuCaps);
-
-bool
-virQEMUCapsGetKVMSupportsSecureGuest(virQEMUCaps *qemuCaps)
-{
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_CONFIDENTAL_GUEST_SUPPORT) &&
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_S390_PV_GUEST))
- return true;
-
- if (!real_virQEMUCapsGetKVMSupportsSecureGuest)
- VIR_MOCK_REAL_INIT(virQEMUCapsGetKVMSupportsSecureGuest);
-
- return real_virQEMUCapsGetKVMSupportsSecureGuest(qemuCaps);
-}
--
2.31.1
3 years, 5 months
[libvirt PATCH] qemuxml2argvmock: drop virQEMUCapsGetKVMSupportsSecureGuest
by Pavel Hrdina
It is actually not needed because in qemuxml2argvtest we preload
domaincapsmock as well.
Reported-by: Michal Privoznik <mprivozn(a)redhat.com>
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
tests/qemuxml2argvmock.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
index d7f77eabf7..2265492f1e 100644
--- a/tests/qemuxml2argvmock.c
+++ b/tests/qemuxml2argvmock.c
@@ -41,7 +41,6 @@
#include "virutil.h"
#include "qemu/qemu_interface.h"
#include "qemu/qemu_command.h"
-#include "qemu/qemu_capabilities.h"
#include <time.h>
#include <unistd.h>
#include <fcntl.h>
@@ -302,18 +301,3 @@ virIdentityEnsureSystemToken(void)
{
return g_strdup("3de80bcbf22d4833897f1638e01be9b2");
}
-
-static bool (*real_virQEMUCapsGetKVMSupportsSecureGuest)(virQEMUCaps *qemuCaps);
-
-bool
-virQEMUCapsGetKVMSupportsSecureGuest(virQEMUCaps *qemuCaps)
-{
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_CONFIDENTAL_GUEST_SUPPORT) &&
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_S390_PV_GUEST))
- return true;
-
- if (!real_virQEMUCapsGetKVMSupportsSecureGuest)
- VIR_MOCK_REAL_INIT(virQEMUCapsGetKVMSupportsSecureGuest);
-
- return real_virQEMUCapsGetKVMSupportsSecureGuest(qemuCaps);
-}
--
2.31.1
3 years, 5 months