[PATCH] bhyve: relax emulator binary value check
by Roman Bogorodskiy
Currently, requesting domain capabilities fails when the specified
emulator binary does not equal to "/usr/sbin/bhyve". Relax this check
to allow any path with basename "bhyve", as it's a common case when
binary is specified without an absolute path.
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
I'm not sure how useful is this check in general: at this point we don't
use the user specified emulator value anyway, just use BHYVE constant.
Probably it would be better to just drop the entire "else" block?
src/bhyve/bhyve_driver.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 78c3241293..277be8dbb0 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -1647,11 +1647,14 @@ bhyveConnectGetDomainCapabilities(virConnectPtr conn,
if (emulatorbin == NULL) {
emulatorbin = "/usr/sbin/bhyve";
- } else if (STRNEQ(emulatorbin, "/usr/sbin/bhyve")) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("unknown emulator binary: %s"),
- emulatorbin);
- goto cleanup;
+ } else {
+ g_autofree char *emulatorbasename = g_path_get_basename(emulatorbin);
+ if (STRNEQ(emulatorbasename, "bhyve")) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("unknown emulator binary: %s"),
+ emulatorbin);
+ goto cleanup;
+ }
}
if (!(caps = virBhyveDomainCapsBuild(conn->privateData, emulatorbin,
--
2.30.0
4 years, 3 months
[PATCH] docs: Add 'known_hosts_verify' parameter for libssh(2) connection uris
by Jakob Meng
Parameter 'known_hosts_verify' is supported for some time now,
but it is not yet documented.
Ref.:
https://gitlab.com/libvirt/libvirt/-/blob/master/src/rpc/virnetsocket.c#L941
https://gitlab.com/libvirt/libvirt/-/blob/master/src/rpc/virnetsocket.c#L...
---
docs/uri.html.in | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/docs/uri.html.in b/docs/uri.html.in
index f96c2970a5..61917e77b4 100644
--- a/docs/uri.html.in
+++ b/docs/uri.html.in
@@ -421,6 +421,23 @@ Note that parameter values must be
<td colspan="2"/>
<td> Example: <code>known_hosts=/root/.ssh/known_hosts</code> </td>
</tr>
+ <tr>
+ <td>
+ <code>known_hosts_verify</code>
+ </td>
+ <td> libssh2, libssh </td>
+ <td>
+ If set to <code>normal</code> (default), then the user will be
+ asked to accept new host keys. If set to <code>auto</code>, new
+ host keys will be auto-accepted, but existing host keys will
+ still be validated. If set to <code>ignore</code>, this disables
+ client's strict host key checking.
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2"/>
+ <td> Example: <code>known_hosts_verify=ignore</code> </td>
+ </tr>
<tr>
<td>
<code>sshauth</code>
--
2.20.1
4 years, 3 months
[PULL v2 08/16] hw/i386: Remove the deprecated pc-1.x machine types
by Michael S. Tsirkin
From: Thomas Huth <thuth(a)redhat.com>
They have been deprecated since QEMU v5.0, time to remove them now.
Signed-off-by: Thomas Huth <thuth(a)redhat.com>
Message-Id: <20210203171832.483176-2-thuth(a)redhat.com>
Reviewed-by: Michael S. Tsirkin <mst(a)redhat.com>
Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
hw/i386/pc_piix.c | 94 --------------------------------
docs/system/deprecated.rst | 6 --
docs/system/removed-features.rst | 6 ++
3 files changed, 6 insertions(+), 100 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 6188c3e97e..2904b40163 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -359,18 +359,6 @@ static void pc_compat_1_4_fn(MachineState *machine)
pc_compat_1_5_fn(machine);
}
-static void pc_compat_1_3(MachineState *machine)
-{
- pc_compat_1_4_fn(machine);
-}
-
-/* PC compat function for pc-1.0 to pc-1.2 */
-static void pc_compat_1_2(MachineState *machine)
-{
- pc_compat_1_3(machine);
- x86_cpu_change_kvm_default("kvm-pv-eoi", NULL);
-}
-
static void pc_init_isa(MachineState *machine)
{
pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, TYPE_I440FX_PCI_DEVICE);
@@ -772,88 +760,6 @@ static void pc_i440fx_1_4_machine_options(MachineClass *m)
DEFINE_I440FX_MACHINE(v1_4, "pc-i440fx-1.4", pc_compat_1_4_fn,
pc_i440fx_1_4_machine_options);
-static void pc_i440fx_1_3_machine_options(MachineClass *m)
-{
- X86MachineClass *x86mc = X86_MACHINE_CLASS(m);
- static GlobalProperty compat[] = {
- PC_CPU_MODEL_IDS("1.3.0")
- { "usb-tablet", "usb_version", "1" },
- { "virtio-net-pci", "ctrl_mac_addr", "off" },
- { "virtio-net-pci", "mq", "off" },
- { "e1000", "autonegotiation", "off" },
- };
-
- pc_i440fx_1_4_machine_options(m);
- m->hw_version = "1.3.0";
- m->deprecation_reason = "use a newer machine type instead";
- x86mc->compat_apic_id_mode = true;
- compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat));
-}
-
-DEFINE_I440FX_MACHINE(v1_3, "pc-1.3", pc_compat_1_3,
- pc_i440fx_1_3_machine_options);
-
-
-static void pc_i440fx_1_2_machine_options(MachineClass *m)
-{
- static GlobalProperty compat[] = {
- PC_CPU_MODEL_IDS("1.2.0")
- { "nec-usb-xhci", "msi", "off" },
- { "nec-usb-xhci", "msix", "off" },
- { "qxl", "revision", "3" },
- { "qxl-vga", "revision", "3" },
- { "VGA", "mmio", "off" },
- };
-
- pc_i440fx_1_3_machine_options(m);
- m->hw_version = "1.2.0";
- compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat));
-}
-
-DEFINE_I440FX_MACHINE(v1_2, "pc-1.2", pc_compat_1_2,
- pc_i440fx_1_2_machine_options);
-
-
-static void pc_i440fx_1_1_machine_options(MachineClass *m)
-{
- static GlobalProperty compat[] = {
- PC_CPU_MODEL_IDS("1.1.0")
- { "virtio-scsi-pci", "hotplug", "off" },
- { "virtio-scsi-pci", "param_change", "off" },
- { "VGA", "vgamem_mb", "8" },
- { "vmware-svga", "vgamem_mb", "8" },
- { "qxl-vga", "vgamem_mb", "8" },
- { "qxl", "vgamem_mb", "8" },
- { "virtio-blk-pci", "config-wce", "off" },
- };
-
- pc_i440fx_1_2_machine_options(m);
- m->hw_version = "1.1.0";
- compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat));
-}
-
-DEFINE_I440FX_MACHINE(v1_1, "pc-1.1", pc_compat_1_2,
- pc_i440fx_1_1_machine_options);
-
-static void pc_i440fx_1_0_machine_options(MachineClass *m)
-{
- static GlobalProperty compat[] = {
- PC_CPU_MODEL_IDS("1.0")
- { TYPE_ISA_FDC, "check_media_rate", "off" },
- { "virtio-balloon-pci", "class", stringify(PCI_CLASS_MEMORY_RAM) },
- { "apic-common", "vapic", "off" },
- { TYPE_USB_DEVICE, "full-path", "no" },
- };
-
- pc_i440fx_1_1_machine_options(m);
- m->hw_version = "1.0";
- compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat));
-}
-
-DEFINE_I440FX_MACHINE(v1_0, "pc-1.0", pc_compat_1_2,
- pc_i440fx_1_0_machine_options);
-
-
typedef struct {
uint16_t gpu_device_id;
uint16_t pch_device_id;
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 6ac757ed9f..2fcac7861e 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -322,12 +322,6 @@ The 'scsi-disk' device is deprecated. Users should use 'scsi-hd' or
System emulator machines
------------------------
-``pc-1.0``, ``pc-1.1``, ``pc-1.2`` and ``pc-1.3`` (since 5.0)
-'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-These machine types are very old and likely can not be used for live migration
-from old QEMU versions anymore. A newer machine type should be used instead.
-
Raspberry Pi ``raspi2`` and ``raspi3`` machines (since 5.2)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
index 88b81a6156..c8481cafbd 100644
--- a/docs/system/removed-features.rst
+++ b/docs/system/removed-features.rst
@@ -136,6 +136,12 @@ mips ``fulong2e`` machine alias (removed in 6.0)
This machine has been renamed ``fuloong2e``.
+``pc-1.0``, ``pc-1.1``, ``pc-1.2`` and ``pc-1.3`` (removed in 6.0)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+These machine types were very old and likely could not be used for live
+migration from old QEMU versions anymore. Use a newer machine type instead.
+
Related binaries
----------------
--
MST
4 years, 3 months
[libvirt PATCH 0/6] APIs for reporting tainting and deprecation messages
by Daniel P. Berrangé
This is a follow up to
https://listman.redhat.com/archives/libvir-list/2021-January/msg00988.html
I pushed the first non-API parts of that series already.
This posting takes a different approach to the APIs. Instead of separte
APIs for tainting and deprecations, there is now one API for reporting
general informational messages. This is explicitly only targetted at
humans.
Daniel P. Berrangé (6):
conf: record deprecation messages against the domain
qemu: record deprecation messages against the domain
src: define virDomainGetMessages API
remote: add RPC support for the virDomainGetMessages API
qemu: implement virDomainGetMessages API
tools: report messages for 'dominfo' command
include/libvirt/libvirt-domain.h | 9 +++++
src/conf/domain_conf.c | 45 ++++++++++++++++++++--
src/conf/domain_conf.h | 5 +++
src/driver-hypervisor.h | 6 +++
src/libvirt-domain.c | 54 ++++++++++++++++++++++++++
src/libvirt_private.syms | 3 ++
src/libvirt_public.syms | 5 +++
src/qemu/qemu_domain.c | 5 +++
src/qemu/qemu_domain.h | 3 ++
src/qemu/qemu_driver.c | 59 +++++++++++++++++++++++++++++
src/qemu/qemu_process.c | 5 +++
src/remote/remote_daemon_dispatch.c | 45 ++++++++++++++++++++++
src/remote/remote_driver.c | 44 +++++++++++++++++++++
src/remote/remote_protocol.x | 21 +++++++++-
src/remote_protocol-structs | 11 ++++++
tools/virsh-domain-monitor.c | 13 +++++++
16 files changed, 329 insertions(+), 4 deletions(-)
--
2.29.2
4 years, 3 months
[PATCH 2/3] utils: Deprecate hex-with-suffix sizes
by Eric Blake
Supporting '0x20M' looks odd, particularly since we have an 'E' suffix
that is ambiguous between a hex digit and the extremely large exibyte
suffix, as well as a 'B' suffix for bytes. In practice, people using
hex inputs are specifying values in bytes (and would have written
0x2000000, or possibly relied on default_suffix in the case of
qemu_strtosz_MiB), and the use of scaling suffixes makes the most
sense for inputs in decimal (where the user would write 32M). But
rather than outright dropping support for hex-with-suffix, let's
follow our deprecation policy. Sadly, since qemu_strtosz() does not
have an Err** parameter, we pollute to stderr.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
docs/system/deprecated.rst | 8 ++++++++
util/cutils.c | 6 +++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 6ac757ed9fa7..c404c3926e6f 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -146,6 +146,14 @@ library enabled as a cryptography provider.
Neither the ``nettle`` library, or the built-in cryptography provider are
supported on FIPS enabled hosts.
+hexadecimal sizes with scaling multipliers (since 6.0)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Input parameters that take a size value should only use a size suffix
+(such as 'k' or 'M') when the base is written in decimal, and not when
+the value is hexadecimal. That is, '0x20M' is deprecated, and should
+be written either as '32M' or as '0x2000000'.
+
QEMU Machine Protocol (QMP) commands
------------------------------------
diff --git a/util/cutils.c b/util/cutils.c
index 0234763bd70b..75190565cbb5 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -264,7 +264,7 @@ static int do_strtosz(const char *nptr, const char **end,
int retval;
const char *endptr;
unsigned char c;
- bool mul_required = false;
+ bool mul_required = false, hex = false;
uint64_t val;
int64_t mul;
double fraction = 0.0;
@@ -309,6 +309,10 @@ static int do_strtosz(const char *nptr, const char **end,
c = *endptr;
mul = suffix_mul(c, unit);
if (mul > 0) {
+ if (hex) {
+ fprintf(stderr, "Using a multiplier suffix on hex numbers "
+ "is deprecated: %s\n", nptr);
+ }
endptr++;
} else {
mul = suffix_mul(default_suffix, unit);
--
2.30.0
4 years, 3 months
[libvirt PATCH v3 00/21] Add support for persistent mediated devices
by Jonathon Jongsma
This patch series follows the previously-merged series which added support for
transient mediated devices. This series expands mdev support to include
persistent device definitions. Again, it relies on mdevctl as the backend.
It follows the common libvirt pattern of APIs by adding the following new APIs
for node devices:
- virNodeDeviceDefineXML() - defines a persistent device
- virNodeDeviceUndefine() - undefines a persistent device
- virNodeDeviceCreate() - starts a previously-defined device
It also adds virsh commands mapping to these new APIs: nodedev-define,
nodedev-undefine, and nodedev-start.
Since we rely on mdevctl for the definition of ediated devices, we need a way
to stay up-to-date with devices that are defined by mdevctl (outside of
libvirt). The method for staying up-to-date is currently a little bit crude
due to the fact that mdevctl does not emit any events when new devices are
added or removed. As a workaround, we create a file monitor for the mdevctl
config directory and re-query mdevctl when we detect changes within that
directory. In the future, mdevctl may introduce a more elegant solution.
changes in v3:
- streamlined tests -- removed some unnecessary duplication
- split out patch to factor out node device name generation function
- split nodeDeviceParseMdevctlChildDevice() into a separate function
- added follow-up patch to remove space-padded alignment in header
- refactored the mdevctl update handling significantly:
- no longer a separate persistent thread that gets signaled by a timer
- now piggybacks onto the existing udev thread and signals the thread in t=
he
same way that the udev event does.
- Daniel suggested spawning a throw-away thread to handle mdevctl updates,
but that introduces the complexity of possibly serializing multiple
throw-away threads (e.g. if we get an 'created' event followed immediate=
ly
by a 'deleted' event, two threads may be spawned and we'd need to ensure
they are properly ordered)
- added virNodeDeviceObjListForEach() and virNodeDeviceObjListRemoveLocked()
to simplify removing devices that are removed from mdevctl.
- coding style fixes
- NOTE: per Erik's request, I experimented with changing the way that mdevctl
commands were generated and tested (e.g. introducing something like
virMdevctlGetCommand(def, MDEVCTL_COMMAND_<SUBCOMMAND>, ...)), but it was
too invasive and awkward and didn't seem worthwhile
Changes in v2:
- rebase to latest git master
Jonathon Jongsma (21):
tests: remove extra trailing semicolon
nodedev: introduce concept of 'active' node devices
nodedev: Add ability to filter by active state
nodedev: expose internal helper for naming devices
nodedev: add ability to list and parse defined mdevs
nodedev: add STOPPED/STARTED lifecycle events
nodedev: add mdevctl devices to node device list
nodedev: add helper functions to remove node devices
nodedev: handle mdevs that disappear from mdevctl
nodedev: rename dataReady to udevReady
nodedev: Refresh mdev devices when changes are detected
api: add virNodeDeviceDefineXML()
virsh: Add --active, --inactive, --all to nodedev-list
virsh: add nodedev-define command
nodedev: refactor tests to support mdev undefine
api: add virNodeDeviceUndefine()
virsh: Factor out function to find node device
virsh: add nodedev-undefine command
api: add virNodeDeviceCreate()
virsh: add "nodedev-start" command
libvirt-nodedev.h: remove space-padded alignment
examples/c/misc/event-test.c | 4 +
include/libvirt/libvirt-nodedev.h | 98 ++--
src/access/viraccessperm.c | 2 +-
src/access/viraccessperm.h | 6 +
src/conf/node_device_conf.h | 9 +
src/conf/virnodedeviceobj.c | 132 ++++-
src/conf/virnodedeviceobj.h | 19 +
src/driver-nodedev.h | 14 +
src/libvirt-nodedev.c | 115 ++++
src/libvirt_private.syms | 4 +
src/libvirt_public.syms | 3 +
src/node_device/node_device_driver.c | 538 +++++++++++++++++-
src/node_device/node_device_driver.h | 38 ++
src/node_device/node_device_udev.c | 308 ++++++++--
src/remote/remote_driver.c | 3 +
src/remote/remote_protocol.x | 40 +-
src/remote_protocol-structs | 16 +
src/rpc/gendispatch.pl | 1 +
...19_36ea_4111_8f0a_8c9a70e21366-define.argv | 1 +
...19_36ea_4111_8f0a_8c9a70e21366-define.json | 1 +
...39_495e_4243_ad9f_beb3f14c23d9-define.argv | 1 +
...39_495e_4243_ad9f_beb3f14c23d9-define.json | 1 +
...16_1ca8_49ac_b176_871d16c13076-define.argv | 1 +
...16_1ca8_49ac_b176_871d16c13076-define.json | 1 +
tests/nodedevmdevctldata/mdevctl-create.argv | 1 +
.../mdevctl-list-defined.argv | 1 +
.../mdevctl-list-multiple.json | 59 ++
.../mdevctl-list-multiple.out.xml | 39 ++
tests/nodedevmdevctltest.c | 222 +++++++-
tools/virsh-nodedev.c | 276 +++++++--
30 files changed, 1765 insertions(+), 189 deletions(-)
create mode 100644 tests/nodedevmdevctldata/mdev_d069d019_36ea_4111_8f0a_8c9=
a70e21366-define.argv
create mode 100644 tests/nodedevmdevctldata/mdev_d069d019_36ea_4111_8f0a_8c9=
a70e21366-define.json
create mode 100644 tests/nodedevmdevctldata/mdev_d2441d39_495e_4243_ad9f_beb=
3f14c23d9-define.argv
create mode 100644 tests/nodedevmdevctldata/mdev_d2441d39_495e_4243_ad9f_beb=
3f14c23d9-define.json
create mode 100644 tests/nodedevmdevctldata/mdev_fedc4916_1ca8_49ac_b176_871=
d16c13076-define.argv
create mode 100644 tests/nodedevmdevctldata/mdev_fedc4916_1ca8_49ac_b176_871=
d16c13076-define.json
create mode 100644 tests/nodedevmdevctldata/mdevctl-create.argv
create mode 100644 tests/nodedevmdevctldata/mdevctl-list-defined.argv
create mode 100644 tests/nodedevmdevctldata/mdevctl-list-multiple.json
create mode 100644 tests/nodedevmdevctldata/mdevctl-list-multiple.out.xml
--=20
2.26.2
4 years, 3 months
[PATCH 00/10] Introduce virtio-mem <memory/> model
by Michal Privoznik
Technically, this is another version of:
https://www.redhat.com/archives/libvir-list/2020-December/msg00199.html
But since virtio-pmem part is pushed now, I've reworked virtio-mem a bit
and sending it as a new series.
For curious ones, David summarized behaviour well when implementing
virtio-mem support in kernel:
https://lwn.net/Articles/755423/
For less curious ones:
# virsh update-memory $dom --requested-size 4G
adds additional 4GiB of RAM to guest;
# virsh update-memory $dom --requested-size 0
removes those 4GiB added earlier.
Patches are also available on my GitLab:
https://gitlab.com/MichalPrivoznik/libvirt/-/tree/virtio_mem_v3
Michal Prívozník (10):
virhostmem: Introduce virHostMemGetTHPSize()
qemu_capabilities: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI
conf: Introduce virtio-mem <memory/> model
qemu: Build command line for virtio-mem
qemu: Wire up <memory/> live update
qemu: Wire up MEMORY_DEVICE_SIZE_CHANGE event
qemu: Refresh the actual size of virtio-mem on monitor reconnect
qemu: Recalculate balloon on MEMORY_DEVICE_SIZE_CHANGE event and
reconnect
virsh: Introduce update-memory command
news: document recent virtio memory addition
NEWS.rst | 7 +
docs/formatdomain.rst | 42 +++-
docs/manpages/virsh.rst | 31 +++
docs/schemas/domaincommon.rng | 16 ++
src/conf/domain_conf.c | 100 ++++++++-
src/conf/domain_conf.h | 13 ++
src/conf/domain_validate.c | 39 ++++
src/libvirt_private.syms | 3 +
src/qemu/qemu_alias.c | 10 +-
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 13 +-
src/qemu/qemu_domain.c | 50 ++++-
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_domain_address.c | 37 ++-
src/qemu/qemu_driver.c | 211 +++++++++++++++++-
src/qemu/qemu_hotplug.c | 18 ++
src/qemu/qemu_hotplug.h | 5 +
src/qemu/qemu_monitor.c | 37 +++
src/qemu/qemu_monitor.h | 27 +++
src/qemu/qemu_monitor_json.c | 94 ++++++--
src/qemu/qemu_monitor_json.h | 5 +
src/qemu/qemu_process.c | 101 ++++++++-
src/qemu/qemu_validate.c | 8 +
src/security/security_apparmor.c | 1 +
src/security/security_dac.c | 2 +
src/security/security_selinux.c | 2 +
src/util/virhostmem.c | 63 ++++++
src/util/virhostmem.h | 3 +
tests/domaincapsmock.c | 9 +
.../caps_5.1.0.x86_64.xml | 1 +
.../caps_5.2.0.x86_64.xml | 1 +
...mory-hotplug-virtio-mem.x86_64-latest.args | 49 ++++
.../memory-hotplug-virtio-mem.xml | 66 ++++++
tests/qemuxml2argvtest.c | 1 +
...emory-hotplug-virtio-mem.x86_64-latest.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
tools/virsh-domain.c | 154 +++++++++++++
38 files changed, 1165 insertions(+), 60 deletions(-)
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml
create mode 120000 tests/qemuxml2xmloutdata/memory-hotplug-virtio-mem.x86_64-latest.xml
--
2.26.2
4 years, 3 months
[PATCH] qemuDomainAttachRedirdevDevice: Remove need_release variable
by Yi Li
Get rid of the 'need_release' variable.
Signed-off-by: Yi Li <yili(a)winhong.com>
---
src/qemu/qemu_hotplug.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 882e5d2384..e07dba3c5e 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1921,18 +1921,16 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
bool chardevAdded = false;
g_autofree char *tlsAlias = NULL;
const char *secAlias = NULL;
- bool need_release = false;
virErrorPtr orig_err;
if (qemuAssignDeviceRedirdevAlias(def, redirdev, -1) < 0)
- goto cleanup;
+ return -1;
if (!(charAlias = qemuAliasChardevFromDevAlias(redirdev->info.alias)))
- goto cleanup;
+ return -1;
if ((virDomainUSBAddressEnsure(priv->usbaddrs, &redirdev->info)) < 0)
- goto cleanup;
- need_release = true;
+ return -1;
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, priv->qemuCaps)))
goto cleanup;
@@ -1964,7 +1962,7 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
audit:
virDomainAuditRedirdev(vm, redirdev, "attach", ret == 0);
cleanup:
- if (ret < 0 && need_release)
+ if (ret < 0)
qemuDomainReleaseDeviceAddress(vm, &redirdev->info);
return ret;
--
2.25.3
4 years, 3 months
[libvirt PATCH] Revert "tests: Avoid gnulib replacements in mocks"
by Andrea Bolognani
Now that we're no longer using gnulib, we can treat macOS the
same as all other targets.
This reverts commit 0ae6f5cea54d95c0d1dedf04a0a2accfe2529fb2
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Roman,
this seems to work fine both locally and on Cirrus CI[1], but
I'd like to have your thumbs up before pushing.
Thanks!
[1] https://gitlab.com/abologna/libvirt/-/jobs/1007362310
tests/virfilewrapper.c | 5 -----
tests/virmockstathelpers.c | 10 ----------
2 files changed, 15 deletions(-)
diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c
index ca2356b5c9..7034e22420 100644
--- a/tests/virfilewrapper.c
+++ b/tests/virfilewrapper.c
@@ -163,12 +163,7 @@ int access(const char *path, int mode)
return real_access(newpath ? newpath : path, mode);
}
-# ifdef __APPLE__
-int _open(const char *path, int flags, ...) __asm("_open");
-int _open(const char *path, int flags, ...)
-# else
int open(const char *path, int flags, ...)
-# endif
{
g_autofree char *newpath = NULL;
va_list ap;
diff --git a/tests/virmockstathelpers.c b/tests/virmockstathelpers.c
index 3bd2437ffe..49485cd360 100644
--- a/tests/virmockstathelpers.c
+++ b/tests/virmockstathelpers.c
@@ -204,12 +204,7 @@ static int virMockStatRedirect(const char *path, char **newpath);
#endif
#ifdef MOCK_STAT
-# ifdef __APPLE__
-int _stat(const char *path, struct stat *sb) __asm("_stat$INODE64");
-int _stat(const char *path, struct stat *sb)
-# else
int stat(const char *path, struct stat *sb)
-# endif
{
g_autofree char *newpath = NULL;
@@ -279,13 +274,8 @@ __xstat64(int ver, const char *path, struct stat64 *sb)
#endif
#ifdef MOCK_LSTAT
-# ifdef __APPLE__
-int _lstat(const char *path, struct stat *sb) __asm("_lstat$INODE64");
-int _lstat(const char *path, struct stat *sb)
-# else
int
lstat(const char *path, struct stat *sb)
-# endif
{
g_autofree char *newpath = NULL;
--
2.26.2
4 years, 3 months
[PATCH] util: Remove '\n' from vhostuser ifname
by Yalei Li
When deleting the vhostuserclient interface, OVS prompts that the interface does not exist,
Through the XML file, I found that the "target dev" has a '\n', results in an XML parsing error.
XML file:
<target dev='vm-20ac9c030a47
'/>
That is because 'ovs-vsctl' returns a newline result, always come with a '\n',
and the vircommandrun function puts it in ifname.
So virNetDevOpenvswitchGetVhostuserIfname should remove '\n' from ifname.
Signed-off-by: Yalei Li <liyl43(a)chinatelecom.cn>
---
src/util/virnetdevopenvswitch.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index f9b3369b2a..bd840bd3b7 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -575,6 +575,7 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path,
return 0;
}
+ virStringTrimOptionalNewline(*ifname);
if (virNetDevOpenvswitchMaybeUnescapeReply(*ifname) < 0) {
VIR_FREE(*ifname);
return -1;
--
2.27.0
4 years, 3 months