[PATCH 0/4] implement 'ras' feature support
by Kristina Hanicova
*** BLURB HERE ***
Kristina Hanicova (4):
Introduce QEMU_CAPS_MACHINE_VIRT_RAS capability
conf: parse and format machine virt ras feature
qemu: validate machine virt ras feature
qemu: format machine virt ras feature and test it
docs/formatdomain.rst | 5 +++
src/conf/domain_conf.c | 6 +++-
src/conf/domain_conf.h | 1 +
src/conf/schemas/domaincommon.rng | 5 +++
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 5 +++
src/qemu/qemu_validate.c | 16 ++++++++++
.../caps_5.2.0_aarch64.xml | 1 +
.../caps_6.0.0_aarch64.xml | 1 +
.../caps_6.2.0_aarch64.xml | 1 +
.../caps_7.0.0_aarch64+hvf.xml | 1 +
.../caps_7.0.0_aarch64.xml | 1 +
.../caps_8.2.0_aarch64.xml | 1 +
.../caps_8.2.0_armv7l.xml | 1 +
.../aarch64-features-ras.aarch64-latest.args | 31 +++++++++++++++++++
.../aarch64-features-ras.aarch64-latest.xml | 1 +
.../qemuxmlconfdata/aarch64-features-ras.xml | 26 ++++++++++++++++
tests/qemuxmlconftest.c | 2 ++
19 files changed, 107 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxmlconfdata/aarch64-features-ras.aarch64-latest.args
create mode 120000 tests/qemuxmlconfdata/aarch64-features-ras.aarch64-latest.xml
create mode 100644 tests/qemuxmlconfdata/aarch64-features-ras.xml
--
2.42.0
11 months, 2 weeks
introduce virDomainJobWait for dump plus testing
by Thanos Makatos
This patch series introduces funcionality for waiting for a job from a
different context, for now only for dump jobs, plus testing.
This can be useful in situations where the original requester of the job
crashes/restarts and then needs to continue waiting for that potentially
ongoing job. To avoid waiting for the wrong job type, the caller must
specify the required job type. For now I've only implemented this for
dump jobs; if the logic is correct I can extended it for all other job
types.
The first patch introduces the core functionality. I see that there is a
function specifically for waiting for a dump job:
qemuDumpWaitForCompletion. Ideally we should only use
qemuDomainObjWait, which would work for any job type, however I'm not
sure it's correct to use it instead of qemuDumpWaitForCompletion because
the latter checks dumpCompleted. It's not obvious to me what is the
purpose of dumpCompleted, is it because qemuDomainObjWait can return
because some other job, running in parallel with the dump job, has
completed, so it's effectively a false alarm?
The second patch is mainly for testing the wait functionality via virsh.
The remaining patches extend the test hypervisor's functionality on dump
testing.
11 months, 2 weeks
[PATCH v3 00/27] [PATCH v3 00/27] native support for nftables in virtual network driver
by Laine Stump
V2: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/5R...
This patch series enables libvirt to use nftables rules rather than
iptables *when setting up virtual networks* (it does *not* add
nftables support to the nwfilter driver).
I've added the Reviewed-by's from Daniel where given in V2 (as long as
I haven't made any non-trivial changes). That includes patches 1-9,
11-13, 16, 20, and 22.
Changes from V2 - mainly I've addressed the issues that Dan pointed
out in his reviews (details in each patch). Functionally the main changes are:
1) You can now choose whether iptables or nftables should be the
default backend with the new meson option "firewall_backend" (which
is set to "nftables" by default).
2) rpm spec now requires iptables or nftables (rather than
recommending both)
3) The <firewall> element in the network status XML now has a
"name='fwRemoval'" attribute, just in case we ever add another
<firewall> element to keep track of all the commands that were run
to create the firewall as well as the commands needed to remove it.
4) Failure to find the binary needed for any firewall backend now
results in an error log and termination of the daemon.
Laine Stump (27):
util/network: move viriptables.[ch] from util to network directory
network: move all functions manipulating iptables rules into
network_iptables.c
network: make all iptables functions used only in network_iptables.c
static
util: #define the names used for private packet filter chains
util: change name of virFirewallRule to virFirewallCmd
util: rename virNetFilterAction to iptablesAction, and add
VIR_ENUM_DECL/IMPL
util: check for 0 args when applying iptables rule
util: add -w/--concurrent when applying a FirewallCmd rather than when
building it
util: determine ignoreErrors value when creating virFirewallCmd, not
when applying
util/network: new virFirewallBackend enum
network: add (empty) network.conf file to distribution files
network: support setting firewallBackend from network.conf
network: framework to call backend-specific function to init private
filter chains
util: new functions to support adding individual firewall rollback
commands
util: implement rollback rule autocreation for iptables commands
network: turn on auto-rollback for the rules added for virtual
networks
util: add name attribute to virFirewall
util: new function virFirewallNewFromRollback()
util: new functions virFirewallParseXML() and virFirewallFormat()
conf: add a virFirewall object to virNetworkObj
network: use previously saved list of firewall removal commands
network: save network status when firewall rules are reloaded
meson: stop looking for iptables/ip6tables/ebtables at build time
network: add an nftables backend for network driver's firewall
construction
tests: test cases for nftables backend
network: prefer the nftables backend over iptables
spec: require either iptables or nftables if network driver is
installed
libvirt.spec.in | 7 +-
meson.build | 10 +-
meson_options.txt | 1 +
po/POTFILES | 3 +-
src/conf/virnetworkobj.c | 47 +
src/conf/virnetworkobj.h | 11 +
src/libvirt_private.syms | 59 +-
src/network/bridge_driver.c | 35 +-
src/network/bridge_driver_conf.c | 64 +
src/network/bridge_driver_conf.h | 3 +
src/network/bridge_driver_linux.c | 630 +------
src/network/bridge_driver_nop.c | 6 +-
src/network/bridge_driver_platform.h | 6 +-
src/network/libvirtd_network.aug | 39 +
src/network/meson.build | 36 +
src/network/network.conf.in | 28 +
src/network/network_iptables.c | 1677 +++++++++++++++++
src/network/network_iptables.h | 30 +
src/network/network_nftables.c | 940 +++++++++
src/network/network_nftables.h | 28 +
src/network/test_libvirtd_network.aug.in | 5 +
src/nwfilter/nwfilter_ebiptables_driver.c | 1004 +++++-----
src/util/meson.build | 1 -
src/util/virebtables.c | 36 +-
src/util/virfirewall.c | 820 ++++++--
src/util/virfirewall.h | 87 +-
src/util/viriptables.c | 1072 -----------
src/util/viriptables.h | 155 --
.../{base.args => base.iptables} | 0
tests/networkxml2firewalldata/base.nftables | 256 +++
...-linux.args => nat-default-linux.iptables} | 0
.../nat-default-linux.nftables | 248 +++
...pv6-linux.args => nat-ipv6-linux.iptables} | 0
.../nat-ipv6-linux.nftables | 384 ++++
...rgs => nat-ipv6-masquerade-linux.iptables} | 0
.../nat-ipv6-masquerade-linux.nftables | 456 +++++
...linux.args => nat-many-ips-linux.iptables} | 0
.../nat-many-ips-linux.nftables | 472 +++++
...-linux.args => nat-no-dhcp-linux.iptables} | 0
.../nat-no-dhcp-linux.nftables | 384 ++++
...ftp-linux.args => nat-tftp-linux.iptables} | 0
.../nat-tftp-linux.nftables | 274 +++
...inux.args => route-default-linux.iptables} | 0
.../route-default-linux.nftables | 162 ++
tests/networkxml2firewalltest.c | 56 +-
tests/virfirewalltest.c | 424 ++---
46 files changed, 7205 insertions(+), 2751 deletions(-)
create mode 100644 src/network/libvirtd_network.aug
create mode 100644 src/network/network.conf.in
create mode 100644 src/network/network_iptables.c
create mode 100644 src/network/network_iptables.h
create mode 100644 src/network/network_nftables.c
create mode 100644 src/network/network_nftables.h
create mode 100644 src/network/test_libvirtd_network.aug.in
delete mode 100644 src/util/viriptables.c
delete mode 100644 src/util/viriptables.h
rename tests/networkxml2firewalldata/{base.args => base.iptables} (100%)
create mode 100644 tests/networkxml2firewalldata/base.nftables
rename tests/networkxml2firewalldata/{nat-default-linux.args => nat-default-linux.iptables} (100%)
create mode 100644 tests/networkxml2firewalldata/nat-default-linux.nftables
rename tests/networkxml2firewalldata/{nat-ipv6-linux.args => nat-ipv6-linux.iptables} (100%)
create mode 100644 tests/networkxml2firewalldata/nat-ipv6-linux.nftables
rename tests/networkxml2firewalldata/{nat-ipv6-masquerade-linux.args => nat-ipv6-masquerade-linux.iptables} (100%)
create mode 100644 tests/networkxml2firewalldata/nat-ipv6-masquerade-linux.nftables
rename tests/networkxml2firewalldata/{nat-many-ips-linux.args => nat-many-ips-linux.iptables} (100%)
create mode 100644 tests/networkxml2firewalldata/nat-many-ips-linux.nftables
rename tests/networkxml2firewalldata/{nat-no-dhcp-linux.args => nat-no-dhcp-linux.iptables} (100%)
create mode 100644 tests/networkxml2firewalldata/nat-no-dhcp-linux.nftables
rename tests/networkxml2firewalldata/{nat-tftp-linux.args => nat-tftp-linux.iptables} (100%)
create mode 100644 tests/networkxml2firewalldata/nat-tftp-linux.nftables
rename tests/networkxml2firewalldata/{route-default-linux.args => route-default-linux.iptables} (100%)
create mode 100644 tests/networkxml2firewalldata/route-default-linux.nftables
--
2.44.0
11 months, 2 weeks
[PATCH 0/6] migration removals & deprecations
by Fabiano Rosas
Hi everyone,
Here's some cleaning up of deprecated code. It removes the old block
migration and compression code. Both have suitable replacements in the
form of the blockdev-mirror driver and multifd compression,
respectively.
There's also a deprecation for fd: + file to cope with the fact that
the new MigrationAddress API defines transports instead of protocols
(loose terms) like the old string API did. So we cannot map 1:1 from
fd: to any transport because fd: allows *both* file migration and
socket migration.
CI run: https://gitlab.com/farosas/qemu/-/pipelines/1267859704
Fabiano Rosas (6):
migration: Remove 'skipped' field from MigrationStats
migration: Remove 'inc' option from migrate command
migration: Remove 'blk/-b' option from migrate commands
migration: Remove block migration
migration: Remove non-multifd compression
migration: Deprecate fd: for file migration
.gitlab-ci.d/buildtest.yml | 2 +-
MAINTAINERS | 1 -
docs/about/deprecated.rst | 51 +-
docs/about/removed-features.rst | 104 ++-
docs/devel/migration/main.rst | 2 +-
hw/core/machine.c | 1 -
include/migration/misc.h | 6 -
meson.build | 2 -
meson_options.txt | 2 -
migration/block.c | 1019 ------------------------------
migration/block.h | 52 --
migration/colo.c | 1 -
migration/meson.build | 4 -
migration/migration-hmp-cmds.c | 97 +--
migration/migration.c | 70 +-
migration/migration.h | 7 -
migration/options.c | 229 -------
migration/ram-compress.c | 564 -----------------
migration/ram.c | 166 +----
migration/savevm.c | 5 -
qapi/migration.json | 205 +-----
scripts/meson-buildoptions.sh | 4 -
tests/qemu-iotests/183 | 147 -----
tests/qemu-iotests/183.out | 66 --
tests/qemu-iotests/common.filter | 7 -
tests/qtest/migration-test.c | 139 ----
26 files changed, 130 insertions(+), 2823 deletions(-)
delete mode 100644 migration/block.c
delete mode 100644 migration/block.h
delete mode 100644 migration/ram-compress.c
delete mode 100755 tests/qemu-iotests/183
delete mode 100644 tests/qemu-iotests/183.out
--
2.35.3
11 months, 2 weeks
[PATCH] vmx: Check serialX.vspc before serialX.fileName
by Martin Kletzander
When using vSPC (Virtual Serial Port Concentrator) in vSphere the actual
address for it is saved in serialX.vspc in which case the
serialX.fileName is most probably something we can't get any useful
information from and we also fail during the parsing rendering any
dumpxml and similar tries unsuccessful.
Instead of parsing the vspc URL with something along the lines of
`virURIParse(vspc ? vspc : fileName)`, which could lead to us reporting
information that is very prune to misuse (the vSPC seemingly has a
protocol on top of the telnet connection; redefining the domain would
change the behaviour; the URL might have a fragment we are not saving;
etc.) or adding more XML knobs to indicate vSPC usage (which we would
not be able to configure; we'd have to properly error out everywhere;
etc.) let's just report dummy serial port that leads to nowhere.
Resolves: https://issues.redhat.com/browse/RHEL-32182
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/vmx/vmx.c | 12 +++
tests/vmx2xmldata/esx-in-the-wild-13.vmx | 97 ++++++++++++++++++++++++
tests/vmx2xmldata/esx-in-the-wild-13.xml | 55 ++++++++++++++
tests/vmx2xmltest.c | 1 +
4 files changed, 165 insertions(+)
create mode 100644 tests/vmx2xmldata/esx-in-the-wild-13.vmx
create mode 100644 tests/vmx2xmldata/esx-in-the-wild-13.xml
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 5da67aae60d9..32074f62e14c 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -2975,6 +2975,9 @@ virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port,
char fileName_name[48] = "";
g_autofree char *fileName = NULL;
+ char vspc_name[48] = "";
+ g_autofree char *vspc = NULL;
+
char network_endPoint_name[48] = "";
g_autofree char *network_endPoint = NULL;
@@ -2997,6 +3000,7 @@ virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port,
VMX_BUILD_NAME(startConnected);
VMX_BUILD_NAME(fileType);
VMX_BUILD_NAME(fileName);
+ VMX_BUILD_NAME(vspc);
VMX_BUILD_NAME_EXTRA(network_endPoint, "network.endPoint");
/* vmx:present */
@@ -3026,6 +3030,10 @@ virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port,
if (virVMXGetConfigString(conf, fileName_name, &fileName, true) < 0)
goto cleanup;
+ /* vmx:fileName -> def:data.file.path */
+ if (virVMXGetConfigString(conf, vspc_name, &vspc, true) < 0)
+ goto cleanup;
+
/* vmx:network.endPoint -> def:data.tcp.listen */
if (virVMXGetConfigString(conf, network_endPoint_name, &network_endPoint,
true) < 0) {
@@ -3057,6 +3065,10 @@ virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port,
(*def)->target.port = port;
(*def)->source->type = VIR_DOMAIN_CHR_TYPE_PIPE;
(*def)->source->data.file.path = g_steal_pointer(&fileName);
+ } else if (STRCASEEQ(fileType, "network") && vspc) {
+ (*def)->target.port = port;
+ (*def)->source->type = VIR_DOMAIN_CHR_TYPE_FILE;
+ (*def)->source->data.file.path = g_strdup("/dev/null");
} else if (STRCASEEQ(fileType, "network")) {
(*def)->target.port = port;
(*def)->source->type = VIR_DOMAIN_CHR_TYPE_TCP;
diff --git a/tests/vmx2xmldata/esx-in-the-wild-13.vmx b/tests/vmx2xmldata/esx-in-the-wild-13.vmx
new file mode 100644
index 000000000000..1016acab28d8
--- /dev/null
+++ b/tests/vmx2xmldata/esx-in-the-wild-13.vmx
@@ -0,0 +1,97 @@
+.encoding = "UTF-8"
+config.version = "8"
+virtualHW.version = "19"
+vmci0.present = "TRUE"
+floppy0.present = "FALSE"
+memSize = "1024"
+tools.upgrade.policy = "manual"
+sched.cpu.units = "mhz"
+vm.createDate = "1704946351823519"
+scsi0.virtualDev = "lsilogic"
+scsi0.present = "TRUE"
+scsi0:0.deviceType = "scsi-hardDisk"
+scsi0:0.fileName = "Test-Mig-VM-1 (01ce57d0-4e20-41a5-8b6c-bcbf49a032ec)_2.vmdk"
+sched.scsi0:0.shares = "normal"
+sched.scsi0:0.throughputCap = "off"
+scsi0:0.present = "TRUE"
+ethernet0.virtualDev = "vmxnet3"
+ethernet0.opaqueNetwork.id = "25c9a00e-dc60-4918-89b7-41c951988366"
+ethernet0.opaqueNetwork.type = "nsx.LogicalSwitch"
+ethernet0.shares = "normal"
+ethernet0.addressType = "static"
+ethernet0.address = "fa:16:3e:bb:2c:4a"
+ethernet0.externalId = "4b57523e-35af-4f8d-b050-1a7410e1a307"
+ethernet0.uptCompatibility = "TRUE"
+ethernet0.present = "TRUE"
+ethernet0.networkName = "Test"
+serial0.fileType = "network"
+serial0.fileName = "ZmVybmV0IGdBQUFBQUJrdFotaW8yclpkRXR6N3dBcDdyYkFMaWFUMVd4RENJSHgtUXpkTlMyTzRRejI3V192QVlOVUY3ZU1SOTNHZXJrN1dGb2stS0EybmpwWFQ4NjJNNlgwc2ZDdmNlOE50eFNhcU1XdlNBTmdhazQ1T1J3LUI5OEZsSDdwMDBZa2R6bWt4Y1Ax"
+serial0.vspc = "telnets://10.28.100.26:18979#thumbprint=18:F5:79:E5:73:A5:22:83:C0:57:B9:B4:FA:CE:60:19:F1:12:F5:7B"
+serial0.yieldOnMsrRead = "TRUE"
+serial0.present = "TRUE"
+displayName = "Test-Mig-VM-1 (01ce57d0-4e20-41a5-8b6c-bcbf49a032ec)"
+annotation = "name:Test-Mig-VM-1|0Auserid:962314ba515c48388a0e95c0961709ff|0Ausername:admin|0Aprojectid:b06b5f77b6bb442f85b1c67cff980ef9|0Aprojectname:MIS|0Aflavor:name:mig-test-flavor|0Aflavor:memory_mb:1024|0Aflavor:vcpus:1|0Aflavor:ephemeral_gb:0|0Aflavor:root_gb:10|0Aflavor:swap:0|0Aimageid:8b90d6fa-20ab-4adf-8015-aad3dddb246c|0Apackage:20.6.2|0A"
+guestOS = "other-64"
+toolScripts.afterPowerOn = "TRUE"
+toolScripts.afterResume = "TRUE"
+toolScripts.beforeSuspend = "TRUE"
+toolScripts.beforePowerOff = "TRUE"
+tools.syncTime = "FALSE"
+uuid.bios = "42 1e b4 58 54 48 fc 12-20 74 83 d5 e4 19 e1 38"
+vc.uuid = "01 ce 57 d0 4e 20 41 a5-8b 6c bc bf 49 a0 32 ec"
+sched.cpu.latencySensitivity = "normal"
+tools.guest.desktop.autolock = "FALSE"
+nvram = "Test-Mig-VM-1 (01ce57d0-4e20-41a5-8b6c-bcbf49a032ec).nvram"
+svga.present = "TRUE"
+pciBridge0.present = "TRUE"
+pciBridge4.present = "TRUE"
+pciBridge4.virtualDev = "pcieRootPort"
+pciBridge4.functions = "8"
+pciBridge5.present = "TRUE"
+pciBridge5.virtualDev = "pcieRootPort"
+pciBridge5.functions = "8"
+pciBridge6.present = "TRUE"
+pciBridge6.virtualDev = "pcieRootPort"
+pciBridge6.functions = "8"
+pciBridge7.present = "TRUE"
+pciBridge7.virtualDev = "pcieRootPort"
+pciBridge7.functions = "8"
+hpet0.present = "TRUE"
+vio.imageId = "8b90d6fa-20ab-4adf-8015-aad3dddb246c"
+nvp.vm-uuid = "01ce57d0-4e20-41a5-8b6c-bcbf49a032ec"
+nvp.iface-id.0 = "4b57523e-35af-4f8d-b050-1a7410e1a307"
+smbios.assetTag = "OpenTelekomCloud"
+root-disk-uuid = "6000C294-db10-e2c6-963f-e4371d3605e8"
+numa.autosize.cookie = "10012"
+numa.autosize.vcpu.maxPerVirtualNode = "1"
+pciBridge0.pciSlotNumber = "17"
+pciBridge4.pciSlotNumber = "21"
+pciBridge5.pciSlotNumber = "22"
+pciBridge6.pciSlotNumber = "23"
+pciBridge7.pciSlotNumber = "24"
+scsi0.pciSlotNumber = "16"
+ethernet0.pciSlotNumber = "160"
+vmotion.checkpointFBSize = "4194304"
+vmotion.checkpointSVGAPrimarySize = "4194304"
+vmotion.svga.mobMaxSize = "4194304"
+vmotion.svga.graphicsMemoryKB = "4096"
+monitor.phys_bits_used = "45"
+softPowerOff = "FALSE"
+ctkEnabled = "TRUE"
+scsi0:0.ctkEnabled = "TRUE"
+svga.guestBackedPrimaryAware = "TRUE"
+viv.moid = "bd916f5e-a90b-46db-98e8-ce974fef34f4:vm-29145:1NineJhqocLZEZ6JOxn/hLdjlihTelLVQGc8mmAj3nA="
+migrate.hostLog = "Test-Mig-VM-1 (01ce57d0-4e20-41a5-8b6c-bcbf49a032ec)-7cedc035.hlog"
+sched.cpu.min = "0"
+sched.cpu.shares = "normal"
+sched.mem.min = "0"
+sched.mem.minSize = "0"
+sched.mem.shares = "normal"
+migrate.encryptionMode = "opportunistic"
+ftcpt.ftEncryptionMode = "ftEncryptionOpportunistic"
+sched.swap.derivedName = "/vmfs/volumes/642eff9a-0df93507-cca5-5c6f69c57c70/Test-Mig-VM-1 (01ce57d0-4e20-41a5-8b6c-bcbf49a032ec)/Test-Mig-VM-1 (01ce57d0-4e20-41a5-8b6c-bcbf49a032ec)-69fcc9f7.vswp"
+uuid.location = "56 4d c2 6b 03 eb b2 44-eb 36 8a 83 de 3f bd b6"
+scsi0:0.redo = ""
+vmci0.id = "-468065992"
+cleanShutdown = "TRUE"
+vmxstats.filename = "Test-Mig-VM-1 (01ce57d0-4e20-41a5-8b6c-bcbf49a032ec).scoreboard"
diff --git a/tests/vmx2xmldata/esx-in-the-wild-13.xml b/tests/vmx2xmldata/esx-in-the-wild-13.xml
new file mode 100644
index 000000000000..689282747779
--- /dev/null
+++ b/tests/vmx2xmldata/esx-in-the-wild-13.xml
@@ -0,0 +1,55 @@
+<domain type='vmware'>
+ <name>Test-Mig-VM-1 (01ce57d0-4e20-41a5-8b6c-bcbf49a032ec)</name>
+ <uuid>421eb458-5448-fc12-2074-83d5e419e138</uuid>
+ <description>name:Test-Mig-VM-1
+userid:962314ba515c48388a0e95c0961709ff
+username:admin
+projectid:b06b5f77b6bb442f85b1c67cff980ef9
+projectname:MIS
+flavor:name:mig-test-flavor
+flavor:memory_mb:1024
+flavor:vcpus:1
+flavor:ephemeral_gb:0
+flavor:root_gb:10
+flavor:swap:0
+imageid:8b90d6fa-20ab-4adf-8015-aad3dddb246c
+package:20.6.2
+</description>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <cputune>
+ <shares>1000</shares>
+ </cputune>
+ <os>
+ <type arch='x86_64'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <source file='[datastore] directory/Test-Mig-VM-1 (01ce57d0-4e20-41a5-8b6c-bcbf49a032ec)_2.vmdk'/>
+ <target dev='sda' bus='scsi'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='scsi' index='0' model='lsilogic'/>
+ <interface type='bridge'>
+ <mac address='fa:16:3e:bb:2c:4a' type='static'/>
+ <source bridge='Test'/>
+ <model type='vmxnet3'/>
+ </interface>
+ <serial type='file'>
+ <source path='/dev/null'/>
+ <target port='0'/>
+ </serial>
+ <console type='file'>
+ <source path='/dev/null'/>
+ <target type='serial' port='0'/>
+ </console>
+ <video>
+ <model type='vmvga' vram='4096' primary='yes'/>
+ </video>
+ </devices>
+</domain>
diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c
index 785eee6d3002..0fb5f13f72ce 100644
--- a/tests/vmx2xmltest.c
+++ b/tests/vmx2xmltest.c
@@ -263,6 +263,7 @@ mymain(void)
DO_TEST("esx-in-the-wild-10");
DO_TEST("esx-in-the-wild-11");
DO_TEST("esx-in-the-wild-12");
+ DO_TEST("esx-in-the-wild-13");
DO_TEST("gsx-in-the-wild-1");
DO_TEST("gsx-in-the-wild-2");
--
2.44.0
11 months, 2 weeks
[PATCH] fix detach disk device failed with device not found
by long.yunjian@zte.com.cn
From: Long YunJian <long.yunjian(a)zte.com.cn>
We detach windows disk with libvirt-python api dom.detachDeviceFlags(xmlstr,3),
but files in windows disk is opened and busy, and libvirt return success.
We found disk not detached actually. so, we close files those opened in windows,
and want to detach again. However, we failed with device not found but disk is
exist actually.
first time detach disk:
a. get vmdef from domain->newDef here:
qemuDomainDetachDeviceLiveAndConfig
virDomainObjCopyPersistentDef
virDomainObjGetPersistentDef
domain->newDef
b. delete disk config here:
qemuDomainDetachDeviceLiveAndConfig
qemuDomainDetachDeviceConfig
virDomainDiskRemoveByName
virDomainDiskRemove
c. update from vmdef to newDef
qemuDomainDetachDeviceLiveAndConfig
virDomainObjAssignDef
domain->newDef = vmdef
second time detach disk:
get vmdef from domain->newDef here:
qemuDomainDetachDeviceLiveAndConfig
virDomainObjCopyPersistentDef
virDomainObjGetPersistentDef
domain->newDef
and then, report device not found here for disk config deleted at the first time:
qemuDomainDetachDeviceLiveAndConfig
qemuDomainDetachDeviceConfig
virDomainDiskRemoveByName
to fix this problem, let detach disk again, we add disk to config if timeout,
and let it deleted in processDeviceDeletedEvent if guestos detach disk successfinnaly.
Signed-off-by: Long YunJian <long.yunjian(a)zte.com.cn>
---
src/qemu/qemu_driver.c | 35 +++++++++++++++++++++++++++++++++++
src/qemu/qemu_hotplug.c | 12 +++++++++++-
tests/qemuhotplugtest.c | 2 +-
3 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d01f788aea..0ab661251c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3598,6 +3598,9 @@ processDeviceDeletedEvent(virQEMUDriver *driver,
const char *devAlias)
{
virDomainDeviceDef dev;
+ virDomainDiskDef *det_disk = NULL;
+ g_autofree char *disk_dst_name = NULL;
+ bool devicedisk = false;
VIR_DEBUG("Removing device %s from domain %p %s",
devAlias, vm, vm->def->name);
@@ -3616,8 +3619,19 @@ processDeviceDeletedEvent(virQEMUDriver *driver,
if (virDomainDefFindDevice(vm->def, devAlias, &dev, true) < 0)
goto endjob;
+ if (dev.type & VIR_DOMAIN_DEVICE_DISK) {
+ devicedisk = true;
+ disk_dst_name = g_strdup(dev.data.disk->dst);
+ }
+
if (qemuDomainRemoveDevice(driver, vm, &dev) < 0)
goto endjob;
+
+ if (devicedisk && disk_dst_name) {
+ if ((det_disk = virDomainDiskRemoveByName(vm->newDef, disk_dst_name))) {
+ virDomainDiskDefFree(det_disk);
+ }
+ }
}
qemuDomainSaveStatus(vm);
@@ -7491,6 +7505,7 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriver *driver,
g_autoptr(virDomainDeviceDef) dev_live = NULL;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE;
g_autoptr(virDomainDef) vmdef = NULL;
+ bool timeout = false;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG, -1);
@@ -7530,6 +7545,10 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriver *driver,
if ((rc = qemuDomainDetachDeviceLive(vm, dev_live, driver, false)) < 0)
return -1;
+ if (rc == 2) {
+ timeout = true;
+ rc = 0;
+ }
if (rc == 0 && qemuDomainUpdateDeviceList(vm, VIR_ASYNC_JOB_NONE) < 0)
return -1;
@@ -7542,6 +7561,22 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriver *driver,
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0)
return -1;
+ /* if timeout, add device to vmdef, and delete at processDeviceDeletedEvent */
+ if (timeout && (dev_config->type & VIR_DOMAIN_DEVICE_DISK)) {
+ g_autoptr(virDomainDeviceDef) devConf = NULL;
+ unsigned int attach_parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_ABI_UPDATE;
+
+ if (!(devConf = virDomainDeviceDefParse(xml, vmdef,
+ driver->xmlopt, priv->qemuCaps,
+ attach_parse_flags)))
+ return -1;
+ if (qemuDomainAttachDeviceConfig(vmdef, devConf, priv->qemuCaps,
+ attach_parse_flags,
+ driver->xmlopt) < 0)
+ return -1;
+ }
+
virDomainObjAssignDef(vm, &vmdef, false, NULL);
/* Event sending if persistent config has changed */
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 774962b0df..98b47bfa9c 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -6090,6 +6090,13 @@ qemuDomainDetachDeviceLease(virQEMUDriver *driver,
}
+/* Returns:
+ * -1 Unplug of the device failed
+ *
+ * 0 Unplug of the device success
+ *
+ * 2 removal of the device did not finish in qemuDomainRemoveDeviceWaitTime
+ */
int
qemuDomainDetachDeviceLive(virDomainObj *vm,
virDomainDeviceDef *match,
@@ -6297,7 +6304,10 @@ qemuDomainDetachDeviceLive(virDomainObj *vm,
if (async) {
ret = 0;
} else {
- if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+ ret = qemuDomainWaitForDeviceRemoval(vm);
+ if (ret == 0)
+ ret = 2;
+ if (ret == 1)
ret = qemuDomainRemoveDevice(driver, vm, &detach);
}
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 961a7a3c64..6c1c6112d9 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -238,7 +238,7 @@ testQemuHotplug(const void *data)
case DETACH:
ret = qemuDomainDetachDeviceLive(vm, dev, &driver, false);
- if (ret == 0 || fail)
+ if (ret == 2 || ret == 0 || fail)
ret = testQemuHotplugCheckResult(vm, domain_xml,
domain_filename, fail);
break;
--
2.31.1
11 months, 2 weeks
Entering freeze for libvirt-10.3.0
by Jiri Denemark
I have just tagged v10.3.0-rc1 in the repository and pushed signed
tarballs to https://download.libvirt.org/
Please give the release candidate some testing and in case you find a
serious issue which should have a fix in the upcoming release, feel
free to reply to this thread to make sure the issue is more visible.
If you have not done so yet, please update NEWS.rst to document any
significant change you made since the last release.
Thanks,
Jirka
11 months, 2 weeks
[PATCH v1 00/20] node_dev_udev: use workerpool and improve nodedev events
by Marc Hartmayer
When an udev event occurs for a mediated device (mdev) the mdev config data
requires an update via mdevctl as the udev event does not contain all config
data. This update needs to occur immediately and to be finished before the
libvirt nodedev event is issued to keep the API usage reliable.
Changelog:
RFCv1->v1:
+ removed some of my own s-o-b's that were accidentally inserted in the RFC
+ added r-b's from Boris and Jonathon
+ worked in comments from Boris and Jonathon, but I did not inline
"nodeDeviceDefResetMdevActiveConfig" as I'm not sure whether this improves
the readability
+ reworked patch "[RFC PATCH v1 11/15] node_device_udev: Use
`stateShutdownPrepare` and `stateShutdownWait`"
+ reworked patch "node_device_udev: Use a worker pool for processing events and
emitting nodedev event"
+ added patches:
- node_device_udev: Move responsibility to release `(init|udev)Thread` to `udevEventDataDispose`
- node_device_udev: Fix leak of mdevctlLock, udevThreadCond, and mdevCtlMonitor
- node_device_udev: nodeStateShutdownPrepare: Disconnect the signals explicitly
- node_device_udev: Pass the driver state as parameter in prepartion for the next commit
- node_device_udev: Add support for `g_autoptr` to `udevEventData
- node_device_udev: Pass the `udevEventData` via parameter and use refcounting
Boris Fiuczynski (3):
nodedev: fix mdev add udev event data handling
nodedev: immediate update of active config on udev add
nodedev: reset active config data on udev remove event
Marc Hartmayer (17):
node_device_udev: Set @def to NULL
node_device_udev: Remove the timeout if the data is disposed
node_device_udev: Test for mdevctlTimeout != -1
node_device_udev: Don't take `mdevctlLock` for `mdevctl list` and add
comments about locking
node_device_udev: Take lock if `driver->privateData` is modified
node_device_udev: Add prefix `udev` for udev related data
node_device_udev: Inline `udevRemoveOneDevice`
node_device_udev: Move responsibility to release `(init|udev)Thread`
to `udevEventDataDispose`
node_device_udev: Fix leak of mdevctlLock, udevThreadCond, and
mdevCtlMonitors
node_device_udev: Introduce and use `stateShutdownPrepare` and
`stateShutdownWait`
node_device_udev: nodeStateShutdownPrepare: Disconnect the signals
explicitly
node_device_udev: Pass the driver state as parameter in preparation
for the next commit
node_device_udev: Use a worker pool for processing events and emitting
nodedev event
node_device_udev: Call `nodeDeviceUpdateMediatedDevices` directly
node_device_udev: Make the code easier to read
node_device_udev: Add support for `g_autoptr` to `udevEventData`
node_device_udev: Pass the `udevEventData` via parameter and use
refcounting
src/node_device/node_device_driver.h | 5 +-
src/util/virmdev.h | 4 +
src/conf/node_device_conf.c | 10 +-
src/node_device/node_device_driver.c | 19 +-
src/node_device/node_device_udev.c | 510 ++++++++++++++++++---------
src/test/test_driver.c | 3 +-
src/util/virmdev.c | 20 ++
src/libvirt_private.syms | 2 +
8 files changed, 384 insertions(+), 189 deletions(-)
base-commit: c38720b337f74337ec94c0fe2e97a7c2c57188ae
--
2.34.1
11 months, 3 weeks
[PATCH 0/2] ci : drop CentOS 8 Stream
by Daniel P. Berrangé
CentOS 8 Stream goes EOL at the end of May, and unlike most other
distros, it will actively break the ability to install and update
it, as package repos are all archived. We thus have to stop using
it in CI, but fortunately Alma Linux 8 continues to give us enough
ongoing coverage.
The exception is the integration tests. To keep those working would
require the custom runner to be reinstalled with Alma Linux, which
I don't have access to do.
Daniel P. Berrangé (2):
ci: refresh with latest lcitool manifest
ci: drop CentOS 8 Stream and refresh
ci/buildenv/alpine-319.sh | 2 +-
ci/buildenv/alpine-edge.sh | 2 +-
ci/buildenv/centos-stream-8.sh | 104 -------------
ci/buildenv/centos-stream-9.sh | 1 +
ci/cirrus/build.yml | 2 +-
ci/containers/alpine-319.Dockerfile | 2 +-
ci/containers/alpine-edge.Dockerfile | 2 +-
ci/containers/centos-stream-8.Dockerfile | 107 -------------
ci/containers/centos-stream-9.Dockerfile | 1 +
ci/gitlab/build-templates.yml | 184 ++++++++++-------------
ci/gitlab/builds.yml | 15 --
ci/gitlab/containers.yml | 7 -
ci/integration.yml | 24 ---
ci/manifest.yml | 8 -
14 files changed, 90 insertions(+), 371 deletions(-)
delete mode 100644 ci/buildenv/centos-stream-8.sh
delete mode 100644 ci/containers/centos-stream-8.Dockerfile
--
2.43.0
11 months, 3 weeks
[PATCH 0/2] cmdComplete: Fix two memleaks
by Peter Krempa
Putting my recently-reviewed series through CI revealed that there were
two pre-existing memleaks in the completion code caught by the test
additions.
Peter Krempa (2):
vsh: cmdComplete: Don't leak buffer for completion
vshReadlineInit: Initialize only once
tools/vsh.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--
2.44.0
11 months, 3 weeks