libvirt update to version 6.2.0-47
- sync some bugfix patches from upstream - support vhostuser disk - libvirt: support dirtyrate (calc-dirty-rate, dirtyrate-param.mode) Signed-off-by: yezengruan <yezengruan@huawei.com>
This commit is contained in:
parent
c13ec0ae76
commit
6291e25165
47
client-fix-memory-leak-in-client-msg.patch
Normal file
47
client-fix-memory-leak-in-client-msg.patch
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
From ea9860d9f89252f0890dae01c6b92af2a82227f4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Tue, 29 Nov 2022 08:19:29 +0000
|
||||||
|
Subject: [PATCH 02/24] client: fix memory leak in client msg When closing
|
||||||
|
client->waitDispatch in virNetClientIOEventLoopRemoveAll or
|
||||||
|
virNetClientIOEventLoopRemoveDone, VIR_FREE() is called to free call->msg
|
||||||
|
directly, resulting in leak of the memory call->msg->buffer points to. Use
|
||||||
|
virNetMessageFree(call->msg) instead of VIR_FREE(call->msg).
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Hao Wang <wanghao232@huawei.com>
|
||||||
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
|
||||||
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
(cherry-pick from 0011ec3191a5bffff14fc2c53fbdf457a805cfb1)
|
||||||
|
---
|
||||||
|
src/rpc/virnetclient.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
|
||||||
|
index 1c5bef86a1..70ace5d0e8 100644
|
||||||
|
--- a/src/rpc/virnetclient.c
|
||||||
|
+++ b/src/rpc/virnetclient.c
|
||||||
|
@@ -1519,7 +1519,7 @@ static bool virNetClientIOEventLoopRemoveDone(virNetClientCallPtr call,
|
||||||
|
if (call->expectReply)
|
||||||
|
VIR_WARN("Got a call expecting a reply but without a waiting thread");
|
||||||
|
virCondDestroy(&call->cond);
|
||||||
|
- VIR_FREE(call->msg);
|
||||||
|
+ virNetMessageFree(call->msg);
|
||||||
|
VIR_FREE(call);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1546,7 +1546,7 @@ virNetClientIOEventLoopRemoveAll(virNetClientCallPtr call,
|
||||||
|
|
||||||
|
VIR_DEBUG("Removing call %p", call);
|
||||||
|
virCondDestroy(&call->cond);
|
||||||
|
- VIR_FREE(call->msg);
|
||||||
|
+ virNetMessageFree(call->msg);
|
||||||
|
VIR_FREE(call);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
617
conf-implement-support-for-vhostuser-disk.patch
Normal file
617
conf-implement-support-for-vhostuser-disk.patch
Normal file
@ -0,0 +1,617 @@
|
|||||||
|
From 02565aca5158fb4d9870546ea29be85278649511 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 18:13:36 +0800
|
||||||
|
Subject: [PATCH 15/24] conf: implement support for vhostuser disk
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||||
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
(cherry picked from commit f00fe96eb045eed2b6b40d5046449bec6d495875)
|
||||||
|
Signed-off-by: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
---
|
||||||
|
src/conf/domain_conf.c | 254 ++++++++++++++++++
|
||||||
|
src/libxl/xen_xl.c | 1 +
|
||||||
|
src/qemu/qemu_block.c | 6 +
|
||||||
|
src/qemu/qemu_command.c | 1 +
|
||||||
|
src/qemu/qemu_driver.c | 4 +
|
||||||
|
src/qemu/qemu_migration.c | 2 +
|
||||||
|
src/util/virstoragefile.c | 4 +
|
||||||
|
src/util/virstoragefile.h | 4 +
|
||||||
|
tests/qemuxml2argvdata/disk-vhostuser.xml | 30 +++
|
||||||
|
.../disk-vhostuser.x86_64-latest.xml | 48 ++++
|
||||||
|
tests/qemuxml2xmltest.c | 1 +
|
||||||
|
11 files changed, 355 insertions(+)
|
||||||
|
create mode 100644 tests/qemuxml2argvdata/disk-vhostuser.xml
|
||||||
|
create mode 100644 tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml
|
||||||
|
|
||||||
|
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||||
|
index b60b9d31a1..8b1ca76d39 100644
|
||||||
|
--- a/src/conf/domain_conf.c
|
||||||
|
+++ b/src/conf/domain_conf.c
|
||||||
|
@@ -1278,6 +1278,17 @@ static virClassPtr virDomainXMLOptionClass;
|
||||||
|
static void virDomainObjDispose(void *obj);
|
||||||
|
static void virDomainXMLOptionDispose(void *obj);
|
||||||
|
|
||||||
|
+static int
|
||||||
|
+virDomainChrSourceDefFormat(virBufferPtr buf,
|
||||||
|
+ virDomainChrSourceDefPtr def,
|
||||||
|
+ unsigned int flags);
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+virDomainChrSourceReconnectDefParseXML(virDomainChrSourceReconnectDefPtr def,
|
||||||
|
+ xmlNodePtr node,
|
||||||
|
+ xmlXPathContextPtr ctxt);
|
||||||
|
+
|
||||||
|
static int virDomainObjOnceInit(void)
|
||||||
|
{
|
||||||
|
if (!VIR_CLASS_NEW(virDomainObj, virClassForObjectLockable()))
|
||||||
|
@@ -5200,6 +5211,12 @@ virDomainDiskDefPostParse(virDomainDiskDefPtr disk,
|
||||||
|
disk->src->nvme->managed = VIR_TRISTATE_BOOL_YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* vhost-user doesn't allow us to snapshot, disable snapshots by default */
|
||||||
|
+ if (disk->src->type == VIR_STORAGE_TYPE_VHOST_USER &&
|
||||||
|
+ disk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT) {
|
||||||
|
+ disk->snapshot = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
|
||||||
|
virDomainDiskDefAssignAddress(xmlopt, disk, def) < 0) {
|
||||||
|
return -1;
|
||||||
|
@@ -5995,6 +6012,174 @@ virDomainDiskAddressDiskBusCompatibility(virDomainDiskBus bus,
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int
|
||||||
|
+virDomainDiskVhostUserValidate(const virDomainDiskDef *disk)
|
||||||
|
+{
|
||||||
|
+ if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("vhostuser disk supports only virtio bus"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_NONE) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("only snapshot=no is supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* Unsupported driver attributes */
|
||||||
|
+
|
||||||
|
+ if (disk->cachemode != VIR_DOMAIN_DISK_CACHE_DEFAULT) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("cache is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->error_policy || disk->rerror_policy) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("error_policy is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->iomode) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("io is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->ioeventfd != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("ioeventfd is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->copy_on_read) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("copy_on_read is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->discard) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("discard is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->iothread) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("iothread is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->detect_zeroes) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("detect_zeroes is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* Unsupported driver elements */
|
||||||
|
+
|
||||||
|
+ if (disk->virtio) {
|
||||||
|
+ if (disk->virtio->iommu != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("iommu is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->virtio->ats != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("ats is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* Unsupported disk elements */
|
||||||
|
+
|
||||||
|
+ if (disk->blkdeviotune.group_name ||
|
||||||
|
+ virDomainBlockIoTuneInfoHasAny(&disk->blkdeviotune)) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("iotune is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->src->backingStore) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("backingStore is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->src->encryption) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("encryption is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->src->readonly) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("readonly is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->src->shared) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("shareable is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->transient) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("transient is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->serial) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("serial is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->wwn) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("wwn is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->vendor) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("vendor is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->product) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("product is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->src->auth) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("auth is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->geometry.cylinders > 0 ||
|
||||||
|
+ disk->geometry.heads > 0 ||
|
||||||
|
+ disk->geometry.sectors > 0 ||
|
||||||
|
+ disk->geometry.trans != VIR_DOMAIN_DISK_TRANS_DEFAULT) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("geometry is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (disk->blockio.logical_block_size > 0 ||
|
||||||
|
+ disk->blockio.physical_block_size > 0) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("blockio is not supported with vhostuser disk"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
|
||||||
|
static int
|
||||||
|
virSecurityDeviceLabelDefValidateXML(virSecurityDeviceLabelDefPtr *seclabels,
|
||||||
|
@@ -6095,6 +6280,11 @@ virDomainDiskDefValidate(const virDomainDef *def,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (disk->src->type == VIR_STORAGE_TYPE_VHOST_USER &&
|
||||||
|
+ virDomainDiskVhostUserValidate(disk) < 0) {
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
for (next = disk->src; next; next = next->backingStore) {
|
||||||
|
if (virSecurityDeviceLabelDefValidateXML(next->seclabels,
|
||||||
|
next->nseclabels,
|
||||||
|
@@ -9530,6 +9720,47 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node,
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int
|
||||||
|
+virDomainDiskSourceVHostUserParse(xmlNodePtr node,
|
||||||
|
+ virStorageSourcePtr src,
|
||||||
|
+ virDomainXMLOptionPtr xmlopt,
|
||||||
|
+ xmlXPathContextPtr ctxt)
|
||||||
|
+{
|
||||||
|
+ g_autofree char *type = virXMLPropString(node, "type");
|
||||||
|
+ g_autofree char *path = virXMLPropString(node, "path");
|
||||||
|
+
|
||||||
|
+ if (!type) {
|
||||||
|
+ virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
|
+ _("missing 'type' attribute for vhostuser disk source"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (STRNEQ(type, "unix")) {
|
||||||
|
+ virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
|
+ _("invalid 'type' attribute for vhostuser disk source"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!path) {
|
||||||
|
+ virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
|
+ _("missing 'path' attribute for vhostuser disk source"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!(src->vhostuser = virDomainChrSourceDefNew(xmlopt)))
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ src->vhostuser->type = virDomainChrTypeFromString(type);
|
||||||
|
+ src->vhostuser->data.nix.path = g_steal_pointer(&path);
|
||||||
|
+
|
||||||
|
+ if (virDomainChrSourceReconnectDefParseXML(&src->vhostuser->data.nix.reconnect,
|
||||||
|
+ node,
|
||||||
|
+ ctxt) < 0) {
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
|
||||||
|
static int
|
||||||
|
virDomainDiskSourceNVMeParse(xmlNodePtr node,
|
||||||
|
@@ -9746,6 +9977,10 @@ virDomainStorageSourceParse(xmlNodePtr node,
|
||||||
|
if (virDomainDiskSourceNVMeParse(node, ctxt, src) < 0)
|
||||||
|
return -1;
|
||||||
|
break;
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
+ if (virDomainDiskSourceVHostUserParse(node, src, xmlopt, ctxt) < 0)
|
||||||
|
+ return -1;
|
||||||
|
+ break;
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
@@ -24682,6 +24917,21 @@ virDomainDiskSourceNVMeFormat(virBufferPtr attrBuf,
|
||||||
|
virPCIDeviceAddressFormat(childBuf, nvme->pciAddr, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void
|
||||||
|
+virDomainChrSourceReconnectDefFormat(virBufferPtr buf,
|
||||||
|
+ virDomainChrSourceReconnectDefPtr def);
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+virDomainDiskSourceVhostuserFormat(virBufferPtr attrBuf,
|
||||||
|
+ virBufferPtr childBuf,
|
||||||
|
+ virDomainChrSourceDefPtr vhostuser)
|
||||||
|
+{
|
||||||
|
+ virBufferAddLit(attrBuf, " type='unix'");
|
||||||
|
+ virBufferAsprintf(attrBuf, " path='%s'", vhostuser->data.nix.path);
|
||||||
|
+
|
||||||
|
+ virDomainChrSourceReconnectDefFormat(childBuf, &vhostuser->data.nix.reconnect);
|
||||||
|
+}
|
||||||
|
|
||||||
|
static int
|
||||||
|
virDomainDiskSourceFormatPrivateData(virBufferPtr buf,
|
||||||
|
@@ -24796,6 +25046,10 @@ virDomainDiskSourceFormat(virBufferPtr buf,
|
||||||
|
virDomainDiskSourceNVMeFormat(&attrBuf, &childBuf, src->nvme);
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
+ virDomainDiskSourceVhostuserFormat(&attrBuf, &childBuf, src->vhostuser);
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c
|
||||||
|
index 91b1825399..08eea48d6c 100644
|
||||||
|
--- a/src/libxl/xen_xl.c
|
||||||
|
+++ b/src/libxl/xen_xl.c
|
||||||
|
@@ -1641,6 +1641,7 @@ xenFormatXLDiskSrc(virStorageSourcePtr src, char **srcstr)
|
||||||
|
|
||||||
|
case VIR_STORAGE_TYPE_VOLUME:
|
||||||
|
case VIR_STORAGE_TYPE_NVME:
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
break;
|
||||||
|
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
|
||||||
|
index d32277d7fd..8bd6238238 100644
|
||||||
|
--- a/src/qemu/qemu_block.c
|
||||||
|
+++ b/src/qemu/qemu_block.c
|
||||||
|
@@ -1108,6 +1108,11 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src,
|
||||||
|
return NULL;
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
+ _("unable to create blockdev props for vhostuser disk type"));
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
case VIR_STORAGE_TYPE_VOLUME:
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("storage source pool '%s' volume '%s' is not translated"),
|
||||||
|
@@ -2491,6 +2496,7 @@ qemuBlockStorageSourceCreateGetStorageProps(virStorageSourcePtr src,
|
||||||
|
case VIR_STORAGE_TYPE_DIR:
|
||||||
|
case VIR_STORAGE_TYPE_VOLUME:
|
||||||
|
case VIR_STORAGE_TYPE_NVME:
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
||||||
|
index 9157008b73..bc62843783 100644
|
||||||
|
--- a/src/qemu/qemu_command.c
|
||||||
|
+++ b/src/qemu/qemu_command.c
|
||||||
|
@@ -1166,6 +1166,7 @@ qemuGetDriveSourceString(virStorageSourcePtr src,
|
||||||
|
|
||||||
|
case VIR_STORAGE_TYPE_VOLUME:
|
||||||
|
case VIR_STORAGE_TYPE_NVME:
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
break;
|
||||||
|
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||||
|
index 854b56a563..b2ad021e4d 100644
|
||||||
|
--- a/src/qemu/qemu_driver.c
|
||||||
|
+++ b/src/qemu/qemu_driver.c
|
||||||
|
@@ -14536,6 +14536,7 @@ qemuDomainSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDefPtr snapdi
|
||||||
|
case VIR_STORAGE_TYPE_DIR:
|
||||||
|
case VIR_STORAGE_TYPE_VOLUME:
|
||||||
|
case VIR_STORAGE_TYPE_NVME:
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
@@ -14553,6 +14554,7 @@ qemuDomainSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDefPtr snapdi
|
||||||
|
case VIR_STORAGE_TYPE_DIR:
|
||||||
|
case VIR_STORAGE_TYPE_VOLUME:
|
||||||
|
case VIR_STORAGE_TYPE_NVME:
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
@@ -14621,6 +14623,7 @@ qemuDomainSnapshotPrepareDiskExternalActive(virDomainSnapshotDiskDefPtr snapdisk
|
||||||
|
case VIR_STORAGE_TYPE_DIR:
|
||||||
|
case VIR_STORAGE_TYPE_VOLUME:
|
||||||
|
case VIR_STORAGE_TYPE_NVME:
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
@@ -14749,6 +14752,7 @@ qemuDomainSnapshotPrepareDiskInternal(virDomainDiskDefPtr disk,
|
||||||
|
case VIR_STORAGE_TYPE_DIR:
|
||||||
|
case VIR_STORAGE_TYPE_VOLUME:
|
||||||
|
case VIR_STORAGE_TYPE_NVME:
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||||
|
index 1c48138ce3..faf4e223a8 100644
|
||||||
|
--- a/src/qemu/qemu_migration.c
|
||||||
|
+++ b/src/qemu/qemu_migration.c
|
||||||
|
@@ -228,6 +228,7 @@ qemuMigrationDstPrecreateDisk(virConnectPtr conn,
|
||||||
|
case VIR_STORAGE_TYPE_BLOCK:
|
||||||
|
case VIR_STORAGE_TYPE_DIR:
|
||||||
|
case VIR_STORAGE_TYPE_NVME:
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
@@ -1358,6 +1359,7 @@ qemuMigrationSrcIsSafe(virDomainDefPtr def,
|
||||||
|
unsafe = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_BLOCK:
|
||||||
|
case VIR_STORAGE_TYPE_DIR:
|
||||||
|
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
|
||||||
|
index ffc8bdb344..2515dbf5ed 100644
|
||||||
|
--- a/src/util/virstoragefile.c
|
||||||
|
+++ b/src/util/virstoragefile.c
|
||||||
|
@@ -56,6 +56,7 @@ VIR_ENUM_IMPL(virStorage,
|
||||||
|
"network",
|
||||||
|
"volume",
|
||||||
|
"nvme",
|
||||||
|
+ "vhostuser",
|
||||||
|
);
|
||||||
|
|
||||||
|
VIR_ENUM_IMPL(virStorageFileFormat,
|
||||||
|
@@ -2617,6 +2618,7 @@ virStorageSourceIsLocalStorage(const virStorageSource *src)
|
||||||
|
/* While NVMe disks are local, they are not accessible via src->path.
|
||||||
|
* Therefore, we have to return false here. */
|
||||||
|
case VIR_STORAGE_TYPE_NVME:
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
return false;
|
||||||
|
@@ -4164,6 +4166,7 @@ virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
|
||||||
|
/* We shouldn't get VOLUME, but the switch requires all cases */
|
||||||
|
case VIR_STORAGE_TYPE_VOLUME:
|
||||||
|
case VIR_STORAGE_TYPE_NVME:
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
return -1;
|
||||||
|
@@ -4610,6 +4613,7 @@ virStorageSourceIsRelative(virStorageSourcePtr src)
|
||||||
|
case VIR_STORAGE_TYPE_NETWORK:
|
||||||
|
case VIR_STORAGE_TYPE_VOLUME:
|
||||||
|
case VIR_STORAGE_TYPE_NVME:
|
||||||
|
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||||
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
|
return false;
|
||||||
|
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
|
||||||
|
index 7939c09cd5..f2096b8705 100644
|
||||||
|
--- a/src/util/virstoragefile.h
|
||||||
|
+++ b/src/util/virstoragefile.h
|
||||||
|
@@ -28,6 +28,7 @@
|
||||||
|
#include "virseclabel.h"
|
||||||
|
#include "virstorageencryption.h"
|
||||||
|
#include "virsecret.h"
|
||||||
|
+#include "../conf/virconftypes.h"
|
||||||
|
#include "virenum.h"
|
||||||
|
#include "virpci.h"
|
||||||
|
|
||||||
|
@@ -52,6 +53,7 @@ typedef enum {
|
||||||
|
VIR_STORAGE_TYPE_NETWORK,
|
||||||
|
VIR_STORAGE_TYPE_VOLUME,
|
||||||
|
VIR_STORAGE_TYPE_NVME,
|
||||||
|
+ VIR_STORAGE_TYPE_VHOST_USER,
|
||||||
|
|
||||||
|
VIR_STORAGE_TYPE_LAST
|
||||||
|
} virStorageType;
|
||||||
|
@@ -302,6 +304,8 @@ struct _virStorageSource {
|
||||||
|
|
||||||
|
virStorageSourceNVMeDefPtr nvme; /* type == VIR_STORAGE_TYPE_NVME */
|
||||||
|
|
||||||
|
+ virDomainChrSourceDefPtr vhostuser; /* type == VIR_STORAGE_TYPE_VHOST_USER */
|
||||||
|
+
|
||||||
|
virStorageSourceInitiatorDef initiator;
|
||||||
|
|
||||||
|
virObjectPtr privateData;
|
||||||
|
diff --git a/tests/qemuxml2argvdata/disk-vhostuser.xml b/tests/qemuxml2argvdata/disk-vhostuser.xml
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000..c96ef9119c
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/qemuxml2argvdata/disk-vhostuser.xml
|
||||||
|
@@ -0,0 +1,30 @@
|
||||||
|
+<domain type='qemu'>
|
||||||
|
+ <name>QEMUGuest1</name>
|
||||||
|
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
|
+ <memory unit='KiB'>219136</memory>
|
||||||
|
+ <currentMemory unit='KiB'>219136</currentMemory>
|
||||||
|
+ <memoryBacking>
|
||||||
|
+ <source type='memfd'/>
|
||||||
|
+ <access mode='shared'/>
|
||||||
|
+ </memoryBacking>
|
||||||
|
+ <vcpu placement='static'>1</vcpu>
|
||||||
|
+ <os>
|
||||||
|
+ <type arch='i686' machine='pc'>hvm</type>
|
||||||
|
+ </os>
|
||||||
|
+ <devices>
|
||||||
|
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||||
|
+ <disk type='vhostuser' device='disk'>
|
||||||
|
+ <driver name='qemu' type='raw'/>
|
||||||
|
+ <source type='unix' path='/tmp/vhost1.sock'/>
|
||||||
|
+ <target dev='vda' bus='virtio'/>
|
||||||
|
+ <boot order='1'/>
|
||||||
|
+ </disk>
|
||||||
|
+ <disk type='vhostuser' device='disk'>
|
||||||
|
+ <driver name='qemu' type='raw'/>
|
||||||
|
+ <source type='unix' path='/tmp/vhost1.sock'>
|
||||||
|
+ <reconnect enabled='yes' timeout='10'/>
|
||||||
|
+ </source>
|
||||||
|
+ <target dev='vdb' bus='virtio'/>
|
||||||
|
+ </disk>
|
||||||
|
+ </devices>
|
||||||
|
+</domain>
|
||||||
|
diff --git a/tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000..9712dc0b12
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml
|
||||||
|
@@ -0,0 +1,48 @@
|
||||||
|
+<domain type='qemu'>
|
||||||
|
+ <name>QEMUGuest1</name>
|
||||||
|
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
|
+ <memory unit='KiB'>219136</memory>
|
||||||
|
+ <currentMemory unit='KiB'>219136</currentMemory>
|
||||||
|
+ <memoryBacking>
|
||||||
|
+ <source type='memfd'/>
|
||||||
|
+ <access mode='shared'/>
|
||||||
|
+ </memoryBacking>
|
||||||
|
+ <vcpu placement='static'>1</vcpu>
|
||||||
|
+ <os>
|
||||||
|
+ <type arch='i686' machine='pc'>hvm</type>
|
||||||
|
+ </os>
|
||||||
|
+ <cpu mode='custom' match='exact' check='none'>
|
||||||
|
+ <model fallback='forbid'>qemu64</model>
|
||||||
|
+ </cpu>
|
||||||
|
+ <clock offset='utc'/>
|
||||||
|
+ <on_poweroff>destroy</on_poweroff>
|
||||||
|
+ <on_reboot>restart</on_reboot>
|
||||||
|
+ <on_crash>destroy</on_crash>
|
||||||
|
+ <devices>
|
||||||
|
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||||
|
+ <disk type='vhostuser' device='disk' snapshot='no'>
|
||||||
|
+ <driver name='qemu' type='raw'/>
|
||||||
|
+ <source type='unix' path='/tmp/vhost1.sock'/>
|
||||||
|
+ <target dev='vda' bus='virtio'/>
|
||||||
|
+ <boot order='1'/>
|
||||||
|
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
||||||
|
+ </disk>
|
||||||
|
+ <disk type='vhostuser' device='disk' snapshot='no'>
|
||||||
|
+ <driver name='qemu' type='raw'/>
|
||||||
|
+ <source type='unix' path='/tmp/vhost1.sock'>
|
||||||
|
+ <reconnect enabled='yes' timeout='10'/>
|
||||||
|
+ </source>
|
||||||
|
+ <target dev='vdb' bus='virtio'/>
|
||||||
|
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||||
|
+ </disk>
|
||||||
|
+ <controller type='usb' index='0' model='piix3-uhci'>
|
||||||
|
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||||
|
+ </controller>
|
||||||
|
+ <controller type='pci' index='0' model='pci-root'/>
|
||||||
|
+ <input type='mouse' bus='ps2'/>
|
||||||
|
+ <input type='keyboard' bus='ps2'/>
|
||||||
|
+ <memballoon model='virtio'>
|
||||||
|
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
||||||
|
+ </memballoon>
|
||||||
|
+ </devices>
|
||||||
|
+</domain>
|
||||||
|
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
|
||||||
|
index 3a2539596b..2569c27261 100644
|
||||||
|
--- a/tests/qemuxml2xmltest.c
|
||||||
|
+++ b/tests/qemuxml2xmltest.c
|
||||||
|
@@ -338,6 +338,7 @@ mymain(void)
|
||||||
|
DO_TEST("disk-network-vxhs", NONE);
|
||||||
|
DO_TEST("disk-network-tlsx509", NONE);
|
||||||
|
DO_TEST("disk-nvme", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_QCOW2_LUKS);
|
||||||
|
+ DO_TEST_CAPS_LATEST("disk-vhostuser");
|
||||||
|
DO_TEST("disk-scsi", QEMU_CAPS_SCSI_LSI, QEMU_CAPS_SCSI_MEGASAS,
|
||||||
|
QEMU_CAPS_SCSI_MPTSAS1068, QEMU_CAPS_SCSI_DISK_WWN);
|
||||||
|
DO_TEST("disk-virtio-scsi-reservations",
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
44
cpu_ppc64-compare-CPU-function-is-ignoring-return-va.patch
Normal file
44
cpu_ppc64-compare-CPU-function-is-ignoring-return-va.patch
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
From 9549d796fd310e41ec58f1c438328d1bedc0cb93 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Tue, 29 Nov 2022 12:12:58 +0000
|
||||||
|
Subject: [PATCH 09/24] cpu_ppc64: compare CPU function is ignoring return
|
||||||
|
value Function to compare CPU on 64-bits PowerPC is ignoring the flag to
|
||||||
|
avoid failure in case of CPUs (host and guest) are incompatible. Basically,
|
||||||
|
the function is returning -1 even if it is set to continue.
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Julio Faracco jcfaracco@gmail.com
|
||||||
|
Reviewed-by: Ján Tomko jtomko@redhat.com
|
||||||
|
Signed-off-by: Ján Tomko jtomko@redhat.com
|
||||||
|
|
||||||
|
Signed-off-by: tangbin tangbin_yewu@cmss.chinamobile.com
|
||||||
|
(cherry-pick from b356d81b8960c3a43212f8c0e9eab66465c8c10a)
|
||||||
|
---
|
||||||
|
src/cpu/cpu_ppc64.c | 8 ++++----
|
||||||
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
|
||||||
|
index 6b3590ab6a..9cbb28cbc5 100644
|
||||||
|
--- a/src/cpu/cpu_ppc64.c
|
||||||
|
+++ b/src/cpu/cpu_ppc64.c
|
||||||
|
@@ -561,11 +561,11 @@ virCPUppc64Compare(virCPUDefPtr host,
|
||||||
|
if (failIncompatible) {
|
||||||
|
virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s",
|
||||||
|
_("unknown host CPU"));
|
||||||
|
- } else {
|
||||||
|
- VIR_WARN("unknown host CPU");
|
||||||
|
- ret = VIR_CPU_COMPARE_INCOMPATIBLE;
|
||||||
|
+ return VIR_CPU_COMPARE_ERROR;
|
||||||
|
}
|
||||||
|
- return -1;
|
||||||
|
+
|
||||||
|
+ VIR_WARN("unknown host CPU");
|
||||||
|
+ return VIR_CPU_COMPARE_INCOMPATIBLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = ppc64Compute(host, cpu, NULL, &message);
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
149
docs-introduces-new-vhostuser-disk-type.patch
Normal file
149
docs-introduces-new-vhostuser-disk-type.patch
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
From 0b8ff5672665c3792c27c02d9d05e0951c03d440 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 18:13:36 +0800
|
||||||
|
Subject: [PATCH 14/24] docs: introduces new vhostuser disk type
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
<disk type='vhostuser' device='disk'>
|
||||||
|
<driver name='qemu' type='raw'/>
|
||||||
|
<source type='unix' path='/tmp/vhost-blk.sock'>
|
||||||
|
<reconnect enabled='yes' timeout='10'/>
|
||||||
|
</source>
|
||||||
|
<target dev='vda' bus='virtio'/>
|
||||||
|
</disk>
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||||
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
(cherry picked from commit e88bdaf789b6f1cc5347b217240f15afd86a94c1)
|
||||||
|
Signed-off-by: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
---
|
||||||
|
docs/formatdomain.html.in | 51 ++++++++++++++++++++++++++++++++++-
|
||||||
|
docs/schemas/domaincommon.rng | 19 +++++++++++++
|
||||||
|
2 files changed, 69 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
|
||||||
|
index aaeb05961f..5860ec9f20 100644
|
||||||
|
--- a/docs/formatdomain.html.in
|
||||||
|
+++ b/docs/formatdomain.html.in
|
||||||
|
@@ -2977,6 +2977,13 @@
|
||||||
|
</source>
|
||||||
|
<target dev='vde' bus='virtio'/>
|
||||||
|
</disk>
|
||||||
|
+ <disk type='vhostuser' device='disk'>
|
||||||
|
+ <driver name='qemu' type='raw'/>
|
||||||
|
+ <source type='unix' path='/tmp/vhost-blk.sock'>
|
||||||
|
+ <reconnect enabled='yes' timeout='10'/>
|
||||||
|
+ </source>
|
||||||
|
+ <target dev='vdf' bus='virtio'/>
|
||||||
|
+ </disk>
|
||||||
|
</devices>
|
||||||
|
...</pre>
|
||||||
|
|
||||||
|
@@ -2991,7 +2998,8 @@
|
||||||
|
"dir" (<span class="since">since 0.7.5</span>),
|
||||||
|
"network" (<span class="since">since 0.8.7</span>), or
|
||||||
|
"volume" (<span class="since">since 1.0.5</span>), or
|
||||||
|
- "nvme" (<span class="since">since 6.0.0</span>)
|
||||||
|
+ "nvme" (<span class="since">since 6.0.0</span>), or
|
||||||
|
+ "vhostuser" (<span class="since">since 6.2.0</span>)
|
||||||
|
and refer to the underlying source for the disk.
|
||||||
|
<span class="since">Since 0.0.3</span>
|
||||||
|
</dd>
|
||||||
|
@@ -3217,6 +3225,31 @@
|
||||||
|
<code><disk type='block'></code> and therefore lower
|
||||||
|
latencies can be achieved.
|
||||||
|
</dd>
|
||||||
|
+ <dt><code>vhostuser</code></dt>
|
||||||
|
+ <dd>
|
||||||
|
+ Enables the hypervisor to connect to another process using vhost-user
|
||||||
|
+ protocol. Requires shared memory configured for the VM, for more details
|
||||||
|
+ see <code>access</code> mode for
|
||||||
|
+ <code>memoryBacking <#elementsMemoryBacking></code> element.
|
||||||
|
+
|
||||||
|
+ The <code>source</code> element has following mandatory attributes:
|
||||||
|
+ <dl>
|
||||||
|
+ <dt><code>type</code></dt>
|
||||||
|
+ <dd>The type of char device. Currently only <code>unix</code> type
|
||||||
|
+ is supported.
|
||||||
|
+ </dd>
|
||||||
|
+
|
||||||
|
+ <dt><code>path</code></dt>
|
||||||
|
+ <dd>Path to the unix socket to be used as disk source.
|
||||||
|
+ </dd>
|
||||||
|
+ </dl>
|
||||||
|
+
|
||||||
|
+ Note that the vhost server replaces both the disk frontend and backend
|
||||||
|
+ thus almost all of the disk properties can't be configured via the
|
||||||
|
+ <code><disk></code> XML for this disk type. Additionally features
|
||||||
|
+ such as blockjobs, incremental backups and snapshots are not supported
|
||||||
|
+ for this disk type.
|
||||||
|
+ </dd>
|
||||||
|
</dl>
|
||||||
|
With "file", "block", and "volume", one or more optional
|
||||||
|
sub-elements <code>seclabel</code>, <a href="#seclabel">described
|
||||||
|
@@ -3424,6 +3457,22 @@
|
||||||
|
Note that '0' is considered as if the value is not provided.
|
||||||
|
<span class="since">Since 6.2.0</span>
|
||||||
|
</dd>
|
||||||
|
+ <dt><code>reconnect</code></dt>
|
||||||
|
+ <dd>
|
||||||
|
+ For disk type <code>vhostuser</code> configures reconnect timeout
|
||||||
|
+ if the connection is lost. It has two mandatory attributes:
|
||||||
|
+ <dl>
|
||||||
|
+ <dt><code>enabled</code></dt>
|
||||||
|
+ <dd>If the reconnect feature is enabled, accepts<code>yes</code>
|
||||||
|
+ and <code>no</code>
|
||||||
|
+ </dd>
|
||||||
|
+
|
||||||
|
+ <dt><code>timeout</code></dt>
|
||||||
|
+ <dd>The amount of seconds after which hypervisor tries to reconnect.
|
||||||
|
+ </dd>
|
||||||
|
+ </dl>
|
||||||
|
+ <span class="since">Since 6.2.0</span>
|
||||||
|
+ </dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
|
||||||
|
index 1807df521c..764f826df4 100644
|
||||||
|
--- a/docs/schemas/domaincommon.rng
|
||||||
|
+++ b/docs/schemas/domaincommon.rng
|
||||||
|
@@ -1631,6 +1631,7 @@
|
||||||
|
<ref name="diskSourceNetwork"/>
|
||||||
|
<ref name="diskSourceVolume"/>
|
||||||
|
<ref name="diskSourceNvme"/>
|
||||||
|
+ <ref name="diskSourceVhostUser"/>
|
||||||
|
</choice>
|
||||||
|
</define>
|
||||||
|
|
||||||
|
@@ -2103,6 +2104,24 @@
|
||||||
|
</optional>
|
||||||
|
</define>
|
||||||
|
|
||||||
|
+ <define name="diskSourceVhostUser">
|
||||||
|
+ <attribute name="type">
|
||||||
|
+ <value>vhostuser</value>
|
||||||
|
+ </attribute>
|
||||||
|
+ <element name="source">
|
||||||
|
+ <attribute name="type">
|
||||||
|
+ <value>unix</value>
|
||||||
|
+ </attribute>
|
||||||
|
+ <attribute name="path">
|
||||||
|
+ <ref name="absFilePath"/>
|
||||||
|
+ </attribute>
|
||||||
|
+ <optional>
|
||||||
|
+ <ref name="reconnect"/>
|
||||||
|
+ </optional>
|
||||||
|
+ <empty/>
|
||||||
|
+ </element>
|
||||||
|
+ </define>
|
||||||
|
+
|
||||||
|
<define name="diskTarget">
|
||||||
|
<data type="string">
|
||||||
|
<param name="pattern">(ioemu:)?(fd|hd|sd|vd|xvd|ubd)[a-zA-Z0-9_]+</param>
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
41
examples-hellolibvirt-fix-argc-check.patch
Normal file
41
examples-hellolibvirt-fix-argc-check.patch
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
From 7a13a72308b5ad5887497e13995522ab151e6293 Mon Sep 17 00:00:00 2001
|
||||||
|
From: wangmeiyang <wangmeiyang_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 19:47:10 +0800
|
||||||
|
Subject: [PATCH 20/24] examples: hellolibvirt: fix argc check
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
https://gitlab.com/libvirt/libvirt/-/issues/255
|
||||||
|
|
||||||
|
cherry-pick from dacf616b788a989ecaa1679845a07ff8010372cf
|
||||||
|
|
||||||
|
Reported-by: Jeremy Alcim
|
||||||
|
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
Signed-off-by: Meiyang Wang <wangmeiyang_yewu@cmss.chinamobile.com>
|
||||||
|
---
|
||||||
|
examples/c/misc/hellolibvirt.c | 5 +++--
|
||||||
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/examples/c/misc/hellolibvirt.c b/examples/c/misc/hellolibvirt.c
|
||||||
|
index a598e01be2..39cefe934c 100644
|
||||||
|
--- a/examples/c/misc/hellolibvirt.c
|
||||||
|
+++ b/examples/c/misc/hellolibvirt.c
|
||||||
|
@@ -107,11 +107,12 @@ main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
virConnectPtr conn;
|
||||||
|
- char *uri;
|
||||||
|
+ char *uri = NULL;
|
||||||
|
|
||||||
|
printf("Attempting to connect to hypervisor\n");
|
||||||
|
|
||||||
|
- uri = (argc > 0 ? argv[1] : NULL);
|
||||||
|
+ if (argc > 1)
|
||||||
|
+ uri = argv[1];
|
||||||
|
|
||||||
|
/* virConnectOpenAuth is called here with all default parameters,
|
||||||
|
* except, possibly, the URI of the hypervisor. */
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
32
hyperv-fix-the-number-of-threads-per-core.patch
Normal file
32
hyperv-fix-the-number-of-threads-per-core.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From ee9069defba076d94b432662af93a784ea002f5a Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Tue, 29 Nov 2022 08:57:42 +0000
|
||||||
|
Subject: [PATCH 04/24] hyperv: fix the number of threads per core The operands
|
||||||
|
were reversed, producing an incorrect result.
|
||||||
|
|
||||||
|
Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
|
||||||
|
Signed-off-by: Matt Coleman <matt@datto.com>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
|
||||||
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
(cherry-pick from 1e18d3b833b9daa7bb18b9550a2cf4d140303d86)
|
||||||
|
---
|
||||||
|
src/hyperv/hyperv_driver.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
|
||||||
|
index 4677a25ff8..213dd8837b 100644
|
||||||
|
--- a/src/hyperv/hyperv_driver.c
|
||||||
|
+++ b/src/hyperv/hyperv_driver.c
|
||||||
|
@@ -310,7 +310,7 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
|
||||||
|
}
|
||||||
|
|
||||||
|
info->cores = processorList->data.common->NumberOfCores;
|
||||||
|
- info->threads = info->cores / processorList->data.common->NumberOfLogicalProcessors;
|
||||||
|
+ info->threads = processorList->data.common->NumberOfLogicalProcessors / info->cores;
|
||||||
|
info->cpus = info->sockets * info->cores;
|
||||||
|
|
||||||
|
result = 0;
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
77
include-Introduce-virDomainDirtyRateCalcFlags.patch
Normal file
77
include-Introduce-virDomainDirtyRateCalcFlags.patch
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
From c4c665b4654280560eafe5782359b71e8ef2b1b5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
|
||||||
|
<huangy81@chinatelecom.cn>
|
||||||
|
Date: Sun, 20 Feb 2022 21:28:11 +0800
|
||||||
|
Subject: [PATCH 6/7] include: Introduce virDomainDirtyRateCalcFlags
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Introduce virDomainDirtyRateCalcFlags to get ready for
|
||||||
|
adding mode parameter to qemuDomainStartDirtyRateCalc.
|
||||||
|
|
||||||
|
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
include/libvirt/libvirt-domain.h | 13 +++++++++++++
|
||||||
|
src/libvirt-domain.c | 12 +++++++++++-
|
||||||
|
2 files changed, 24 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
|
||||||
|
index e1954ae663..c7956c81d6 100644
|
||||||
|
--- a/include/libvirt/libvirt-domain.h
|
||||||
|
+++ b/include/libvirt/libvirt-domain.h
|
||||||
|
@@ -5030,6 +5030,19 @@ typedef enum {
|
||||||
|
# endif
|
||||||
|
} virDomainDirtyRateStatus;
|
||||||
|
|
||||||
|
+/**
|
||||||
|
+ * virDomainDirtyRateCalcFlags:
|
||||||
|
+ *
|
||||||
|
+ * Flags OR'ed together to provide specific behaviour when calculating dirty page
|
||||||
|
+ * rate for a Domain
|
||||||
|
+ *
|
||||||
|
+ */
|
||||||
|
+typedef enum {
|
||||||
|
+ VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING = 0, /* default mode - page-sampling */
|
||||||
|
+ VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP = 1 << 0, /* dirty-bitmap mode */
|
||||||
|
+ VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING = 1 << 1, /* dirty-ring mode */
|
||||||
|
+} virDomainDirtyRateCalcFlags;
|
||||||
|
+
|
||||||
|
int virDomainStartDirtyRateCalc(virDomainPtr domain,
|
||||||
|
int seconds,
|
||||||
|
unsigned int flags);
|
||||||
|
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
|
||||||
|
index 6a37ea85b7..0ff99c94b6 100644
|
||||||
|
--- a/src/libvirt-domain.c
|
||||||
|
+++ b/src/libvirt-domain.c
|
||||||
|
@@ -12821,7 +12821,7 @@ virDomainHotpatchManage(virDomainPtr domain,
|
||||||
|
* virDomainStartDirtyRateCalc:
|
||||||
|
* @domain: a domain object
|
||||||
|
* @seconds: specified calculating time in seconds
|
||||||
|
- * @flags: extra flags; not used yet, so callers should always pass 0
|
||||||
|
+ * @flags: bitwise-OR of supported virDomainDirtyRateCalcFlags
|
||||||
|
*
|
||||||
|
* Calculate the current domain's memory dirty rate in next @seconds.
|
||||||
|
* The calculated dirty rate information is available by calling
|
||||||
|
@@ -12845,6 +12845,16 @@ virDomainStartDirtyRateCalc(virDomainPtr domain,
|
||||||
|
|
||||||
|
virCheckReadOnlyGoto(conn->flags, error);
|
||||||
|
|
||||||
|
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING,
|
||||||
|
+ VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP,
|
||||||
|
+ error);
|
||||||
|
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING,
|
||||||
|
+ VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING,
|
||||||
|
+ error);
|
||||||
|
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP,
|
||||||
|
+ VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING,
|
||||||
|
+ error);
|
||||||
|
+
|
||||||
|
if (conn->driver->domainStartDirtyRateCalc) {
|
||||||
|
int ret;
|
||||||
|
ret = conn->driver->domainStartDirtyRateCalc(domain, seconds, flags);
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
40
libvirt-guests-Sync-time-for-autostarted-guests.patch
Normal file
40
libvirt-guests-Sync-time-for-autostarted-guests.patch
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
From bad0bdbee1225d4d5831bc7ea7d4113df4de743d Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Tue, 29 Nov 2022 10:01:51 +0000
|
||||||
|
Subject: [PATCH 08/24] libvirt-guests: Sync time for autostarted guests
|
||||||
|
Setting SYNC_TIME=1 does not work on autostarted guests.
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
See https://bugzilla.redhat.com/show_bug.cgi?id=1555398.
|
||||||
|
|
||||||
|
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
|
||||||
|
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||||
|
|
||||||
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
(cherry-pick from a501fa7cae2b93807496295945e6d3b51e5ccb3f)
|
||||||
|
---
|
||||||
|
tools/libvirt-guests.sh.in | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
|
||||||
|
index a881f6266e..74286a12c4 100644
|
||||||
|
--- a/tools/libvirt-guests.sh.in
|
||||||
|
+++ b/tools/libvirt-guests.sh.in
|
||||||
|
@@ -200,9 +200,9 @@ start() {
|
||||||
|
retval run_virsh "$uri" start $bypass "$name" \
|
||||||
|
>/dev/null && \
|
||||||
|
gettext "done"; echo
|
||||||
|
- if "$sync_time"; then
|
||||||
|
- run_virsh "$uri" domtime --sync "$name" >/dev/null
|
||||||
|
- fi
|
||||||
|
+ fi
|
||||||
|
+ if "$sync_time"; then
|
||||||
|
+ run_virsh "$uri" domtime --sync "$name" >/dev/null
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
41
libvirt.spec
41
libvirt.spec
@ -101,7 +101,7 @@
|
|||||||
Summary: Library providing a simple virtualization API
|
Summary: Library providing a simple virtualization API
|
||||||
Name: libvirt
|
Name: libvirt
|
||||||
Version: 6.2.0
|
Version: 6.2.0
|
||||||
Release: 46
|
Release: 47
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: https://libvirt.org/
|
URL: https://libvirt.org/
|
||||||
|
|
||||||
@ -391,6 +391,40 @@ Patch0278: bash-completion-fix-variable-leaks-of-word.patch
|
|||||||
Patch0279: util-Drop-pointless-NUL_TERMINATE-macro.patch
|
Patch0279: util-Drop-pointless-NUL_TERMINATE-macro.patch
|
||||||
Patch0280: virDomainCheckpointCreateXML-Don-t-use-HTML-in-funct.patch
|
Patch0280: virDomainCheckpointCreateXML-Don-t-use-HTML-in-funct.patch
|
||||||
Patch0281: qemuMigrationSrcWaitForSpice-Remove-return-value.patch
|
Patch0281: qemuMigrationSrcWaitForSpice-Remove-return-value.patch
|
||||||
|
Patch0282: virsh-cmdScreenshot-fix-cbdata-passing-to-virshStrea.patch
|
||||||
|
Patch0283: client-fix-memory-leak-in-client-msg.patch
|
||||||
|
Patch0284: tests-Fix-false-positive-in-testConfRoundTrip.patch
|
||||||
|
Patch0285: hyperv-fix-the-number-of-threads-per-core.patch
|
||||||
|
Patch0286: virCgroupKillRecursive-Return-1-on-failure-condition.patch
|
||||||
|
Patch0287: tests-Fix-lstat-mock-initialization-on-macOS.patch
|
||||||
|
Patch0288: storagepoolxml2argvtest-Reorder-gluster-arguments.patch
|
||||||
|
Patch0289: libvirt-guests-Sync-time-for-autostarted-guests.patch
|
||||||
|
Patch0290: cpu_ppc64-compare-CPU-function-is-ignoring-return-va.patch
|
||||||
|
Patch0291: security_util-Don-t-error-on-macOS-when-getting-sett.patch
|
||||||
|
Patch0292: vsh-Fix-completion-error-in-case-of-multiple-mac-add.patch
|
||||||
|
Patch0293: qemu-Do-not-require-TSC-frequency-to-strictly-match-.patch
|
||||||
|
Patch0294: qemu_alias-introduce-qemuDomainGetVhostUserAlias-hel.patch
|
||||||
|
Patch0295: docs-introduces-new-vhostuser-disk-type.patch
|
||||||
|
Patch0296: conf-implement-support-for-vhostuser-disk.patch
|
||||||
|
Patch0297: qemu_capabilities-introduce-vhost-user-blk-capabilit.patch
|
||||||
|
Patch0298: qemu-implement-vhost-user-blk-support.patch
|
||||||
|
Patch0299: qemu_command-remove-redundant-scsi-option-in-vhost-u.patch
|
||||||
|
Patch0300: lxc-fix-error-value-of-lxcNodeGetSecurityModel.patch
|
||||||
|
Patch0301: examples-hellolibvirt-fix-argc-check.patch
|
||||||
|
Patch0302: virsh-domain-fix-mistake-in-cmdMigrateSetMaxDowntime.patch
|
||||||
|
Patch0303: vbox_network-fix-possible-memory-leak-in-vboxNetwork.patch
|
||||||
|
Patch0304: lxc-Fix-syntax-error-in-lxcNodeGetSecurityModel.patch
|
||||||
|
Patch0305: qemu_command-Don-t-validate-accelerator-when-buildin.patch
|
||||||
|
Patch0306: qemu-Switch-to-accel.patch
|
||||||
|
Patch0307: tests-qemuxml2argvdata-qtests-switch-to-accel.patch
|
||||||
|
Patch0308: tests-Fix-vhostuser-args-file.patch
|
||||||
|
Patch0309: qemu_capabilities-Fix-incorrect-alignment.patch
|
||||||
|
Patch0310: qemu_driver-Acquire-MODIFY-job-in-qemuDomainStartDir.patch
|
||||||
|
Patch0311: qemu_capabilities-Introduce-QEMU_CAPS_CALC_DIRTY_RAT.patch
|
||||||
|
Patch0312: qemu_driver-Probe-capability-before-calculating-dirt.patch
|
||||||
|
Patch0313: qemu_capabilities-Introduce-QEMU_CAPS_DIRTYRATE_MODE.patch
|
||||||
|
Patch0314: include-Introduce-virDomainDirtyRateCalcFlags.patch
|
||||||
|
Patch0315: qemu_driver-Add-mode-parameter-to-qemuDomainStartDir.patch
|
||||||
|
|
||||||
Requires: libvirt-daemon = %{version}-%{release}
|
Requires: libvirt-daemon = %{version}-%{release}
|
||||||
Requires: libvirt-daemon-config-network = %{version}-%{release}
|
Requires: libvirt-daemon-config-network = %{version}-%{release}
|
||||||
@ -2125,6 +2159,11 @@ exit 0
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Dec 06 2022 yezengruan <yezengruan@huawei.com> - 6.2.0-47
|
||||||
|
- sync some bugfix patches from upstream
|
||||||
|
- support vhostuser disk
|
||||||
|
- libvirt: support dirtyrate (calc-dirty-rate, dirtyrate-param.mode)
|
||||||
|
|
||||||
* Fri Nov 25 2022 yezengruan <yezengruan@huawei.com> - 6.2.0-46
|
* Fri Nov 25 2022 yezengruan <yezengruan@huawei.com> - 6.2.0-46
|
||||||
- sync some bugfix patches from upstream
|
- sync some bugfix patches from upstream
|
||||||
|
|
||||||
|
|||||||
38
lxc-Fix-syntax-error-in-lxcNodeGetSecurityModel.patch
Normal file
38
lxc-Fix-syntax-error-in-lxcNodeGetSecurityModel.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
From 275e5fe562d1645683c59f777b453cc24d4c8bec Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
|
||||||
|
<huangy81@chinatelecom.cn>
|
||||||
|
Date: Mon, 5 Dec 2022 08:07:40 -0500
|
||||||
|
Subject: [PATCH 24/24] lxc: Fix syntax error in lxcNodeGetSecurityModel
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Fix syntax error, which is introduced by the following commit
|
||||||
|
be72edbfc14440cceb63fa2d38811e5cbd962ad8
|
||||||
|
|
||||||
|
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
|
||||||
|
---
|
||||||
|
src/lxc/lxc_driver.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
|
||||||
|
index aa4cddc275..120d41f2b6 100644
|
||||||
|
--- a/src/lxc/lxc_driver.c
|
||||||
|
+++ b/src/lxc/lxc_driver.c
|
||||||
|
@@ -1241,11 +1241,11 @@ static int lxcNodeGetSecurityModel(virConnectPtr conn,
|
||||||
|
memset(secmodel, 0, sizeof(*secmodel));
|
||||||
|
|
||||||
|
if (virNodeGetSecurityModelEnsureACL(conn) < 0) {
|
||||||
|
- ret = -1;
|
||||||
|
+ ret = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(caps = virLXCDriverGetCapabilities(driver, false))) {
|
||||||
|
- return = -1;
|
||||||
|
+ ret = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* we treat no driver as success, but simply return no data in *secmodel */
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
47
lxc-fix-error-value-of-lxcNodeGetSecurityModel.patch
Normal file
47
lxc-fix-error-value-of-lxcNodeGetSecurityModel.patch
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
From be72edbfc14440cceb63fa2d38811e5cbd962ad8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: wangmeiyang <wangmeiyang_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 20:06:45 +0800
|
||||||
|
Subject: [PATCH 19/24] lxc: fix error value of lxcNodeGetSecurityModel
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
When adding the ACL check and caps getter, we assumed that
|
||||||
|
the default return value is -1, not 0 as usual.
|
||||||
|
|
||||||
|
Fix the return value on error by assigning them explicitly.
|
||||||
|
|
||||||
|
cherry-pick from efe98ca98bb0febe6a8274175b7c5493c0d6c9f3
|
||||||
|
|
||||||
|
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
Signed-off-by: Meiyang Wang <wangmeiyang_yewu@cmss.chinamobile.com>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
src/lxc/lxc_driver.c | 10 ++++++----
|
||||||
|
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
|
||||||
|
index 71c7068bbf..aa4cddc275 100644
|
||||||
|
--- a/src/lxc/lxc_driver.c
|
||||||
|
+++ b/src/lxc/lxc_driver.c
|
||||||
|
@@ -1240,11 +1240,13 @@ static int lxcNodeGetSecurityModel(virConnectPtr conn,
|
||||||
|
|
||||||
|
memset(secmodel, 0, sizeof(*secmodel));
|
||||||
|
|
||||||
|
- if (virNodeGetSecurityModelEnsureACL(conn) < 0)
|
||||||
|
- goto cleanup;
|
||||||
|
+ if (virNodeGetSecurityModelEnsureACL(conn) < 0) {
|
||||||
|
+ ret = -1;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- if (!(caps = virLXCDriverGetCapabilities(driver, false)))
|
||||||
|
- goto cleanup;
|
||||||
|
+ if (!(caps = virLXCDriverGetCapabilities(driver, false))) {
|
||||||
|
+ return = -1;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
/* we treat no driver as success, but simply return no data in *secmodel */
|
||||||
|
if (caps->host.nsecModels == 0
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
95
qemu-Do-not-require-TSC-frequency-to-strictly-match-.patch
Normal file
95
qemu-Do-not-require-TSC-frequency-to-strictly-match-.patch
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
From e24914dcbeb169f2608fd03cf6e701697844e065 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 09:38:41 +0000
|
||||||
|
Subject: [PATCH 12/24] qemu: Do not require TSC frequency to strictly match
|
||||||
|
host Some CPUs provide a way to read exact TSC frequency, while measuring it
|
||||||
|
is required on other CPUs. However, measuring is never exact and the result
|
||||||
|
may slightly differ across reboots. For this reason both Linux kernel and
|
||||||
|
QEMU recently started allowing for guests TSC frequency to fall into +/- 250
|
||||||
|
ppm tolerance interval around the host TSC frequency.
|
||||||
|
|
||||||
|
Let's do the same to avoid unnecessary failures (esp. during migration)
|
||||||
|
in case the host frequency does not exactly match the frequency
|
||||||
|
configured in a domain XML.
|
||||||
|
|
||||||
|
https://bugzilla.redhat.com/show_bug.cgi?id=1839095
|
||||||
|
|
||||||
|
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
||||||
|
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
|
||||||
|
|
||||||
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
(cherry-pick from d8e5b4560006590668d4669f54a46b08ec14c1a2)
|
||||||
|
---
|
||||||
|
src/qemu/qemu_process.c | 35 ++++++++++++++++++++++++++---------
|
||||||
|
1 file changed, 26 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
||||||
|
index 360c4fcbb1..9cbf34a046 100644
|
||||||
|
--- a/src/qemu/qemu_process.c
|
||||||
|
+++ b/src/qemu/qemu_process.c
|
||||||
|
@@ -5271,12 +5271,18 @@ qemuProcessStartValidateDisks(virDomainObjPtr vm,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
+/* 250 parts per million (ppm) is a half of NTP threshold */
|
||||||
|
+#define TSC_TOLERANCE 250
|
||||||
|
+
|
||||||
|
static int
|
||||||
|
qemuProcessStartValidateTSC(virQEMUDriverPtr driver,
|
||||||
|
virDomainObjPtr vm)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
unsigned long long freq = 0;
|
||||||
|
+ unsigned long long tolerance;
|
||||||
|
+ unsigned long long minFreq;
|
||||||
|
+ unsigned long long maxFreq;
|
||||||
|
virHostCPUTscInfoPtr tsc;
|
||||||
|
g_autoptr(virCPUDef) cpu = NULL;
|
||||||
|
|
||||||
|
@@ -5302,23 +5308,34 @@ qemuProcessStartValidateTSC(virQEMUDriverPtr driver,
|
||||||
|
}
|
||||||
|
|
||||||
|
tsc = cpu->tsc;
|
||||||
|
- VIR_DEBUG("Host TSC frequency %llu Hz, scaling %s",
|
||||||
|
- tsc->frequency, virTristateBoolTypeToString(tsc->scaling));
|
||||||
|
+ tolerance = tsc->frequency * TSC_TOLERANCE / 1000000;
|
||||||
|
+ minFreq = tsc->frequency - tolerance;
|
||||||
|
+ maxFreq = tsc->frequency + tolerance;
|
||||||
|
+
|
||||||
|
+ VIR_DEBUG("Host TSC frequency %llu Hz, scaling %s, tolerance +/- %llu Hz",
|
||||||
|
+ tsc->frequency, virTristateBoolTypeToString(tsc->scaling),
|
||||||
|
+ tolerance);
|
||||||
|
+
|
||||||
|
+ if (freq > minFreq && freq < maxFreq) {
|
||||||
|
+ VIR_DEBUG("Requested TSC frequency is within tolerance interval");
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- if (freq == tsc->frequency || tsc->scaling == VIR_TRISTATE_BOOL_YES)
|
||||||
|
+ if (tsc->scaling == VIR_TRISTATE_BOOL_YES)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (tsc->scaling == VIR_TRISTATE_BOOL_ABSENT) {
|
||||||
|
- VIR_DEBUG("TSC frequencies do not match and scaling support is "
|
||||||
|
- "unknown, QEMU will try and possibly fail later");
|
||||||
|
+ VIR_DEBUG("Requested TSC frequency falls outside tolerance range and "
|
||||||
|
+ "scaling support is unknown, QEMU will try and possibly "
|
||||||
|
+ "fail later");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
- _("Requested TSC frequency %llu Hz does not match "
|
||||||
|
- "host (%llu Hz) and TSC scaling is not supported "
|
||||||
|
- "by the host CPU"),
|
||||||
|
- freq, tsc->frequency);
|
||||||
|
+ _("Requested TSC frequency %llu Hz is outside tolerance "
|
||||||
|
+ "range ([%llu, %llu] Hz) around host frequency %llu Hz "
|
||||||
|
+ "and TSC scaling is not supported by the host CPU"),
|
||||||
|
+ freq, minFreq, maxFreq, tsc->frequency);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
11728
qemu-Switch-to-accel.patch
Normal file
11728
qemu-Switch-to-accel.patch
Normal file
File diff suppressed because it is too large
Load Diff
566
qemu-implement-vhost-user-blk-support.patch
Normal file
566
qemu-implement-vhost-user-blk-support.patch
Normal file
@ -0,0 +1,566 @@
|
|||||||
|
From e07709c7275349eac376660c08bacc6d18f28ff8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 18:13:37 +0800
|
||||||
|
Subject: [PATCH 17/24] qemu: implement vhost-user-blk support
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Implements QEMU support for vhost-user-blk together with live
|
||||||
|
hotplug/unplug.
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||||
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
(cherry picked from commit d763466edc6e8d4965fb42092c6e8f4296acf6c6)
|
||||||
|
Signed-off-by: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_block.c | 40 ++++++++
|
||||||
|
src/qemu/qemu_block.h | 7 ++
|
||||||
|
src/qemu/qemu_command.c | 93 +++++++++++++++++--
|
||||||
|
src/qemu/qemu_command.h | 6 ++
|
||||||
|
src/qemu/qemu_domain.c | 13 +++
|
||||||
|
src/qemu/qemu_driver.c | 66 +++++++++++++
|
||||||
|
src/qemu/qemu_hotplug.c | 12 ++-
|
||||||
|
.../disk-vhostuser.x86_64-latest.args | 40 ++++++++
|
||||||
|
tests/qemuxml2argvtest.c | 1 +
|
||||||
|
9 files changed, 268 insertions(+), 10 deletions(-)
|
||||||
|
create mode 100644 tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
|
||||||
|
index 8bd6238238..0b7f2f6874 100644
|
||||||
|
--- a/src/qemu/qemu_block.c
|
||||||
|
+++ b/src/qemu/qemu_block.c
|
||||||
|
@@ -1553,6 +1553,8 @@ qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data)
|
||||||
|
VIR_FREE(data->httpcookiesecretAlias);
|
||||||
|
VIR_FREE(data->driveCmd);
|
||||||
|
VIR_FREE(data->driveAlias);
|
||||||
|
+ VIR_FREE(data->chardevAlias);
|
||||||
|
+ VIR_FREE(data->chardevCmd);
|
||||||
|
VIR_FREE(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1719,6 +1721,13 @@ qemuBlockStorageSourceAttachApply(qemuMonitorPtr mon,
|
||||||
|
data->driveAdded = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (data->chardevDef) {
|
||||||
|
+ if (qemuMonitorAttachCharDev(mon, data->chardevAlias, data->chardevDef) < 0)
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ data->chardevAdded = true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1741,6 +1750,13 @@ qemuBlockStorageSourceAttachRollback(qemuMonitorPtr mon,
|
||||||
|
|
||||||
|
virErrorPreserveLast(&orig_err);
|
||||||
|
|
||||||
|
+ if (data->chardevAdded) {
|
||||||
|
+ if (qemuMonitorDetachCharDev(mon, data->chardevAlias) < 0) {
|
||||||
|
+ VIR_WARN("Unable to remove chardev %s after failed " "qemuMonitorAddDevice",
|
||||||
|
+ data->chardevAlias);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (data->driveAdded) {
|
||||||
|
if (qemuMonitorDriveDel(mon, data->driveAlias) < 0)
|
||||||
|
VIR_WARN("Unable to remove drive %s (%s) after failed "
|
||||||
|
@@ -1904,6 +1920,30 @@ qemuBlockStorageSourceChainDetachPrepareDrive(virStorageSourcePtr src,
|
||||||
|
return g_steal_pointer(&data);
|
||||||
|
}
|
||||||
|
|
||||||
|
+/**
|
||||||
|
+ * qemuBlockStorageSourceChainDetachPrepareChardev
|
||||||
|
+ * @src: storage source chain to remove
|
||||||
|
+ *
|
||||||
|
+ * Prepares qemuBlockStorageSourceChainDataPtr for detaching @src and its
|
||||||
|
+ * backingStore if -chardev was used.
|
||||||
|
+ */
|
||||||
|
+qemuBlockStorageSourceChainDataPtr
|
||||||
|
+qemuBlockStorageSourceChainDetachPrepareChardev(char *chardevAlias)
|
||||||
|
+{
|
||||||
|
+ g_autoptr(qemuBlockStorageSourceAttachData) backend = NULL;
|
||||||
|
+ g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
|
||||||
|
+
|
||||||
|
+ data = g_new0(qemuBlockStorageSourceChainData, 1);
|
||||||
|
+ backend = g_new0(qemuBlockStorageSourceAttachData, 1);
|
||||||
|
+
|
||||||
|
+ backend->chardevAlias = chardevAlias;
|
||||||
|
+ backend->chardevAdded = true;
|
||||||
|
+
|
||||||
|
+ if (VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, backend) < 0)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ return g_steal_pointer(&data);
|
||||||
|
+}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qemuBlockStorageSourceChainAttach:
|
||||||
|
diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h
|
||||||
|
index 2ad2ce1a1f..862572e028 100644
|
||||||
|
--- a/src/qemu/qemu_block.h
|
||||||
|
+++ b/src/qemu/qemu_block.h
|
||||||
|
@@ -94,6 +94,11 @@ struct qemuBlockStorageSourceAttachData {
|
||||||
|
char *driveAlias;
|
||||||
|
bool driveAdded;
|
||||||
|
|
||||||
|
+ virDomainChrSourceDefPtr chardevDef;
|
||||||
|
+ char *chardevAlias;
|
||||||
|
+ char *chardevCmd;
|
||||||
|
+ bool chardevAdded;
|
||||||
|
+
|
||||||
|
virJSONValuePtr authsecretProps;
|
||||||
|
char *authsecretAlias;
|
||||||
|
|
||||||
|
@@ -153,6 +158,8 @@ qemuBlockStorageSourceChainDetachPrepareBlockdev(virStorageSourcePtr src);
|
||||||
|
qemuBlockStorageSourceChainDataPtr
|
||||||
|
qemuBlockStorageSourceChainDetachPrepareDrive(virStorageSourcePtr src,
|
||||||
|
char *driveAlias);
|
||||||
|
+qemuBlockStorageSourceChainDataPtr
|
||||||
|
+qemuBlockStorageSourceChainDetachPrepareChardev(char *chardevAlias);
|
||||||
|
|
||||||
|
int
|
||||||
|
qemuBlockStorageSourceChainAttach(qemuMonitorPtr mon,
|
||||||
|
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
||||||
|
index bc62843783..4b12be6ede 100644
|
||||||
|
--- a/src/qemu/qemu_command.c
|
||||||
|
+++ b/src/qemu/qemu_command.c
|
||||||
|
@@ -2152,9 +2152,16 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VIR_DOMAIN_DISK_BUS_VIRTIO:
|
||||||
|
- if (qemuBuildVirtioDevStr(&opt, "virtio-blk", qemuCaps,
|
||||||
|
- VIR_DOMAIN_DEVICE_DISK, disk) < 0) {
|
||||||
|
- return NULL;
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ if (qemuBuildVirtioDevStr(&opt, "vhost-user-blk", qemuCaps,
|
||||||
|
+ VIR_DOMAIN_DEVICE_DISK, disk) < 0) {
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ if (qemuBuildVirtioDevStr(&opt, "virtio-blk", qemuCaps,
|
||||||
|
+ VIR_DOMAIN_DEVICE_DISK, disk) < 0) {
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (disk->iothread)
|
||||||
|
@@ -2231,11 +2238,17 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
|
||||||
|
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISK_SHARE_RW))
|
||||||
|
virBufferAddLit(&opt, ",share-rw=on");
|
||||||
|
|
||||||
|
- if (qemuDomainDiskGetBackendAlias(disk, qemuCaps, &backendAlias) < 0)
|
||||||
|
- return NULL;
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ backendAlias = qemuDomainGetVhostUserChrAlias(disk->info.alias);
|
||||||
|
|
||||||
|
- if (backendAlias)
|
||||||
|
- virBufferAsprintf(&opt, ",drive=%s", backendAlias);
|
||||||
|
+ virBufferAsprintf(&opt, ",chardev=%s", backendAlias);
|
||||||
|
+ } else {
|
||||||
|
+ if (qemuDomainDiskGetBackendAlias(disk, qemuCaps, &backendAlias) < 0)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ if (backendAlias)
|
||||||
|
+ virBufferAsprintf(&opt, ",drive=%s", backendAlias);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
virBufferAsprintf(&opt, ",id=%s", disk->info.alias);
|
||||||
|
if (bootindex)
|
||||||
|
@@ -2453,6 +2466,9 @@ qemuBuildBlockStorageSourceAttachDataCommandline(virCommandPtr cmd,
|
||||||
|
if (data->driveCmd)
|
||||||
|
virCommandAddArgList(cmd, "-drive", data->driveCmd, NULL);
|
||||||
|
|
||||||
|
+ if (data->chardevCmd)
|
||||||
|
+ virCommandAddArgList(cmd, "-chardev", data->chardevCmd, NULL);
|
||||||
|
+
|
||||||
|
if (data->storageProps) {
|
||||||
|
if (!(tmp = virJSONValueToString(data->storageProps, false)))
|
||||||
|
return -1;
|
||||||
|
@@ -2492,7 +2508,10 @@ qemuBuildDiskSourceCommandLine(virCommandPtr cmd,
|
||||||
|
g_autofree char *copyOnReadPropsStr = NULL;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ if (!(data = qemuBuildStorageSourceChainAttachPrepareChardev(disk)))
|
||||||
|
+ return -1;
|
||||||
|
+ } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
||||||
|
if (virStorageSourceIsEmpty(disk->src))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
@@ -10437,6 +10456,39 @@ qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDefPtr disk,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
+/**
|
||||||
|
+ * qemuBuildStorageSourceAttachPrepareChardev:
|
||||||
|
+ * @src: disk source to prepare
|
||||||
|
+ *
|
||||||
|
+ * Prepare qemuBlockStorageSourceAttachDataPtr for vhost-user disk
|
||||||
|
+ * to be used with -chardev.
|
||||||
|
+ */
|
||||||
|
+qemuBlockStorageSourceAttachDataPtr
|
||||||
|
+qemuBuildStorageSourceAttachPrepareChardev(virDomainDiskDefPtr disk)
|
||||||
|
+{
|
||||||
|
+ g_autoptr(qemuBlockStorageSourceAttachData) data = NULL;
|
||||||
|
+ g_auto(virBuffer) chardev = VIR_BUFFER_INITIALIZER;
|
||||||
|
+
|
||||||
|
+ data = g_new0(qemuBlockStorageSourceAttachData, 1);
|
||||||
|
+
|
||||||
|
+ data->chardevDef = disk->src->vhostuser;
|
||||||
|
+ data->chardevAlias = qemuDomainGetVhostUserChrAlias(disk->info.alias);
|
||||||
|
+
|
||||||
|
+ virBufferAddLit(&chardev, "socket");
|
||||||
|
+ virBufferAsprintf(&chardev, ",id=%s", data->chardevAlias);
|
||||||
|
+ virBufferAddLit(&chardev, ",path=");
|
||||||
|
+ virQEMUBuildBufferEscapeComma(&chardev, disk->src->vhostuser->data.nix.path);
|
||||||
|
+
|
||||||
|
+ qemuBuildChrChardevReconnectStr(&chardev,
|
||||||
|
+ &disk->src->vhostuser->data.nix.reconnect);
|
||||||
|
+
|
||||||
|
+ if (!(data->chardevCmd = virBufferContentAndReset(&chardev)))
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ return g_steal_pointer(&data);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* qemuBuildStorageSourceAttachPrepareCommon:
|
||||||
|
* @src: storage source
|
||||||
|
@@ -10513,6 +10565,31 @@ qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDefPtr disk,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
+/**
|
||||||
|
+ * qemuBuildStorageSourceChainAttachPrepareChardev:
|
||||||
|
+ * @src: disk definition
|
||||||
|
+ *
|
||||||
|
+ * Prepares qemuBlockStorageSourceChainDataPtr for attaching a vhost-user
|
||||||
|
+ * disk's backend via -chardev.
|
||||||
|
+ */
|
||||||
|
+qemuBlockStorageSourceChainDataPtr
|
||||||
|
+qemuBuildStorageSourceChainAttachPrepareChardev(virDomainDiskDefPtr disk)
|
||||||
|
+{
|
||||||
|
+ g_autoptr(qemuBlockStorageSourceAttachData) elem = NULL;
|
||||||
|
+ g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
|
||||||
|
+
|
||||||
|
+ data = g_new0(qemuBlockStorageSourceChainData, 1);
|
||||||
|
+
|
||||||
|
+ if (!(elem = qemuBuildStorageSourceAttachPrepareChardev(disk)))
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ if (VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, elem) < 0)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ return g_steal_pointer(&data);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
static int
|
||||||
|
qemuBuildStorageSourceChainAttachPrepareBlockdevOne(qemuBlockStorageSourceChainData *data,
|
||||||
|
virStorageSourcePtr src,
|
||||||
|
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
|
||||||
|
index 4b1c2103c5..283aaf358c 100644
|
||||||
|
--- a/src/qemu/qemu_command.h
|
||||||
|
+++ b/src/qemu/qemu_command.h
|
||||||
|
@@ -115,6 +115,10 @@ qemuBlockStorageSourceAttachDataPtr
|
||||||
|
qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDefPtr disk,
|
||||||
|
const virDomainDef *def,
|
||||||
|
virQEMUCapsPtr qemuCaps);
|
||||||
|
+
|
||||||
|
+qemuBlockStorageSourceAttachDataPtr
|
||||||
|
+qemuBuildStorageSourceAttachPrepareChardev(virDomainDiskDefPtr disk);
|
||||||
|
+
|
||||||
|
int
|
||||||
|
qemuBuildStorageSourceAttachPrepareCommon(virStorageSourcePtr src,
|
||||||
|
qemuBlockStorageSourceAttachDataPtr data,
|
||||||
|
@@ -126,6 +130,8 @@ qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDefPtr disk,
|
||||||
|
const virDomainDef *def,
|
||||||
|
virQEMUCapsPtr qemuCaps);
|
||||||
|
|
||||||
|
+qemuBlockStorageSourceChainDataPtr
|
||||||
|
+qemuBuildStorageSourceChainAttachPrepareChardev(virDomainDiskDefPtr disk);
|
||||||
|
|
||||||
|
qemuBlockStorageSourceChainDataPtr
|
||||||
|
qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top,
|
||||||
|
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
||||||
|
index c315717c8a..b2ac1d37cc 100644
|
||||||
|
--- a/src/qemu/qemu_domain.c
|
||||||
|
+++ b/src/qemu/qemu_domain.c
|
||||||
|
@@ -7250,6 +7250,14 @@ qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk,
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (disk->src->type == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_USER_BLK)) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("vhostuser disk is not supported with this QEMU binary"));
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
for (n = disk->src; virStorageSourceIsBacking(n); n = n->backingStore) {
|
||||||
|
if (qemuDomainValidateStorageSource(n, qemuCaps) < 0)
|
||||||
|
return -1;
|
||||||
|
@@ -16767,6 +16775,11 @@ qemuDomainPrepareDiskSource(virDomainDiskDefPtr disk,
|
||||||
|
qemuDomainObjPrivatePtr priv,
|
||||||
|
virQEMUDriverConfigPtr cfg)
|
||||||
|
{
|
||||||
|
+ /* Nothing to prepare as it will use -chardev instead
|
||||||
|
+ * of -blockdev/-drive option. */
|
||||||
|
+ if (disk->src->type == VIR_STORAGE_TYPE_VHOST_USER)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
qemuDomainPrepareDiskCachemode(disk);
|
||||||
|
|
||||||
|
/* set default format for storage pool based disks */
|
||||||
|
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||||
|
index b2ad021e4d..1791e3c902 100644
|
||||||
|
--- a/src/qemu/qemu_driver.c
|
||||||
|
+++ b/src/qemu/qemu_driver.c
|
||||||
|
@@ -10707,6 +10707,12 @@ qemuDomainBlockResize(virDomainPtr dom,
|
||||||
|
goto endjob;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
|
+ _("block resize is not supported for vhostuser disk"));
|
||||||
|
+ goto endjob;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* qcow2 and qed must be sized on 512 byte blocks/sectors,
|
||||||
|
* so adjust size if necessary to round up.
|
||||||
|
*/
|
||||||
|
@@ -10798,6 +10804,12 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
|
+ _("block stats are not supported for vhostuser disk"));
|
||||||
|
+ goto cleanup;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (blockdev) {
|
||||||
|
entryname = QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName;
|
||||||
|
} else {
|
||||||
|
@@ -10854,6 +10866,10 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
|
||||||
|
disk = vm->def->disks[i];
|
||||||
|
entryname = disk->info.alias;
|
||||||
|
|
||||||
|
+ /* No stats to report for vhost-user disk */
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER)
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
if (blockdev)
|
||||||
|
entryname = QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName;
|
||||||
|
|
||||||
|
@@ -11483,6 +11499,12 @@ qemuDomainBlockPeek(virDomainPtr dom,
|
||||||
|
if (!(disk = qemuDomainDiskByName(vm->def, path)))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
|
+ _("peeking is not supported for vhostuser disk"));
|
||||||
|
+ goto cleanup;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (disk->src->format != VIR_STORAGE_FILE_RAW) {
|
||||||
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||||
|
_("peeking is only supported for disk with 'raw' format not '%s'"),
|
||||||
|
@@ -11840,6 +11862,12 @@ qemuDomainGetBlockInfo(virDomainPtr dom,
|
||||||
|
goto endjob;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
|
+ _("block info is not supported for vhostuser disk"));
|
||||||
|
+ goto endjob;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (virStorageSourceIsEmpty(disk->src)) {
|
||||||
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
|
_("disk '%s' does not currently have a source assigned"),
|
||||||
|
@@ -18882,6 +18910,19 @@ typedef enum {
|
||||||
|
} qemuBlockIoTuneSetFlags;
|
||||||
|
|
||||||
|
|
||||||
|
+static bool
|
||||||
|
+qemuDomainDiskBlockIoTuneIsSupported(virStorageSourcePtr src)
|
||||||
|
+{
|
||||||
|
+ if (virStorageSourceGetActualType(src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
+ _("a block I/O throttling is not supported for vhostuser disk"));
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return true;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
/* If the user didn't specify bytes limits, inherit previous values;
|
||||||
|
* likewise if the user didn't specify iops limits. */
|
||||||
|
static int
|
||||||
|
@@ -19250,6 +19291,9 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
|
||||||
|
if (!(disk = qemuDomainDiskByName(def, path)))
|
||||||
|
goto endjob;
|
||||||
|
|
||||||
|
+ if (!qemuDomainDiskBlockIoTuneIsSupported(disk->src))
|
||||||
|
+ goto endjob;
|
||||||
|
+
|
||||||
|
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
||||||
|
qdevid = QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName;
|
||||||
|
} else {
|
||||||
|
@@ -19257,6 +19301,9 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
|
||||||
|
goto endjob;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (!qemuDomainDiskBlockIoTuneIsSupported(conf_disk->src))
|
||||||
|
+ goto endjob;
|
||||||
|
+
|
||||||
|
cur_info = qemuDomainFindGroupBlockIoTune(def, disk, &info);
|
||||||
|
|
||||||
|
if (qemuDomainSetBlockIoTuneDefaults(&info, cur_info,
|
||||||
|
@@ -19440,6 +19487,9 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
|
||||||
|
if (!(disk = qemuDomainDiskByName(def, path)))
|
||||||
|
goto endjob;
|
||||||
|
|
||||||
|
+ if (!qemuDomainDiskBlockIoTuneIsSupported(disk->src))
|
||||||
|
+ goto endjob;
|
||||||
|
+
|
||||||
|
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
||||||
|
qdevid = QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName;
|
||||||
|
} else {
|
||||||
|
@@ -19461,6 +19511,10 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
|
||||||
|
path);
|
||||||
|
goto endjob;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (!qemuDomainDiskBlockIoTuneIsSupported(disk->src))
|
||||||
|
+ goto endjob;
|
||||||
|
+
|
||||||
|
reply = disk->blkdeviotune;
|
||||||
|
|
||||||
|
/* Group name needs to be copied since qemuMonitorGetBlockIoThrottle
|
||||||
|
@@ -21389,6 +21443,12 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDefPtr disk,
|
||||||
|
VIR_INFO("optional disk '%s' source file is missing, "
|
||||||
|
"skip getting stats", disk->dst);
|
||||||
|
|
||||||
|
+ return qemuDomainGetStatsBlockExportHeader(disk, disk->src, *recordnr,
|
||||||
|
+ params);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* vhost-user disk doesn't support getting block stats */
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
if (qemuDomainGetStatsBlockExportHeader(disk, disk->src, *recordnr,
|
||||||
|
params) < 0) {
|
||||||
|
return -1;
|
||||||
|
@@ -22638,6 +22698,12 @@ qemuDomainSetBlockThreshold(virDomainPtr dom,
|
||||||
|
if (!(src = qemuDomainGetStorageSourceByDevstr(dev, vm->def)))
|
||||||
|
goto endjob;
|
||||||
|
|
||||||
|
+ if (virStorageSourceGetActualType(src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
|
+ _("setting device threshold is not supported for vhostuser disk"));
|
||||||
|
+ goto endjob;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (!src->nodestorage &&
|
||||||
|
qemuBlockNodeNamesDetect(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
|
||||||
|
goto endjob;
|
||||||
|
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
||||||
|
index c9347bac04..cb571c3161 100644
|
||||||
|
--- a/src/qemu/qemu_hotplug.c
|
||||||
|
+++ b/src/qemu/qemu_hotplug.c
|
||||||
|
@@ -702,7 +702,10 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver,
|
||||||
|
if (qemuDomainPrepareDiskSource(disk, priv, cfg) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
- if (blockdev) {
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ if (!(data = qemuBuildStorageSourceChainAttachPrepareChardev(disk)))
|
||||||
|
+ goto cleanup;
|
||||||
|
+ } else if (blockdev) {
|
||||||
|
if (disk->copy_on_read == VIR_TRISTATE_SWITCH_ON) {
|
||||||
|
if (!(corProps = qemuBlockStorageGetCopyOnReadProps(disk)))
|
||||||
|
goto cleanup;
|
||||||
|
@@ -4280,7 +4283,12 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
|
||||||
|
disk->info.alias, vm, vm->def->name);
|
||||||
|
|
||||||
|
|
||||||
|
- if (blockdev) {
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
|
||||||
|
+ char *chardevAlias = qemuDomainGetVhostUserChrAlias(disk->info.alias);
|
||||||
|
+
|
||||||
|
+ if (!(diskBackend = qemuBlockStorageSourceChainDetachPrepareChardev(chardevAlias)))
|
||||||
|
+ goto cleanup;
|
||||||
|
+ } else if (blockdev) {
|
||||||
|
corAlias = g_strdup(diskPriv->nodeCopyOnRead);
|
||||||
|
|
||||||
|
if (diskPriv->blockjob) {
|
||||||
|
diff --git a/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args b/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000..0a2b579e21
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args
|
||||||
|
@@ -0,0 +1,40 @@
|
||||||
|
+LC_ALL=C \
|
||||||
|
+PATH=/bin \
|
||||||
|
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
|
||||||
|
+USER=test \
|
||||||
|
+LOGNAME=test \
|
||||||
|
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
|
||||||
|
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
|
||||||
|
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
|
||||||
|
+QEMU_AUDIO_DRV=none \
|
||||||
|
+/usr/bin/qemu-system-x86_64 \
|
||||||
|
+-name guest=QEMUGuest1,debug-threads=on \
|
||||||
|
+-S \
|
||||||
|
+-object secret,id=masterKey0,format=raw,\
|
||||||
|
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
|
||||||
|
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-cpu qemu64 \
|
||||||
|
+-m 214 \
|
||||||
|
+-overcommit mem-lock=off \
|
||||||
|
+-smp 1,sockets=1,cores=1,threads=1 \
|
||||||
|
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||||
|
+-display none \
|
||||||
|
+-no-user-config \
|
||||||
|
+-nodefaults \
|
||||||
|
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
|
||||||
|
+-mon chardev=charmonitor,id=monitor,mode=control \
|
||||||
|
+-rtc base=utc \
|
||||||
|
+-no-shutdown \
|
||||||
|
+-no-acpi \
|
||||||
|
+-boot strict=on \
|
||||||
|
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
|
||||||
|
+-chardev socket,id=chr-vu-virtio-disk0,path=/tmp/vhost1.sock \
|
||||||
|
+-device vhost-user-blk-pci,bus=pci.0,addr=0x2,chardev=chr-vu-virtio-disk0,\
|
||||||
|
+id=virtio-disk0,bootindex=1 \
|
||||||
|
+-chardev socket,id=chr-vu-virtio-disk1,path=/tmp/vhost1.sock,reconnect=10 \
|
||||||
|
+-device vhost-user-blk-pci,bus=pci.0,addr=0x3,chardev=chr-vu-virtio-disk1,\
|
||||||
|
+id=virtio-disk1 \
|
||||||
|
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 \
|
||||||
|
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
|
||||||
|
+resourcecontrol=deny \
|
||||||
|
+-msg timestamp=on
|
||||||
|
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
|
||||||
|
index e07d6cf398..7b117f5984 100644
|
||||||
|
--- a/tests/qemuxml2argvtest.c
|
||||||
|
+++ b/tests/qemuxml2argvtest.c
|
||||||
|
@@ -1209,6 +1209,7 @@ mymain(void)
|
||||||
|
VIR_FREE(driver.config->vxhsTLSx509certdir);
|
||||||
|
DO_TEST("disk-no-boot", NONE);
|
||||||
|
DO_TEST_CAPS_LATEST("disk-nvme");
|
||||||
|
+ DO_TEST_CAPS_LATEST("disk-vhostuser");
|
||||||
|
DO_TEST_PARSE_ERROR("disk-device-lun-type-invalid",
|
||||||
|
QEMU_CAPS_VIRTIO_SCSI);
|
||||||
|
DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-attaching-partition-nosupport");
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
89
qemu_alias-introduce-qemuDomainGetVhostUserAlias-hel.patch
Normal file
89
qemu_alias-introduce-qemuDomainGetVhostUserAlias-hel.patch
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
From 3c0064480e35b794992cb66ed904d60b5d143d9a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 18:13:36 +0800
|
||||||
|
Subject: [PATCH 13/24] qemu_alias: introduce qemuDomainGetVhostUserAlias
|
||||||
|
helper
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||||
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
(cherry picked from commit 6799cc3ada6830c5e4beac0cb770671466d7768a)
|
||||||
|
Signed-off-by: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_alias.c | 6 ++++++
|
||||||
|
src/qemu/qemu_alias.h | 2 ++
|
||||||
|
src/qemu/qemu_command.c | 8 +++++---
|
||||||
|
3 files changed, 13 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c
|
||||||
|
index b0ea62af39..cfc6985c5a 100644
|
||||||
|
--- a/src/qemu/qemu_alias.c
|
||||||
|
+++ b/src/qemu/qemu_alias.c
|
||||||
|
@@ -836,3 +836,9 @@ qemuDomainGetDBusVMStateAlias(void)
|
||||||
|
{
|
||||||
|
return "dbus-vmstate0";
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+char *
|
||||||
|
+qemuDomainGetVhostUserChrAlias(const char *devalias)
|
||||||
|
+{
|
||||||
|
+ return g_strdup_printf("chr-vu-%s", devalias);
|
||||||
|
+}
|
||||||
|
diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h
|
||||||
|
index 239747beb1..fc4bdf35fa 100644
|
||||||
|
--- a/src/qemu/qemu_alias.h
|
||||||
|
+++ b/src/qemu/qemu_alias.h
|
||||||
|
@@ -97,3 +97,5 @@ const char *qemuDomainGetManagedPRAlias(void);
|
||||||
|
char *qemuDomainGetUnmanagedPRAlias(const char *parentalias);
|
||||||
|
|
||||||
|
const char *qemuDomainGetDBusVMStateAlias(void);
|
||||||
|
+
|
||||||
|
+char *qemuDomainGetVhostUserChrAlias(const char *devalias);
|
||||||
|
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
||||||
|
index 7bd24f042c..9157008b73 100644
|
||||||
|
--- a/src/qemu/qemu_command.c
|
||||||
|
+++ b/src/qemu/qemu_command.c
|
||||||
|
@@ -2633,7 +2633,7 @@ qemuBuildVHostUserFsCommandLine(virCommandPtr cmd,
|
||||||
|
g_autofree char *chardev_alias = NULL;
|
||||||
|
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
|
- chardev_alias = g_strdup_printf("chr-vu-%s", fs->info.alias);
|
||||||
|
+ chardev_alias = qemuDomainGetVhostUserChrAlias(fs->info.alias);
|
||||||
|
|
||||||
|
virCommandAddArg(cmd, "-chardev");
|
||||||
|
virBufferAddLit(&opt, "socket");
|
||||||
|
@@ -4603,9 +4603,10 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
|
||||||
|
virBufferAsprintf(&buf, ",max_outputs=%u", video->heads);
|
||||||
|
}
|
||||||
|
} else if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) {
|
||||||
|
+ g_autofree char *alias = qemuDomainGetVhostUserChrAlias(video->info.alias);
|
||||||
|
if (video->heads)
|
||||||
|
virBufferAsprintf(&buf, ",max_outputs=%u", video->heads);
|
||||||
|
- virBufferAsprintf(&buf, ",chardev=chr-vu-%s", video->info.alias);
|
||||||
|
+ virBufferAsprintf(&buf, ",chardev=%s", alias);
|
||||||
|
} else if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
|
||||||
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS)) {
|
||||||
|
if (video->heads)
|
||||||
|
@@ -4724,6 +4725,7 @@ qemuBuildVhostUserChardevStr(const char *alias,
|
||||||
|
int *fd,
|
||||||
|
virCommandPtr cmd)
|
||||||
|
{
|
||||||
|
+ g_autofree char *chardev_alias = qemuDomainGetVhostUserChrAlias(alias);
|
||||||
|
char *chardev = NULL;
|
||||||
|
|
||||||
|
if (*fd == -1) {
|
||||||
|
@@ -4732,7 +4734,7 @@ qemuBuildVhostUserChardevStr(const char *alias,
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
- chardev = g_strdup_printf("socket,id=chr-vu-%s,fd=%d", alias, *fd);
|
||||||
|
+ chardev = g_strdup_printf("socket,id=%s,fd=%d", chardev_alias, *fd);
|
||||||
|
|
||||||
|
virCommandPassFD(cmd, *fd, VIR_COMMAND_PASS_FD_CLOSE_PARENT);
|
||||||
|
*fd = -1;
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
53
qemu_capabilities-Fix-incorrect-alignment.patch
Normal file
53
qemu_capabilities-Fix-incorrect-alignment.patch
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
From a5c093b432f5b195e2ceab61ee03e5e2f246c13f Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
|
||||||
|
<huangy81@chinatelecom.cn>
|
||||||
|
Date: Mon, 5 Dec 2022 06:23:29 -0500
|
||||||
|
Subject: [PATCH 1/7] qemu_capabilities: Fix incorrect alignment
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_capabilities.c | 8 ++++----
|
||||||
|
src/qemu/qemu_capabilities.h | 2 +-
|
||||||
|
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
||||||
|
index 239c34393f..d78d8f1431 100644
|
||||||
|
--- a/src/qemu/qemu_capabilities.c
|
||||||
|
+++ b/src/qemu/qemu_capabilities.c
|
||||||
|
@@ -569,10 +569,10 @@ VIR_ENUM_IMPL(virQEMUCaps,
|
||||||
|
"blockdev-reopen",
|
||||||
|
"storage.werror",
|
||||||
|
|
||||||
|
- "migration-param.bandwidth",
|
||||||
|
- "migration-param.downtime",
|
||||||
|
- "migration-param.xbzrle-cache-size",
|
||||||
|
-
|
||||||
|
+ /* 360 */
|
||||||
|
+ "migration-param.bandwidth",
|
||||||
|
+ "migration-param.downtime",
|
||||||
|
+ "migration-param.xbzrle-cache-size",
|
||||||
|
"object.qapified",
|
||||||
|
"vhost-user-blk",
|
||||||
|
);
|
||||||
|
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
|
||||||
|
index a4e90d8dd5..165cacca3c 100644
|
||||||
|
--- a/src/qemu/qemu_capabilities.h
|
||||||
|
+++ b/src/qemu/qemu_capabilities.h
|
||||||
|
@@ -550,10 +550,10 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
|
||||||
|
QEMU_CAPS_BLOCKDEV_REOPEN, /* 'blockdev-reopen' qmp command is supported */
|
||||||
|
QEMU_CAPS_STORAGE_WERROR, /* virtio-blk,scsi-hd.werror */
|
||||||
|
|
||||||
|
+ /* 360 */
|
||||||
|
QEMU_CAPS_MIGRATION_PARAM_BANDWIDTH, /* max-bandwidth field in migrate-set-parameters */
|
||||||
|
QEMU_CAPS_MIGRATION_PARAM_DOWNTIME, /* downtime-limit field in migrate-set-parameters */
|
||||||
|
QEMU_CAPS_MIGRATION_PARAM_XBZRLE_CACHE_SIZE, /* xbzrle-cache-size field in migrate-set-parameters */
|
||||||
|
-
|
||||||
|
QEMU_CAPS_OBJECT_QAPIFIED, /* parameters for object-add are formally described */
|
||||||
|
QEMU_CAPS_DEVICE_VHOST_USER_BLK, /* -device vhost-user-blk */
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
59
qemu_capabilities-Introduce-QEMU_CAPS_CALC_DIRTY_RAT.patch
Normal file
59
qemu_capabilities-Introduce-QEMU_CAPS_CALC_DIRTY_RAT.patch
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
From 14088d9c72f7b2d383fcc8a74f3f8ada913f5703 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
|
||||||
|
<huangy81@chinatelecom.cn>
|
||||||
|
Date: Mon, 5 Dec 2022 06:34:56 -0500
|
||||||
|
Subject: [PATCH 3/7] qemu_capabilities: Introduce QEMU_CAPS_CALC_DIRTY_RATE
|
||||||
|
capability
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
calc-dirty-rate command was introduced since qemu >=5.2.0.
|
||||||
|
Introduce QEMU_CAPS_CALC_DIRTY_RATE capability definition.
|
||||||
|
|
||||||
|
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_capabilities.c | 4 ++++
|
||||||
|
src/qemu/qemu_capabilities.h | 3 +++
|
||||||
|
2 files changed, 7 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
||||||
|
index d78d8f1431..c9b0a6c191 100644
|
||||||
|
--- a/src/qemu/qemu_capabilities.c
|
||||||
|
+++ b/src/qemu/qemu_capabilities.c
|
||||||
|
@@ -575,6 +575,9 @@ VIR_ENUM_IMPL(virQEMUCaps,
|
||||||
|
"migration-param.xbzrle-cache-size",
|
||||||
|
"object.qapified",
|
||||||
|
"vhost-user-blk",
|
||||||
|
+
|
||||||
|
+ /* 365 */
|
||||||
|
+ "calc-dirty-rate",
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1144,6 +1147,7 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = {
|
||||||
|
{ "block-dirty-bitmap-merge", QEMU_CAPS_BITMAP_MERGE },
|
||||||
|
{ "query-cpu-model-baseline", QEMU_CAPS_QUERY_CPU_MODEL_BASELINE },
|
||||||
|
{ "query-cpu-model-comparison", QEMU_CAPS_QUERY_CPU_MODEL_COMPARISON },
|
||||||
|
+ { "calc-dirty-rate", QEMU_CAPS_CALC_DIRTY_RATE },
|
||||||
|
};
|
||||||
|
|
||||||
|
struct virQEMUCapsStringFlags virQEMUCapsMigration[] = {
|
||||||
|
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
|
||||||
|
index 165cacca3c..6245072fc3 100644
|
||||||
|
--- a/src/qemu/qemu_capabilities.h
|
||||||
|
+++ b/src/qemu/qemu_capabilities.h
|
||||||
|
@@ -557,6 +557,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
|
||||||
|
QEMU_CAPS_OBJECT_QAPIFIED, /* parameters for object-add are formally described */
|
||||||
|
QEMU_CAPS_DEVICE_VHOST_USER_BLK, /* -device vhost-user-blk */
|
||||||
|
|
||||||
|
+ /* 365 */
|
||||||
|
+ QEMU_CAPS_CALC_DIRTY_RATE, /* accepts calc-dirty-rate */
|
||||||
|
+
|
||||||
|
QEMU_CAPS_LAST /* this must always be the last item */
|
||||||
|
} virQEMUCapsFlags;
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
55
qemu_capabilities-Introduce-QEMU_CAPS_DIRTYRATE_MODE.patch
Normal file
55
qemu_capabilities-Introduce-QEMU_CAPS_DIRTYRATE_MODE.patch
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
From 5f7ef309cdd7237f945f43a29dab50fc61a4d1d0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
|
||||||
|
<huangy81@chinatelecom.cn>
|
||||||
|
Date: Mon, 5 Dec 2022 06:54:11 -0500
|
||||||
|
Subject: [PATCH 5/7] qemu_capabilities: Introduce QEMU_CAPS_DIRTYRATE_MODE
|
||||||
|
capability
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
mode option of calc-dirty-rate command since qemu >=6.2.0.
|
||||||
|
Introduce QEMU_CAPS_DIRTYRATE_MODE capability definition.
|
||||||
|
|
||||||
|
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_capabilities.c | 2 ++
|
||||||
|
src/qemu/qemu_capabilities.h | 1 +
|
||||||
|
2 files changed, 3 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
||||||
|
index c9b0a6c191..2e9f2025ba 100644
|
||||||
|
--- a/src/qemu/qemu_capabilities.c
|
||||||
|
+++ b/src/qemu/qemu_capabilities.c
|
||||||
|
@@ -578,6 +578,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
|
||||||
|
|
||||||
|
/* 365 */
|
||||||
|
"calc-dirty-rate",
|
||||||
|
+ "dirtyrate-param.mode",
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1160,6 +1161,7 @@ struct virQEMUCapsStringFlags virQEMUCapsEvents[] = {
|
||||||
|
{ "VSERPORT_CHANGE", QEMU_CAPS_VSERPORT_CHANGE },
|
||||||
|
{ "BLOCK_WRITE_THRESHOLD", QEMU_CAPS_BLOCK_WRITE_THRESHOLD },
|
||||||
|
{ "DUMP_COMPLETED", QEMU_CAPS_DUMP_COMPLETED },
|
||||||
|
+ { "calc-dirty-rate/arg-type/mode", QEMU_CAPS_DIRTYRATE_MODE },
|
||||||
|
};
|
||||||
|
|
||||||
|
struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
|
||||||
|
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
|
||||||
|
index 6245072fc3..00682eb52c 100644
|
||||||
|
--- a/src/qemu/qemu_capabilities.h
|
||||||
|
+++ b/src/qemu/qemu_capabilities.h
|
||||||
|
@@ -559,6 +559,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
|
||||||
|
|
||||||
|
/* 365 */
|
||||||
|
QEMU_CAPS_CALC_DIRTY_RATE, /* accepts calc-dirty-rate */
|
||||||
|
+ QEMU_CAPS_DIRTYRATE_MODE , /* calc-dirty-rate accepts mode parameter */
|
||||||
|
|
||||||
|
QEMU_CAPS_LAST /* this must always be the last item */
|
||||||
|
} virQEMUCapsFlags;
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
378
qemu_capabilities-introduce-vhost-user-blk-capabilit.patch
Normal file
378
qemu_capabilities-introduce-vhost-user-blk-capabilit.patch
Normal file
@ -0,0 +1,378 @@
|
|||||||
|
From 8814b1949fd108c82e800abd40e48f4fe331908d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 18:13:36 +0800
|
||||||
|
Subject: [PATCH 16/24] qemu_capabilities: introduce vhost-user-blk capability
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||||
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
(cherry picked from commit c8b0d5b0ad21925729ba88fa297d3b74a57ffa04)
|
||||||
|
Signed-off-by: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_capabilities.c | 2 ++
|
||||||
|
src/qemu/qemu_capabilities.h | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_4.0.0.s390x.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 +
|
||||||
|
tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml | 1 +
|
||||||
|
27 files changed, 28 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
||||||
|
index 790b67add3..239c34393f 100644
|
||||||
|
--- a/src/qemu/qemu_capabilities.c
|
||||||
|
+++ b/src/qemu/qemu_capabilities.c
|
||||||
|
@@ -574,6 +574,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
|
||||||
|
"migration-param.xbzrle-cache-size",
|
||||||
|
|
||||||
|
"object.qapified",
|
||||||
|
+ "vhost-user-blk",
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1296,6 +1297,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
|
||||||
|
{ "rng-builtin", QEMU_CAPS_OBJECT_RNG_BUILTIN },
|
||||||
|
{ "tpm-spapr", QEMU_CAPS_DEVICE_TPM_SPAPR },
|
||||||
|
{ "vhost-user-fs-device", QEMU_CAPS_DEVICE_VHOST_USER_FS },
|
||||||
|
+ { "vhost-user-blk", QEMU_CAPS_DEVICE_VHOST_USER_BLK },
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = {
|
||||||
|
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
|
||||||
|
index ffb366f84a..a4e90d8dd5 100644
|
||||||
|
--- a/src/qemu/qemu_capabilities.h
|
||||||
|
+++ b/src/qemu/qemu_capabilities.h
|
||||||
|
@@ -555,6 +555,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
|
||||||
|
QEMU_CAPS_MIGRATION_PARAM_XBZRLE_CACHE_SIZE, /* xbzrle-cache-size field in migrate-set-parameters */
|
||||||
|
|
||||||
|
QEMU_CAPS_OBJECT_QAPIFIED, /* parameters for object-add are formally described */
|
||||||
|
+ QEMU_CAPS_DEVICE_VHOST_USER_BLK, /* -device vhost-user-blk */
|
||||||
|
|
||||||
|
QEMU_CAPS_LAST /* this must always be the last item */
|
||||||
|
} virQEMUCapsFlags;
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml
|
||||||
|
index fddbfebddd..17efe68fca 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml
|
||||||
|
@@ -159,6 +159,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>2012000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>61700289</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
|
||||||
|
index 148b928520..8de40ac2f3 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
|
||||||
|
@@ -157,6 +157,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>2011090</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>42900289</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml
|
||||||
|
index 2b1301d234..047e40e8f5 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml
|
||||||
|
@@ -129,6 +129,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>2012000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>39100289</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
|
||||||
|
index 125346ffd7..8e85160640 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
|
||||||
|
@@ -201,6 +201,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>2011090</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>43100289</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml
|
||||||
|
index b4b9d7ee01..13d8630fdb 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml
|
||||||
|
@@ -159,6 +159,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>2012050</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>42900239</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml b/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml
|
||||||
|
index 14550b8c7f..8428d86d81 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml
|
||||||
|
@@ -99,6 +99,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>3000000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>0</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml
|
||||||
|
index 1479b2bb2d..90b95a6ac7 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml
|
||||||
|
@@ -99,6 +99,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>3000000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>0</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml b/tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml
|
||||||
|
index 96984d2bc3..a34621af95 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml
|
||||||
|
@@ -132,6 +132,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>3000000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>39100239</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml
|
||||||
|
index f936f502c3..d1fe99c084 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml
|
||||||
|
@@ -207,6 +207,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>3000000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>43100239</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml
|
||||||
|
index e1bc4beddb..b1cabb4b25 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml
|
||||||
|
@@ -164,6 +164,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>3000091</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>42900240</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
|
||||||
|
index f462022fb5..189ff2eccc 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
|
||||||
|
@@ -210,6 +210,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>3000092</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>43100240</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml
|
||||||
|
index 963c991d5e..51dadfb6b5 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml
|
||||||
|
@@ -173,6 +173,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4000000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>61700240</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml
|
||||||
|
index 2062fd0a90..6110f43f72 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml
|
||||||
|
@@ -178,6 +178,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4000000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>42900240</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml b/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml
|
||||||
|
index 3bd809f824..7dce580f7a 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml
|
||||||
|
@@ -174,6 +174,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4000000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>0</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml
|
||||||
|
index b0ad30460b..8e19ca0d2b 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml
|
||||||
|
@@ -174,6 +174,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4000000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>0</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.s390x.xml b/tests/qemucapabilitiesdata/caps_4.0.0.s390x.xml
|
||||||
|
index 44e527f570..4bb9269619 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_4.0.0.s390x.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.s390x.xml
|
||||||
|
@@ -140,6 +140,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4000000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>39100240</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
|
||||||
|
index ab43924eaa..c5e5ad831d 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
|
||||||
|
@@ -215,6 +215,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4000000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>43100240</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml
|
||||||
|
index aff2c6fcad..2088a7ad87 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml
|
||||||
|
@@ -221,6 +221,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4001000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>43100241</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml
|
||||||
|
index 6aa36bac54..90b538c0d2 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml
|
||||||
|
@@ -183,6 +183,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4001050</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>61700242</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml
|
||||||
|
index 871dc41579..a78fe3b8cd 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml
|
||||||
|
@@ -183,6 +183,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4001050</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>42900242</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml b/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml
|
||||||
|
index d007ae65d6..2a2b52e081 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml
|
||||||
|
@@ -142,6 +142,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4001050</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>39100242</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml
|
||||||
|
index 383aa10f49..2efef26fdf 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml
|
||||||
|
@@ -227,6 +227,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4002000</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>43100242</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
|
||||||
|
index af282f33c1..e4b06b850b 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
|
||||||
|
@@ -188,6 +188,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4002050</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>61700241</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
|
||||||
|
index 6842b3c28a..236107fec8 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
|
||||||
|
@@ -193,6 +193,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4002050</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>42900241</microcodeVersion>
|
||||||
|
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
|
||||||
|
index 577b96e6fa..9f7c960556 100644
|
||||||
|
--- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
|
||||||
|
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
|
||||||
|
@@ -230,6 +230,7 @@
|
||||||
|
<flag name='migration-param.bandwidth'/>
|
||||||
|
<flag name='migration-param.downtime'/>
|
||||||
|
<flag name='migration-param.xbzrle-cache-size'/>
|
||||||
|
+ <flag name='vhost-user-blk'/>
|
||||||
|
<version>4002050</version>
|
||||||
|
<kvmVersion>0</kvmVersion>
|
||||||
|
<microcodeVersion>43100241</microcodeVersion>
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
48
qemu_command-Don-t-validate-accelerator-when-buildin.patch
Normal file
48
qemu_command-Don-t-validate-accelerator-when-buildin.patch
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
From d048a83b990b08cc3709d6c4a505877533a4d189 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Date: Fri, 5 Nov 2021 09:33:45 +0100
|
||||||
|
Subject: [PATCH 1/2] qemu_command: Don't validate accelerator when building
|
||||||
|
cmd line
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
The domain accelerator was validated in qemuValidateDomainDef()
|
||||||
|
which calls virQEMUCapsIsVirtTypeSupported() which reports proper
|
||||||
|
error if QEMU is not capable of KVM/TCG. There is no point in
|
||||||
|
doing the validation again when building command line.
|
||||||
|
|
||||||
|
cherry-pick from 69f2f632994c8f8b51f0d0e4be0f674054619654
|
||||||
|
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
|
||||||
|
Tested-by: Kashyap Chamarthy <kchamart@redhat.com>
|
||||||
|
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_command.c | 9 +--------
|
||||||
|
1 file changed, 1 insertion(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
||||||
|
index 42f6e10b33..b009890e35 100644
|
||||||
|
--- a/src/qemu/qemu_command.c
|
||||||
|
+++ b/src/qemu/qemu_command.c
|
||||||
|
@@ -7084,15 +7084,8 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
|
||||||
|
case VIR_DOMAIN_VIRT_BHYVE:
|
||||||
|
case VIR_DOMAIN_VIRT_VZ:
|
||||||
|
case VIR_DOMAIN_VIRT_NONE:
|
||||||
|
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
- _("the QEMU binary does not support %s"),
|
||||||
|
- virDomainVirtTypeToString(def->virtType));
|
||||||
|
- return -1;
|
||||||
|
-
|
||||||
|
case VIR_DOMAIN_VIRT_LAST:
|
||||||
|
- default:
|
||||||
|
- virReportEnumRangeError(virDomainVirtType, def->virtType);
|
||||||
|
- return -1;
|
||||||
|
+ break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* To avoid the collision of creating USB controllers when calling
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
32
qemu_command-remove-redundant-scsi-option-in-vhost-u.patch
Normal file
32
qemu_command-remove-redundant-scsi-option-in-vhost-u.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From e9bfac2ed7631cca625d18f0a4a4a2644e2f14c6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 18:13:37 +0800
|
||||||
|
Subject: [PATCH 18/24] qemu_command: remove redundant scsi option in
|
||||||
|
vhost-user-blk
|
||||||
|
|
||||||
|
There is no scsi property for qemu vhost-user-blk device, so we disable
|
||||||
|
formatting scsi property for vhost-user-blk device, and leave the property for
|
||||||
|
vhost-blk device as is.
|
||||||
|
|
||||||
|
Signed-off-by: Luo Yifan <luoyifan_yewu@cmss.chinamobile.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_command.c | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
||||||
|
index 4b12be6ede..1e44291a8a 100644
|
||||||
|
--- a/src/qemu/qemu_command.c
|
||||||
|
+++ b/src/qemu/qemu_command.c
|
||||||
|
@@ -2173,7 +2173,8 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
|
||||||
|
virBufferAsprintf(&opt, ",event_idx=%s",
|
||||||
|
virTristateSwitchTypeToString(disk->event_idx));
|
||||||
|
}
|
||||||
|
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_BLK_SCSI)) {
|
||||||
|
+ if (virStorageSourceGetActualType(disk->src) != VIR_STORAGE_TYPE_VHOST_USER &&
|
||||||
|
+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_BLK_SCSI)) {
|
||||||
|
/* if sg_io is true but the scsi option isn't supported,
|
||||||
|
* that means it's just always on in this version of qemu.
|
||||||
|
*/
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
31
qemu_driver-Acquire-MODIFY-job-in-qemuDomainStartDir.patch
Normal file
31
qemu_driver-Acquire-MODIFY-job-in-qemuDomainStartDir.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
From 3030fc4e45964c3f7dec3dfe1646be703a4a398e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Date: Mon, 29 Mar 2021 13:53:50 +0200
|
||||||
|
Subject: [PATCH 2/7] qemu_driver: Acquire MODIFY job in
|
||||||
|
qemuDomainStartDirtyRateCalc()
|
||||||
|
|
||||||
|
This API talks to QEMU and changes its internal state. Therefore,
|
||||||
|
it should acquire QEMU_JOB_MODIFY instead of QEMU_JOB_QUERY.
|
||||||
|
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_driver.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||||
|
index 1791e3c902..62806da86a 100644
|
||||||
|
--- a/src/qemu/qemu_driver.c
|
||||||
|
+++ b/src/qemu/qemu_driver.c
|
||||||
|
@@ -23332,7 +23332,7 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom,
|
||||||
|
if (virDomainStartDirtyRateCalcEnsureACL(dom->conn, vm->def) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
|
||||||
|
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
if (!virDomainObjIsActive(vm)) {
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
146
qemu_driver-Add-mode-parameter-to-qemuDomainStartDir.patch
Normal file
146
qemu_driver-Add-mode-parameter-to-qemuDomainStartDir.patch
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
From 56e4777e883bb3c11f4951848080104a2098277f Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
|
||||||
|
<huangy81@chinatelecom.cn>
|
||||||
|
Date: Mon, 5 Dec 2022 07:05:23 -0500
|
||||||
|
Subject: [PATCH 7/7] qemu_driver: Add mode parameter to
|
||||||
|
qemuDomainStartDirtyRateCalc
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Add mode parameter to qemuDomainStartDirtyRateCalc API, 'mode'
|
||||||
|
option of 'calc-dirty-rate' command was introduced since
|
||||||
|
qemu >= 6.2.
|
||||||
|
|
||||||
|
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_driver.c | 3 ++-
|
||||||
|
src/qemu/qemu_monitor.c | 5 +++--
|
||||||
|
src/qemu/qemu_monitor.h | 17 ++++++++++++++++-
|
||||||
|
src/qemu/qemu_monitor_json.c | 14 +++++++++++++-
|
||||||
|
src/qemu/qemu_monitor_json.h | 3 ++-
|
||||||
|
5 files changed, 36 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||||
|
index 19d32b5fa3..8b19be46f1 100644
|
||||||
|
--- a/src/qemu/qemu_driver.c
|
||||||
|
+++ b/src/qemu/qemu_driver.c
|
||||||
|
@@ -23312,6 +23312,7 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom,
|
||||||
|
virQEMUDriverPtr driver = dom->conn->privateData;
|
||||||
|
virDomainObjPtr vm;
|
||||||
|
qemuDomainObjPrivatePtr priv;
|
||||||
|
+ qemuMonitorDirtyRateCalcMode mode = QEMU_MONITOR_DIRTYRATE_CALC_MODE_PAGE_SAMPLING;
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
|
virCheckFlags(0, -1);
|
||||||
|
@@ -23354,7 +23355,7 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom,
|
||||||
|
VIR_DEBUG("Calculate dirty rate in next %d seconds", seconds);
|
||||||
|
|
||||||
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
|
- ret = qemuMonitorStartDirtyRateCalc(priv->mon, seconds);
|
||||||
|
+ ret = qemuMonitorStartDirtyRateCalc(priv->mon, seconds, mode);
|
||||||
|
|
||||||
|
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||||
|
ret = -1;
|
||||||
|
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
|
||||||
|
index 05855c0ae9..04592fdcd5 100644
|
||||||
|
--- a/src/qemu/qemu_monitor.c
|
||||||
|
+++ b/src/qemu/qemu_monitor.c
|
||||||
|
@@ -4646,13 +4646,14 @@ qemuMonitorTransactionBackup(virJSONValuePtr actions,
|
||||||
|
|
||||||
|
int
|
||||||
|
qemuMonitorStartDirtyRateCalc(qemuMonitorPtr mon,
|
||||||
|
- int seconds)
|
||||||
|
+ int seconds,
|
||||||
|
+ qemuMonitorDirtyRateCalcMode mode)
|
||||||
|
{
|
||||||
|
VIR_DEBUG("seconds=%d", seconds);
|
||||||
|
|
||||||
|
QEMU_CHECK_MONITOR(mon);
|
||||||
|
|
||||||
|
- return qemuMonitorJSONStartDirtyRateCalc(mon, seconds);
|
||||||
|
+ return qemuMonitorJSONStartDirtyRateCalc(mon, seconds, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
|
||||||
|
index 9c797d5ff5..4f9b70d820 100644
|
||||||
|
--- a/src/qemu/qemu_monitor.h
|
||||||
|
+++ b/src/qemu/qemu_monitor.h
|
||||||
|
@@ -1426,9 +1426,24 @@ qemuMonitorTransactionBackup(virJSONValuePtr actions,
|
||||||
|
const char *bitmap,
|
||||||
|
qemuMonitorTransactionBackupSyncMode syncmode);
|
||||||
|
|
||||||
|
+/**
|
||||||
|
+ * qemuMonitorDirtyRateCalcMode:
|
||||||
|
+ *
|
||||||
|
+ * Dirty page rate calculation mode used during measurement.
|
||||||
|
+ */
|
||||||
|
+typedef enum {
|
||||||
|
+ QEMU_MONITOR_DIRTYRATE_CALC_MODE_PAGE_SAMPLING = 0,
|
||||||
|
+ QEMU_MONITOR_DIRTYRATE_CALC_MODE_DIRTY_BITMAP,
|
||||||
|
+ QEMU_MONITOR_DIRTYRATE_CALC_MODE_DIRTY_RING,
|
||||||
|
+ QEMU_MONITOR_DIRTYRATE_CALC_MODE_LAST,
|
||||||
|
+} qemuMonitorDirtyRateCalcMode;
|
||||||
|
+
|
||||||
|
+VIR_ENUM_DECL(qemuMonitorDirtyRateCalcMode);
|
||||||
|
+
|
||||||
|
int
|
||||||
|
qemuMonitorStartDirtyRateCalc(qemuMonitorPtr mon,
|
||||||
|
- int seconds);
|
||||||
|
+ int seconds,
|
||||||
|
+ qemuMonitorDirtyRateCalcMode mode);
|
||||||
|
|
||||||
|
typedef struct _qemuMonitorDirtyRateInfo qemuMonitorDirtyRateInfo;
|
||||||
|
typedef qemuMonitorDirtyRateInfo *qemuMonitorDirtyRateInfoPtr;
|
||||||
|
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
|
||||||
|
index 3ec7fc84f5..a1617cdfed 100644
|
||||||
|
--- a/src/qemu/qemu_monitor_json.c
|
||||||
|
+++ b/src/qemu/qemu_monitor_json.c
|
||||||
|
@@ -9375,15 +9375,27 @@ qemuMonitorJSONGetJobInfo(qemuMonitorPtr mon,
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+VIR_ENUM_IMPL(qemuMonitorDirtyRateCalcMode,
|
||||||
|
+ QEMU_MONITOR_DIRTYRATE_CALC_MODE_LAST,
|
||||||
|
+ "page-sampling",
|
||||||
|
+ "dirty-bitmap",
|
||||||
|
+ "dirty-ring");
|
||||||
|
+
|
||||||
|
int
|
||||||
|
qemuMonitorJSONStartDirtyRateCalc(qemuMonitorPtr mon,
|
||||||
|
- int seconds)
|
||||||
|
+ int seconds,
|
||||||
|
+ qemuMonitorDirtyRateCalcMode mode)
|
||||||
|
{
|
||||||
|
g_autoptr(virJSONValue) cmd = NULL;
|
||||||
|
g_autoptr(virJSONValue) reply = NULL;
|
||||||
|
+ const char *modestr = NULL;
|
||||||
|
+
|
||||||
|
+ if (mode != QEMU_MONITOR_DIRTYRATE_CALC_MODE_PAGE_SAMPLING)
|
||||||
|
+ modestr = qemuMonitorDirtyRateCalcModeTypeToString(mode);
|
||||||
|
|
||||||
|
if (!(cmd = qemuMonitorJSONMakeCommand("calc-dirty-rate",
|
||||||
|
"i:calc-time", seconds,
|
||||||
|
+ "S:mode", modestr,
|
||||||
|
NULL)))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
|
||||||
|
index 531ff59a00..3fc67c4668 100644
|
||||||
|
--- a/src/qemu/qemu_monitor_json.h
|
||||||
|
+++ b/src/qemu/qemu_monitor_json.h
|
||||||
|
@@ -694,7 +694,8 @@ int qemuMonitorJSONSetDBusVMStateIdList(qemuMonitorPtr mon,
|
||||||
|
|
||||||
|
int
|
||||||
|
qemuMonitorJSONStartDirtyRateCalc(qemuMonitorPtr mon,
|
||||||
|
- int seconds);
|
||||||
|
+ int seconds,
|
||||||
|
+ qemuMonitorDirtyRateCalcMode mode);
|
||||||
|
|
||||||
|
int
|
||||||
|
qemuMonitorJSONQueryDirtyRate(qemuMonitorPtr mon,
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
52
qemu_driver-Probe-capability-before-calculating-dirt.patch
Normal file
52
qemu_driver-Probe-capability-before-calculating-dirt.patch
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
From 7889fb1123cbe6aca437797005b8b18b3d5ae93a Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
|
||||||
|
<huangy81@chinatelecom.cn>
|
||||||
|
Date: Sun, 20 Feb 2022 21:28:09 +0800
|
||||||
|
Subject: [PATCH 4/7] qemu_driver: Probe capability before calculating dirty
|
||||||
|
page rate
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Probing QEMU_CAPS_CALC_DIRTY_RATE capability in advance
|
||||||
|
in case of failure when calculating dirty page rate.
|
||||||
|
|
||||||
|
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_driver.c | 11 ++++++++++-
|
||||||
|
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||||
|
index 62806da86a..19d32b5fa3 100644
|
||||||
|
--- a/src/qemu/qemu_driver.c
|
||||||
|
+++ b/src/qemu/qemu_driver.c
|
||||||
|
@@ -23332,6 +23332,16 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom,
|
||||||
|
if (virDomainStartDirtyRateCalcEnsureACL(dom->conn, vm->def) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
+ if (virDomainObjCheckActive(vm) < 0)
|
||||||
|
+ goto cleanup;
|
||||||
|
+
|
||||||
|
+ priv = vm->privateData;
|
||||||
|
+ if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CALC_DIRTY_RATE)) {
|
||||||
|
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
|
+ _("QEMU does not support calculating dirty page rate"));
|
||||||
|
+ goto cleanup;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
@@ -23343,7 +23353,6 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom,
|
||||||
|
|
||||||
|
VIR_DEBUG("Calculate dirty rate in next %d seconds", seconds);
|
||||||
|
|
||||||
|
- priv = vm->privateData;
|
||||||
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
|
ret = qemuMonitorStartDirtyRateCalc(priv->mon, seconds);
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
70
security_util-Don-t-error-on-macOS-when-getting-sett.patch
Normal file
70
security_util-Don-t-error-on-macOS-when-getting-sett.patch
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
From 4d7194ab0b86772ea1a25eaf0e5e7e69fa2ba5e9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 07:32:05 +0000
|
||||||
|
Subject: [PATCH 10/24] security_util: Don't error on macOS when
|
||||||
|
getting/setting/moving XATTRs There are three internal APIs implemented in
|
||||||
|
this security_util file: virSecurityGetRememberedLabel(),
|
||||||
|
virSecuritySetRememberedLabel() and virSecurityMoveRememberedLabel() for
|
||||||
|
getting, setting and moving remembered seclabel. All three have a special
|
||||||
|
return value of -2 when XATTRs are not supported (for whatever reason) and
|
||||||
|
callers are expected to handle it gracefully. However, after my commit of
|
||||||
|
v5.7.0-rc1~115 it may happen that one of the three functions returned -1 even
|
||||||
|
though XATTRs are not supported (and thus -2 should have been returned).
|
||||||
|
|
||||||
|
Fixes: 7cfb7aab573a031880a1f4fd20747843fea109ba
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
|
||||||
|
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
|
||||||
|
|
||||||
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
(cherry-pick from d337543f06e43006869310adc3c0e60d76516ca9)
|
||||||
|
---
|
||||||
|
src/security/security_util.c | 15 ++++++++++++---
|
||||||
|
1 file changed, 12 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/security/security_util.c b/src/security/security_util.c
|
||||||
|
index 4f661fd75e..5503f18ffb 100644
|
||||||
|
--- a/src/security/security_util.c
|
||||||
|
+++ b/src/security/security_util.c
|
||||||
|
@@ -272,8 +272,11 @@ virSecurityGetRememberedLabel(const char *name,
|
||||||
|
|
||||||
|
*label = NULL;
|
||||||
|
|
||||||
|
- if (!(ref_name = virSecurityGetRefCountAttrName(name)))
|
||||||
|
+ if (!(ref_name = virSecurityGetRefCountAttrName(name))) {
|
||||||
|
+ if (errno == ENOSYS)
|
||||||
|
+ return -2;
|
||||||
|
return -1;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (virFileGetXAttrQuiet(path, ref_name, &value) < 0) {
|
||||||
|
if (errno == ENOSYS || errno == ENODATA || errno == ENOTSUP)
|
||||||
|
@@ -367,8 +370,11 @@ virSecuritySetRememberedLabel(const char *name,
|
||||||
|
g_autofree char *value = NULL;
|
||||||
|
unsigned int refcount = 0;
|
||||||
|
|
||||||
|
- if (!(ref_name = virSecurityGetRefCountAttrName(name)))
|
||||||
|
+ if (!(ref_name = virSecurityGetRefCountAttrName(name))) {
|
||||||
|
+ if (errno == ENOSYS)
|
||||||
|
+ return -2;
|
||||||
|
return -1;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (virFileGetXAttrQuiet(path, ref_name, &value) < 0) {
|
||||||
|
if (errno == ENOSYS || errno == ENOTSUP) {
|
||||||
|
@@ -455,8 +461,11 @@ virSecurityMoveRememberedLabel(const char *name,
|
||||||
|
|
||||||
|
if (!(ref_name = virSecurityGetRefCountAttrName(name)) ||
|
||||||
|
!(attr_name = virSecurityGetAttrName(name)) ||
|
||||||
|
- !(timestamp_name = virSecurityGetTimestampAttrName(name)))
|
||||||
|
+ !(timestamp_name = virSecurityGetTimestampAttrName(name))) {
|
||||||
|
+ if (errno == ENOSYS)
|
||||||
|
+ return -2;
|
||||||
|
return -1;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (virFileGetXAttrQuiet(src, ref_name, &ref_value) < 0) {
|
||||||
|
if (errno == ENOSYS || errno == ENOTSUP) {
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
38
storagepoolxml2argvtest-Reorder-gluster-arguments.patch
Normal file
38
storagepoolxml2argvtest-Reorder-gluster-arguments.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
From 46d828475950bc3efbfe15a0e60571b7b40e1a62 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Tue, 29 Nov 2022 09:58:35 +0000
|
||||||
|
Subject: [PATCH 07/24] storagepoolxml2argvtest: Reorder gluster arguments
|
||||||
|
Commit f00cde7f1133 changed order of mount arguments in
|
||||||
|
virStorageBackendFileSystemMountGlusterArgs() and introduced per-OS mount
|
||||||
|
options and new test data. Old test data was left unmodified with prior order
|
||||||
|
of arguments. That causes a test failure on all OSes but Linux and FreeBSD,
|
||||||
|
i.e. on macOS:
|
||||||
|
|
||||||
|
15) Storage Pool XML-2-argv pool-netfs-gluster
|
||||||
|
...
|
||||||
|
In
|
||||||
|
'/Users/roolebo/dev/libvirt/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv':
|
||||||
|
Offset 39
|
||||||
|
Expect [-o direct-io-mode=1 /mnt/gluster]
|
||||||
|
Actual [/mnt/gluster -o direct-io-mode=1]
|
||||||
|
|
||||||
|
Fixes: f00cde7f1133 ("storage: Add default mount options for fs/netfs storage pools")
|
||||||
|
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
|
||||||
|
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
|
||||||
|
|
||||||
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
(cherry-pick from 040de3fe4643a2e859f22e31415e479e99e52347)
|
||||||
|
---
|
||||||
|
tests/storagepoolxml2argvdata/pool-netfs-gluster.argv | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv b/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv
|
||||||
|
index 4303d514ef..97be9cbeb3 100644
|
||||||
|
--- a/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv
|
||||||
|
+++ b/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv
|
||||||
|
@@ -1 +1 @@
|
||||||
|
-mount -t glusterfs example.com:/volume -o direct-io-mode=1 /mnt/gluster
|
||||||
|
+mount -t glusterfs example.com:/volume /mnt/gluster -o direct-io-mode=1
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
37
tests-Fix-false-positive-in-testConfRoundTrip.patch
Normal file
37
tests-Fix-false-positive-in-testConfRoundTrip.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
From 5b813b4629554c6c7d85e14fe1b5927ebc99ffb3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Tue, 29 Nov 2022 08:50:42 +0000
|
||||||
|
Subject: [PATCH 03/24] tests: Fix false positive in testConfRoundTrip
|
||||||
|
testConfRoundTrip would return 0 (success) if virConfWriteMem succeeded and
|
||||||
|
virTestCompareToFile failed.
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
|
||||||
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
|
||||||
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
(cherry-pick from 4b53ce9fa7a387b7df6821aeade5a95bf0141ba5)
|
||||||
|
---
|
||||||
|
tests/virconftest.c | 3 +--
|
||||||
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/virconftest.c b/tests/virconftest.c
|
||||||
|
index 83077342a9..d8f0cb137a 100644
|
||||||
|
--- a/tests/virconftest.c
|
||||||
|
+++ b/tests/virconftest.c
|
||||||
|
@@ -51,8 +51,7 @@ static int testConfRoundTrip(const void *opaque)
|
||||||
|
fprintf(stderr, "Failed to process %s\n", srcfile);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
- ret = virConfWriteMem(buffer, &len, conf);
|
||||||
|
- if (ret < 0) {
|
||||||
|
+ if (virConfWriteMem(buffer, &len, conf) < 0) {
|
||||||
|
fprintf(stderr, "Failed to serialize %s back\n", srcfile);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
32
tests-Fix-lstat-mock-initialization-on-macOS.patch
Normal file
32
tests-Fix-lstat-mock-initialization-on-macOS.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From 94ce004ea840aed0c8159502a6a7bd2b0dd3f4a7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Tue, 29 Nov 2022 09:42:43 +0000
|
||||||
|
Subject: [PATCH 06/24] tests: Fix lstat() mock initialization on macOS There
|
||||||
|
is a typo that prevents initialization of real_lstat.
|
||||||
|
|
||||||
|
Fixes: d6b17edd5163 ("tests: Lookup extended stat/lstat in mocks")
|
||||||
|
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
|
||||||
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
(cherry-pick from 2c0b3db3c7901f99eed8d95a652b176c9b04b45d)
|
||||||
|
---
|
||||||
|
tests/virmockstathelpers.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tests/virmockstathelpers.c b/tests/virmockstathelpers.c
|
||||||
|
index 5118ffc731..9cd6f5edb8 100644
|
||||||
|
--- a/tests/virmockstathelpers.c
|
||||||
|
+++ b/tests/virmockstathelpers.c
|
||||||
|
@@ -169,7 +169,7 @@ static void virMockStatInit(void)
|
||||||
|
#endif
|
||||||
|
#ifdef MOCK_LSTAT
|
||||||
|
# ifdef __APPLE__
|
||||||
|
- VIR_MOCK_REAL_INIT_ALIASED(stat, "lstat$INODE64");
|
||||||
|
+ VIR_MOCK_REAL_INIT_ALIASED(lstat, "lstat$INODE64");
|
||||||
|
# else
|
||||||
|
VIR_MOCK_REAL_INIT(lstat);
|
||||||
|
# endif
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
31
tests-Fix-vhostuser-args-file.patch
Normal file
31
tests-Fix-vhostuser-args-file.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
From e1626a91423572d025f5647174798f257e9f9ce1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
|
||||||
|
<huangy81@chinatelecom.cn>
|
||||||
|
Date: Tue, 6 Dec 2022 06:05:38 -0500
|
||||||
|
Subject: [PATCH] tests: Fix vhostuser args file
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
|
||||||
|
---
|
||||||
|
tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args b/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args
|
||||||
|
index 0a2b579e21..a143b7cdc6 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args
|
||||||
|
@@ -12,7 +12,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
-S \
|
||||||
|
-object secret,id=masterKey0,format=raw,\
|
||||||
|
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
|
||||||
|
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-machine pc,usb=off,dump-guest-core=off \
|
||||||
|
+-accel tcg \
|
||||||
|
-cpu qemu64 \
|
||||||
|
-m 214 \
|
||||||
|
-overcommit mem-lock=off \
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
314
tests-qemuxml2argvdata-qtests-switch-to-accel.patch
Normal file
314
tests-qemuxml2argvdata-qtests-switch-to-accel.patch
Normal file
@ -0,0 +1,314 @@
|
|||||||
|
From bc412bc2ab8afacaab05e1e393b7a92c773a9f64 Mon Sep 17 00:00:00 2001
|
||||||
|
From: chenhuiying <chenhuiying4@huawei.com>
|
||||||
|
Date: Tue, 6 Dec 2022 18:47:30 +0800
|
||||||
|
Subject: [PATCH] tests: qemuxml2argvdata qtests switch to -accel
|
||||||
|
|
||||||
|
fix "qemu: Switch to -accel"
|
||||||
|
|
||||||
|
Signed-off-by: yezengruan <yezengruan@huawei.com>
|
||||||
|
---
|
||||||
|
tests/qemuxml2argvdata/aarch64-gic-default-both.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/aarch64-gic-default-v2.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/aarch64-gic-default-v3.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/aarch64-gic-default.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/aarch64-gic-none-both.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/aarch64-gic-none-v2.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/aarch64-gic-none-v3.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/aarch64-gic-none.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/cpu-check-full.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/cpu-check-partial.args | 3 ++-
|
||||||
|
.../disk-backing-chains-index.x86_64-2.12.0.args | 3 ++-
|
||||||
|
.../disk-backing-chains-index.x86_64-latest.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/mach-virt-console-native.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/mach-virt-serial+console-native.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/mach-virt-serial-compat.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/pci-rom-disabled-invalid.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/pseries-console-native.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/pseries-serial+console-native.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/pseries-serial-compat.args | 3 ++-
|
||||||
|
tests/qemuxml2argvdata/user-aliases2.args | 3 ++-
|
||||||
|
20 files changed, 40 insertions(+), 20 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/qemuxml2argvdata/aarch64-gic-default-both.args b/tests/qemuxml2argvdata/aarch64-gic-default-both.args
|
||||||
|
index 2049250..9d28764 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/aarch64-gic-default-both.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/aarch64-gic-default-both.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-aarch64 \
|
||||||
|
-name aarch64test \
|
||||||
|
-S \
|
||||||
|
--machine virt,accel=kvm,usb=off,dump-guest-core=off,gic-version=3 \
|
||||||
|
+-machine virt,usb=off,dump-guest-core=off,gic-version=3 \
|
||||||
|
+-accel kvm \
|
||||||
|
-cpu host \
|
||||||
|
-m 1024 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/aarch64-gic-default-v2.args b/tests/qemuxml2argvdata/aarch64-gic-default-v2.args
|
||||||
|
index 6cf5839..9d6f2de 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/aarch64-gic-default-v2.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/aarch64-gic-default-v2.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-aarch64 \
|
||||||
|
-name aarch64test \
|
||||||
|
-S \
|
||||||
|
--machine virt,accel=kvm,usb=off,dump-guest-core=off,gic-version=2 \
|
||||||
|
+-machine virt,usb=off,dump-guest-core=off,gic-version=2 \
|
||||||
|
+-accel kvm \
|
||||||
|
-cpu host \
|
||||||
|
-m 1024 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/aarch64-gic-default-v3.args b/tests/qemuxml2argvdata/aarch64-gic-default-v3.args
|
||||||
|
index 2049250..9d28764 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/aarch64-gic-default-v3.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/aarch64-gic-default-v3.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-aarch64 \
|
||||||
|
-name aarch64test \
|
||||||
|
-S \
|
||||||
|
--machine virt,accel=kvm,usb=off,dump-guest-core=off,gic-version=3 \
|
||||||
|
+-machine virt,usb=off,dump-guest-core=off,gic-version=3 \
|
||||||
|
+-accel kvm \
|
||||||
|
-cpu host \
|
||||||
|
-m 1024 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/aarch64-gic-default.args b/tests/qemuxml2argvdata/aarch64-gic-default.args
|
||||||
|
index 6cf5839..9d6f2de 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/aarch64-gic-default.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/aarch64-gic-default.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-aarch64 \
|
||||||
|
-name aarch64test \
|
||||||
|
-S \
|
||||||
|
--machine virt,accel=kvm,usb=off,dump-guest-core=off,gic-version=2 \
|
||||||
|
+-machine virt,usb=off,dump-guest-core=off,gic-version=2 \
|
||||||
|
+-accel kvm \
|
||||||
|
-cpu host \
|
||||||
|
-m 1024 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/aarch64-gic-none-both.args b/tests/qemuxml2argvdata/aarch64-gic-none-both.args
|
||||||
|
index 2049250..9d28764 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/aarch64-gic-none-both.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/aarch64-gic-none-both.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-aarch64 \
|
||||||
|
-name aarch64test \
|
||||||
|
-S \
|
||||||
|
--machine virt,accel=kvm,usb=off,dump-guest-core=off,gic-version=3 \
|
||||||
|
+-machine virt,usb=off,dump-guest-core=off,gic-version=3 \
|
||||||
|
+-accel kvm \
|
||||||
|
-cpu host \
|
||||||
|
-m 1024 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/aarch64-gic-none-v2.args b/tests/qemuxml2argvdata/aarch64-gic-none-v2.args
|
||||||
|
index 6cf5839..9d6f2de 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/aarch64-gic-none-v2.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/aarch64-gic-none-v2.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-aarch64 \
|
||||||
|
-name aarch64test \
|
||||||
|
-S \
|
||||||
|
--machine virt,accel=kvm,usb=off,dump-guest-core=off,gic-version=2 \
|
||||||
|
+-machine virt,usb=off,dump-guest-core=off,gic-version=2 \
|
||||||
|
+-accel kvm \
|
||||||
|
-cpu host \
|
||||||
|
-m 1024 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/aarch64-gic-none-v3.args b/tests/qemuxml2argvdata/aarch64-gic-none-v3.args
|
||||||
|
index 2049250..9d28764 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/aarch64-gic-none-v3.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/aarch64-gic-none-v3.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-aarch64 \
|
||||||
|
-name aarch64test \
|
||||||
|
-S \
|
||||||
|
--machine virt,accel=kvm,usb=off,dump-guest-core=off,gic-version=3 \
|
||||||
|
+-machine virt,usb=off,dump-guest-core=off,gic-version=3 \
|
||||||
|
+-accel kvm \
|
||||||
|
-cpu host \
|
||||||
|
-m 1024 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/aarch64-gic-none.args b/tests/qemuxml2argvdata/aarch64-gic-none.args
|
||||||
|
index 6cf5839..9d6f2de 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/aarch64-gic-none.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/aarch64-gic-none.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-aarch64 \
|
||||||
|
-name aarch64test \
|
||||||
|
-S \
|
||||||
|
--machine virt,accel=kvm,usb=off,dump-guest-core=off,gic-version=2 \
|
||||||
|
+-machine virt,usb=off,dump-guest-core=off,gic-version=2 \
|
||||||
|
+-accel kvm \
|
||||||
|
-cpu host \
|
||||||
|
-m 1024 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/cpu-check-full.args b/tests/qemuxml2argvdata/cpu-check-full.args
|
||||||
|
index 1e4af63..71891fd 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/cpu-check-full.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/cpu-check-full.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-x86_64 \
|
||||||
|
-name QEMUGuest1 \
|
||||||
|
-S \
|
||||||
|
--machine pc,accel=kvm,usb=off,dump-guest-core=off \
|
||||||
|
+-machine pc,usb=off,dump-guest-core=off \
|
||||||
|
+-accel kvm \
|
||||||
|
-cpu core2duo \
|
||||||
|
-m 214 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/cpu-check-partial.args b/tests/qemuxml2argvdata/cpu-check-partial.args
|
||||||
|
index 1e4af63..71891fd 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/cpu-check-partial.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/cpu-check-partial.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-x86_64 \
|
||||||
|
-name QEMUGuest1 \
|
||||||
|
-S \
|
||||||
|
--machine pc,accel=kvm,usb=off,dump-guest-core=off \
|
||||||
|
+-machine pc,usb=off,dump-guest-core=off \
|
||||||
|
+-accel kvm \
|
||||||
|
-cpu core2duo \
|
||||||
|
-m 214 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-2.12.0.args b/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-2.12.0.args
|
||||||
|
index 4769133..bd87945 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-2.12.0.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-2.12.0.args
|
||||||
|
@@ -12,7 +12,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
-S \
|
||||||
|
-object secret,id=masterKey0,format=raw,\
|
||||||
|
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
|
||||||
|
--machine pc-i440fx-2.12,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-machine pc-i440fx-2.12,usb=off,dump-guest-core=off \
|
||||||
|
+-accel tcg \
|
||||||
|
-m 214 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
-smp 1,sockets=1,cores=1,threads=1 \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-latest.args b/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-latest.args
|
||||||
|
index 6c19da9..9148864 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-latest.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-latest.args
|
||||||
|
@@ -12,7 +12,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
-S \
|
||||||
|
-object secret,id=masterKey0,format=raw,\
|
||||||
|
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
|
||||||
|
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-machine pc,usb=off,dump-guest-core=off \
|
||||||
|
+-accel tcg \
|
||||||
|
-cpu qemu64 \
|
||||||
|
-m 214 \
|
||||||
|
-overcommit mem-lock=off \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/mach-virt-console-native.args b/tests/qemuxml2argvdata/mach-virt-console-native.args
|
||||||
|
index 8d25e49..cd27ffe 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/mach-virt-console-native.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/mach-virt-console-native.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-aarch64 \
|
||||||
|
-name guest \
|
||||||
|
-S \
|
||||||
|
--machine virt,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-machine virt,usb=off,dump-guest-core=off \
|
||||||
|
+-accel tcg \
|
||||||
|
-m 512 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
-smp 1,sockets=1,cores=1,threads=1 \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/mach-virt-serial+console-native.args b/tests/qemuxml2argvdata/mach-virt-serial+console-native.args
|
||||||
|
index 8d25e49..cd27ffe 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/mach-virt-serial+console-native.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/mach-virt-serial+console-native.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-aarch64 \
|
||||||
|
-name guest \
|
||||||
|
-S \
|
||||||
|
--machine virt,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-machine virt,usb=off,dump-guest-core=off \
|
||||||
|
+-accel tcg \
|
||||||
|
-m 512 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
-smp 1,sockets=1,cores=1,threads=1 \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/mach-virt-serial-compat.args b/tests/qemuxml2argvdata/mach-virt-serial-compat.args
|
||||||
|
index 8d25e49..cd27ffe 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/mach-virt-serial-compat.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/mach-virt-serial-compat.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-aarch64 \
|
||||||
|
-name guest \
|
||||||
|
-S \
|
||||||
|
--machine virt,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-machine virt,usb=off,dump-guest-core=off \
|
||||||
|
+-accel tcg \
|
||||||
|
-m 512 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
-smp 1,sockets=1,cores=1,threads=1 \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/pci-rom-disabled-invalid.args b/tests/qemuxml2argvdata/pci-rom-disabled-invalid.args
|
||||||
|
index 1dd1695..b812421 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/pci-rom-disabled-invalid.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/pci-rom-disabled-invalid.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-x86_64 \
|
||||||
|
-name guest \
|
||||||
|
-S \
|
||||||
|
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-machine pc,usb=off,dump-guest-core=off \
|
||||||
|
+-accel tcg \
|
||||||
|
-m 214 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
-smp 1,sockets=1,cores=1,threads=1 \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/pseries-console-native.args b/tests/qemuxml2argvdata/pseries-console-native.args
|
||||||
|
index 9a5f8c8..c8295f7 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/pseries-console-native.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/pseries-console-native.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-ppc64 \
|
||||||
|
-name guest \
|
||||||
|
-S \
|
||||||
|
--machine pseries,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-machine pseries,usb=off,dump-guest-core=off \
|
||||||
|
+-accel tcg \
|
||||||
|
-m 512 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
-smp 1,sockets=1,cores=1,threads=1 \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/pseries-serial+console-native.args b/tests/qemuxml2argvdata/pseries-serial+console-native.args
|
||||||
|
index 9a5f8c8..c8295f7 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/pseries-serial+console-native.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/pseries-serial+console-native.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-ppc64 \
|
||||||
|
-name guest \
|
||||||
|
-S \
|
||||||
|
--machine pseries,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-machine pseries,usb=off,dump-guest-core=off \
|
||||||
|
+-accel tcg \
|
||||||
|
-m 512 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
-smp 1,sockets=1,cores=1,threads=1 \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/pseries-serial-compat.args b/tests/qemuxml2argvdata/pseries-serial-compat.args
|
||||||
|
index 9a5f8c8..c8295f7 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/pseries-serial-compat.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/pseries-serial-compat.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-ppc64 \
|
||||||
|
-name guest \
|
||||||
|
-S \
|
||||||
|
--machine pseries,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-machine pseries,usb=off,dump-guest-core=off \
|
||||||
|
+-accel tcg \
|
||||||
|
-m 512 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
-smp 1,sockets=1,cores=1,threads=1 \
|
||||||
|
diff --git a/tests/qemuxml2argvdata/user-aliases2.args b/tests/qemuxml2argvdata/user-aliases2.args
|
||||||
|
index cfc396c..aecaa24 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/user-aliases2.args
|
||||||
|
+++ b/tests/qemuxml2argvdata/user-aliases2.args
|
||||||
|
@@ -10,7 +10,8 @@ QEMU_AUDIO_DRV=none \
|
||||||
|
/usr/bin/qemu-system-x86_64 \
|
||||||
|
-name QEMUGuest1 \
|
||||||
|
-S \
|
||||||
|
--machine pc-q35-2.4,accel=tcg,usb=off,dump-guest-core=off \
|
||||||
|
+-machine pc-q35-2.4,usb=off,dump-guest-core=off \
|
||||||
|
+-accel tcg \
|
||||||
|
-m 214 \
|
||||||
|
-realtime mlock=off \
|
||||||
|
-smp 1,sockets=1,cores=1,threads=1 \
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
47
vbox_network-fix-possible-memory-leak-in-vboxNetwork.patch
Normal file
47
vbox_network-fix-possible-memory-leak-in-vboxNetwork.patch
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
From ecac0391e48796b570d540212629205889cab421 Mon Sep 17 00:00:00 2001
|
||||||
|
From: wangmeiyang <wangmeiyang_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Thu, 1 Dec 2022 09:21:05 +0800
|
||||||
|
Subject: [PATCH 22/24] vbox_network: fix possible memory leak in
|
||||||
|
vboxNetworkDefineCreateXML()
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
virNetworkDef was not freed if the function failed in the first
|
||||||
|
two ifs, causing a possible memory leak.
|
||||||
|
|
||||||
|
cherry-pick from ef83940524c1138dde616004be6cad5095b94001
|
||||||
|
|
||||||
|
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
|
||||||
|
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
Signed-off-by: Meiyang Wang <wangmeiyang_yewu@cmss.chinamobile.com>
|
||||||
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
---
|
||||||
|
src/vbox/vbox_network.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/vbox/vbox_network.c b/src/vbox/vbox_network.c
|
||||||
|
index 19b4d23ed8..dbee9a6f55 100644
|
||||||
|
--- a/src/vbox/vbox_network.c
|
||||||
|
+++ b/src/vbox/vbox_network.c
|
||||||
|
@@ -375,7 +375,7 @@ vboxNetworkDefineCreateXML(virConnectPtr conn, const char *xml, bool start)
|
||||||
|
PRUnichar *networkNameUtf16 = NULL;
|
||||||
|
char *networkNameUtf8 = NULL;
|
||||||
|
IHostNetworkInterface *networkInterface = NULL;
|
||||||
|
- virNetworkDefPtr def = virNetworkDefParseString(xml, NULL);
|
||||||
|
+ virNetworkDef *def = NULL;
|
||||||
|
virNetworkIPDefPtr ipdef = NULL;
|
||||||
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
|
vboxIID vboxnetiid;
|
||||||
|
@@ -393,7 +393,7 @@ vboxNetworkDefineCreateXML(virConnectPtr conn, const char *xml, bool start)
|
||||||
|
|
||||||
|
VBOX_IID_INITIALIZE(&vboxnetiid);
|
||||||
|
|
||||||
|
- if ((!def) ||
|
||||||
|
+ if (!(def = virNetworkDefParseString(xml, NULL)) ||
|
||||||
|
(def->forward.type != VIR_NETWORK_FORWARD_NONE) ||
|
||||||
|
(def->nips == 0 || !def->ips))
|
||||||
|
goto cleanup;
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
33
virCgroupKillRecursive-Return-1-on-failure-condition.patch
Normal file
33
virCgroupKillRecursive-Return-1-on-failure-condition.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
From 420abccb9e834938a5f03726559f044fb0aa426b Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Tue, 29 Nov 2022 09:36:57 +0000
|
||||||
|
Subject: [PATCH 05/24] virCgroupKillRecursive: Return -1 on failure condition
|
||||||
|
virCgroupKillRecursive sneakily initializes 'ret' to 0 rather than the usual
|
||||||
|
-1. 401030499bf moved an error condition but didn't actually modify 'ret'
|
||||||
|
return the proper error code.
|
||||||
|
|
||||||
|
Fixes: 401030499bf
|
||||||
|
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||||
|
|
||||||
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
(cherry-pick from 0778cff2aedd1da142562c396d482335df18e620)
|
||||||
|
---
|
||||||
|
src/util/vircgroup.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
|
||||||
|
index 70d85200cb..f52a8cc843 100644
|
||||||
|
--- a/src/util/vircgroup.c
|
||||||
|
+++ b/src/util/vircgroup.c
|
||||||
|
@@ -2613,6 +2613,7 @@ virCgroupKillRecursive(virCgroupPtr group, int signum)
|
||||||
|
if (!backends || !backendAvailable) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("no cgroup backend available"));
|
||||||
|
+ ret = -1;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
52
virsh-cmdScreenshot-fix-cbdata-passing-to-virshStrea.patch
Normal file
52
virsh-cmdScreenshot-fix-cbdata-passing-to-virshStrea.patch
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
From 9fb4749f7ee4bbc75e0ad571a87abd76a0ae1b81 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Tue, 29 Nov 2022 08:15:11 +0000
|
||||||
|
Subject: [PATCH 01/24] virsh: cmdScreenshot: fix cbdata passing to
|
||||||
|
virshStreamSink The changes for sparse stream support started passing
|
||||||
|
virshStreamCallbackDataPtr to virshStreamSink instead of passing a simple
|
||||||
|
file descriptor, but forgot to adjust all the callers.
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Fix it in cmdScreenshot as well.
|
||||||
|
|
||||||
|
https://bugzilla.redhat.com/show_bug.cgi?id=1875195
|
||||||
|
|
||||||
|
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
Fixes: 9e745a97171e10f050962c166082439d6724e245
|
||||||
|
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||||
|
|
||||||
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
(cherry-pick from 3144e881b137123b0326157ce6dc23ca649c9270)
|
||||||
|
---
|
||||||
|
tools/virsh-domain.c | 6 +++++-
|
||||||
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
|
||||||
|
index 7033232015..c043ad3ce5 100644
|
||||||
|
--- a/tools/virsh-domain.c
|
||||||
|
+++ b/tools/virsh-domain.c
|
||||||
|
@@ -5632,6 +5632,7 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd)
|
||||||
|
bool generated = false;
|
||||||
|
char *mime = NULL;
|
||||||
|
virshControlPtr priv = ctl->privData;
|
||||||
|
+ virshStreamCallbackData cbdata;
|
||||||
|
|
||||||
|
if (vshCommandOptStringReq(ctl, cmd, "file", (const char **) &file) < 0)
|
||||||
|
return false;
|
||||||
|
@@ -5667,7 +5668,10 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd)
|
||||||
|
created = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (virStreamRecvAll(st, virshStreamSink, &fd) < 0) {
|
||||||
|
+ cbdata.ctl = ctl;
|
||||||
|
+ cbdata.fd = fd;
|
||||||
|
+
|
||||||
|
+ if (virStreamRecvAll(st, virshStreamSink, &cbdata) < 0) {
|
||||||
|
vshError(ctl, _("could not receive data from domain %s"), name);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
38
virsh-domain-fix-mistake-in-cmdMigrateSetMaxDowntime.patch
Normal file
38
virsh-domain-fix-mistake-in-cmdMigrateSetMaxDowntime.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
From 59d5adb4620c57743d88dda8e1ac2d20ce7bd9d3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: wangmeiyang <wangmeiyang_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 20:17:09 +0800
|
||||||
|
Subject: [PATCH 21/24] virsh: domain: fix mistake in
|
||||||
|
cmdMigrateSetMaxDowntime()
|
||||||
|
|
||||||
|
If there was added a new return value indicating success to the
|
||||||
|
function virDomainMigrateSetMaxDowntime() in the future, because
|
||||||
|
of the way the function is called it would be treated it as an
|
||||||
|
error state and would return false (indicating failure). This
|
||||||
|
patch fixes it, so that the call of the function follows the same
|
||||||
|
pattern as is currently set in libvirt.
|
||||||
|
|
||||||
|
cherry-pick from 0987edbedf96fc920a73213fdad1ad9a119cbee7
|
||||||
|
|
||||||
|
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
|
||||||
|
Signed-off-by: Meiyang Wang <wangmeiyang_yewu@cmss.chinamobile.com>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
tools/virsh-domain.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
|
||||||
|
index c043ad3ce5..6dd56168e3 100644
|
||||||
|
--- a/tools/virsh-domain.c
|
||||||
|
+++ b/tools/virsh-domain.c
|
||||||
|
@@ -11221,7 +11221,7 @@ cmdMigrateSetMaxDowntime(vshControl *ctl, const vshCmd *cmd)
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (virDomainMigrateSetMaxDowntime(dom, downtime, 0))
|
||||||
|
+ if (virDomainMigrateSetMaxDowntime(dom, downtime, 0) < 0)
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
ret = true;
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
54
vsh-Fix-completion-error-in-case-of-multiple-mac-add.patch
Normal file
54
vsh-Fix-completion-error-in-case-of-multiple-mac-add.patch
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
From 35d3169072522ad6a2bd6f046fde7881c2837c74 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
Date: Wed, 30 Nov 2022 08:25:26 +0000
|
||||||
|
Subject: [PATCH 11/24] vsh: Fix completion error in case of multiple mac
|
||||||
|
addresses We know that the bash completer automatically handle colon by
|
||||||
|
preceding it with an escape character backslash. While our bash autompletion
|
||||||
|
file vsh completes multiple items, In case there're multiple items which have
|
||||||
|
same prefix and the content of completion items contain colon(say mac
|
||||||
|
address), The vsh needs to correctly hands the backslash which are added by
|
||||||
|
bash completer, Otherwise the completion won't be successful. This patch
|
||||||
|
fixes this problem.
|
||||||
|
|
||||||
|
e.g.:
|
||||||
|
|
||||||
|
# virsh domiflist --domain VM
|
||||||
|
Interface Type Source Model MAC
|
||||||
|
-------------------------------------------------------------
|
||||||
|
vnet0 network default virtio 52:54:00:fb:7b:f5
|
||||||
|
vnet1 bridge br0 virtio 52:54:00:80:1b:21
|
||||||
|
|
||||||
|
Before:
|
||||||
|
# virsh detach-interface --domain VM --mac <TAB>
|
||||||
|
# virsh detach-interface --domain VM --mac 52\:54\:00\:<TAB><TAB>
|
||||||
|
|
||||||
|
After:
|
||||||
|
# virsh detach-interface --domain VM --mac <TAB>
|
||||||
|
# virsh detach-interface --domain VM --mac 52\:54\:00\:<TAB><TAB>
|
||||||
|
52:54:00:80:1b:21 52:54:00:fb:7b:f5
|
||||||
|
# virsh detach-interface --domain VM --mac 52\:54\:00\:
|
||||||
|
|
||||||
|
Signed-off-by: Lin Ma <lma@suse.com>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
|
||||||
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
||||||
|
(cherry-pick from 8a4343a4366580644bde3ba9b6a21bf740503416)
|
||||||
|
---
|
||||||
|
tools/bash-completion/vsh | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/tools/bash-completion/vsh b/tools/bash-completion/vsh
|
||||||
|
index 363097c601..ca9d37a7ff 100644
|
||||||
|
--- a/tools/bash-completion/vsh
|
||||||
|
+++ b/tools/bash-completion/vsh
|
||||||
|
@@ -39,6 +39,7 @@ _vsh_complete()
|
||||||
|
fi
|
||||||
|
|
||||||
|
INPUT=( "${COMP_WORDS[@]:$i:$COMP_CWORD}" )
|
||||||
|
+ INPUT[-1]=${INPUT[-1]//\\:/:}
|
||||||
|
|
||||||
|
# Uncomment these lines for easy debug.
|
||||||
|
# echo;
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user