[PATCH] docs: Fix typos

2023-10-08 Thread Han Han
Signed-off-by: Han Han 
---
 docs/formatdomain.rst   | 2 +-
 docs/kbase/kvm-realtime.rst | 2 +-
 docs/manpages/virsh.rst | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index af62fcd820..03735e4593 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -2179,7 +2179,7 @@ are:
Enable QEMU vmcoreinfo device to let the guest kernel save debug details.
:since:`Since 4.4.0` (QEMU only)
 ``htm``
-   Configure HTM (Hardware Transational Memory) availability for pSeries 
guests.
+   Configure HTM (Hardware Transactional Memory) availability for pSeries 
guests.
Possible values for the ``state`` attribute are ``on`` and ``off``. If the
attribute is not defined, the hypervisor default will be used. :since:`Since
4.6.0` (QEMU/KVM only)
diff --git a/docs/kbase/kvm-realtime.rst b/docs/kbase/kvm-realtime.rst
index 87ab314bcb..c829eac120 100644
--- a/docs/kbase/kvm-realtime.rst
+++ b/docs/kbase/kvm-realtime.rst
@@ -103,7 +103,7 @@ Be aware that CPU ID numbers are not always allocated 
sequentially as shown
 here. It is not unusual to see IDs interleaved between sockets on the two NUMA
 nodes, such that ``0-3,8-11`` are on the first node and ``4-7,12-15`` are on
 the second node.  Carefully check the ``virsh capabilities`` output to 
determine
-the CPU ID numbers when configiring both ``isolcpus`` and the guest ``cpuset``
+the CPU ID numbers when configuring both ``isolcpus`` and the guest ``cpuset``
 values.
 
 Guest configuration
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 4ae3bb4d93..c425974912 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -5267,7 +5267,7 @@ dom-fd-associate
 
 Associate one or more fds described via *--pass-fds* argument to *domain* as
 *--name*. The lifetime of the passed fd group is the same as the connection, 
thus
-exitting virsh un-registers them afterwards.
+exiting virsh un-registers them afterwards.
 
 By default security labels are applied if needed but they are not restored 
after
 use to avoid keeping them open unnecessarily. Best-effort security label 
restore
-- 
2.41.0



Re: [PATCH] qemu: add 'media=cdrom' attribute for usb CDROM

2023-10-07 Thread Han Han
On Sat, Oct 7, 2023 at 4:12 PM Minglei Liu  wrote:

> From: "minglei.liu" 
>
> In commit 1328a83, the 'media=cdrom' attribute was removed from -drive.
> However, this attribute is still essential for usb cdrom and is still
> supported in qemu 8.1.1. Therefore, we need to reintroduce this attribute
> for usb cdrom.
>
>From the results on qemu-kvm-8.1.1-1.fc39.x86_6, the parameter 'media' is
not supported for -blockdev:
qemu-kvm -blockdev
'{"driver":"file","filename":"/tmp/vdb","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","media":"cdrom"}'
qemu-kvm: -blockdev
{"driver":"file","filename":"/tmp/vdb","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","media":"cdrom"}:
Parameter 'media' is unexpected

> ---
>  src/qemu/qemu_command.c| 7 +++
>  .../disk-cdrom-bus-other.x86_64-latest.args| 2 +-
>  2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 8a7b80719f..42f3f8f740 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -1705,6 +1705,13 @@ qemuBuildDriveStr(virDomainDiskDef *disk)
>
>  virBufferAsprintf(, "if=sd,index=%d",
> virDiskNameToIndex(disk->dst));
>
> +/* While this is a frontend attribute, it only makes sense to be used
> when
> + * legacy -drive is used. In modern qemu the 'ide-cd' or 'scsi-cd'
> are used.
> + * currently only usb cdrom need this attribute */
> +if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
> +disk->bus == VIR_DOMAIN_DISK_BUS_USB)
> +virBufferAddLit(, ",media=cdrom");
> +
>  if (disk->src->readonly)
>  virBufferAddLit(, ",readonly=on");
>
> diff --git
> a/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args
> b/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args
> index de5fa083d8..38093423cf 100644
> --- a/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args
> +++ b/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args
> @@ -27,7 +27,7 @@
> XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
>  -no-shutdown \
>  -boot strict=on \
>  -device
> '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
> --blockdev
> '{"driver":"file","filename":"/root/boot.iso","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}'
> \
> +-blockdev
> '{"driver":"file","filename":"/root/boot.iso","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","media":"cdrom"}'
> \
>  -blockdev
> '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw","file":"libvirt-2-storage"}'
> \
>  -device
> '{"driver":"usb-storage","bus":"usb.0","port":"1","drive":"libvirt-2-format","id":"usb-disk0","removable":false}'
> \
>  -device
> '{"driver":"usb-storage","bus":"usb.0","port":"2","id":"usb-disk1","removable":false}'
> \
> --
> 2.41.0
>
>


[PATCH 3/3] qemu/qemu_validate: Add capability check for the model igb

2023-07-28 Thread Han Han
Signed-off-by: Han Han 
---
 src/qemu/qemu_validate.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index d5c2b2cd44..a5eb96c9b5 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1858,6 +1858,13 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef 
*net,
 }
 }
 
+if (net->model == VIR_DOMAIN_NET_MODEL_IGB &&
+!virQEMUCapsGet(qemuCaps, QEMU_CAPS_IGB)) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+   _("interface model igb is not supported with this QEMU 
binary"));
+return -1;
+}
+
 if (net->mtu &&
 !qemuDomainNetSupportsMTU(net->type, net->backend.type)) {
 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-- 
2.41.0



[PATCH 2/3] qemu: capabilities: Add the capability for the device igb

2023-07-28 Thread Han Han
Signed-off-by: Han Han 
---
 src/qemu/qemu_capabilities.c | 2 ++
 src/qemu/qemu_capabilities.h | 1 +
 tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 1 +
 tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 +
 4 files changed, 5 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index f80bdb579d..eb1dc44142 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -697,6 +697,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
 
   /* 450 */
   "run-with.async-teardown", /* QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN 
*/
+  "igb", /* QEMU_CAPS_IGB */
 );
 
 
@@ -1385,6 +1386,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
 { "virtio-crypto-device", QEMU_CAPS_DEVICE_VIRTIO_CRYPTO },
 { "cryptodev-backend-lkcf", QEMU_CAPS_OBJECT_CRYPTO_LKCF },
 { "pvpanic-pci", QEMU_CAPS_DEVICE_PANIC_PCI },
+{ "igb", QEMU_CAPS_IGB },
 };
 
 
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index c72f73a161..1afd90a610 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -676,6 +676,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for 
syntax-check */
 
 /* 450 */
 QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN, /* asynchronous teardown -run-with 
async-teardown=on|off */
+QEMU_CAPS_IGB, /* -device igb */
 
 QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml 
b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
index c43c209328..72a75d8701 100644
--- a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
@@ -203,6 +203,7 @@
   
   
   
+  
   800
   43100244
   v8.0.0
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml 
b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
index e656a2024a..a1faa6491e 100644
--- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
@@ -204,6 +204,7 @@
   
   
   
+  
   850
   43100245
   v8.0.0-2835-g361d539735
-- 
2.41.0



[PATCH 0/3] Update the capability and doc for device igb

2023-07-28 Thread Han Han
The interface model igb is added since v9.3.0, but the qemu capability
and qemu supported version is missing. So I add them in this series.

Han Han (3):
  docs: formatdomain: Mention the QEMU version for igb
  qemu: capabilities: Add the capability for the device igb
  qemu/qemu_validate: Add capability check for the model igb

 docs/formatdomain.rst| 2 +-
 src/qemu/qemu_capabilities.c | 2 ++
 src/qemu/qemu_capabilities.h | 1 +
 src/qemu/qemu_validate.c | 7 +++
 tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 1 +
 tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 +
 6 files changed, 13 insertions(+), 1 deletion(-)

-- 
2.41.0



[PATCH] docs: formatdomain: Mention the QEMU requirement for discard_no_unref

2023-07-25 Thread Han Han
Signed-off-by: Han Han 
---
 docs/formatdomain.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 973de8dd4f..cd9cb02bf8 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -3296,7 +3296,8 @@ paravirtualized driver is specified via the ``disk`` 
element.
   image. When enabled, a discard request from within the guest will mark 
the
   qcow2 cluster as zero, but will keep the reference/offset of that 
cluster.
   But it will still pass the discard further to the lower layer.
-  This will resolve fragmentation within the qcow2 image. :since:`Since 
9.5.0`
+  This will resolve fragmentation within the qcow2 image. :since:`Since 
9.5.0
+  (QEMU 8.1)`
 
   In the majority of cases the default configuration used by the hypervisor
   is sufficient so modifying this setting should not be necessary. For
-- 
2.41.0



[PATCH v2] NEWS: qemu: Implement QEMU NBD reconnect delay attribute

2023-07-25 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 22fc7e5971..6b202147a6 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -232,6 +232,11 @@ v9.2.0 (2023-04-01)
 corresponding JSON descriptor has the highest priority, or manually by
 using  in the domain XML.
 
+   * qemu: Implement QEMU NBD reconnect delay attribute
+
+Support the nbd reconnect-delay of QEMU. It will set the delay time for
+reconnect after an unexpected disconnect or a serious error.
+
 * **Improvements**
 
   * qemu: Make firmware selection persistent
-- 
2.41.0



Re: [PATCH] docs: Mention vhostuser for queues and queue_size

2023-07-23 Thread Han Han
On Fri, Jul 21, 2023 at 8:18 PM Michal Prívozník 
wrote:

> On 7/20/23 10:53, Han Han wrote:
> >
> >
> > On Thu, Jul 20, 2023 at 2:56 PM Michal Prívozník  > <mailto:mpriv...@redhat.com>> wrote:
> >
> > On 7/20/23 08:22, Han Han wrote:
> > > These two attributes are supported for vhost-user-blk as well.
> > >
> > > Signed-off-by: Han Han mailto:h...@redhat.com>>
> > > ---
> > >  docs/formatdomain.rst | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
> > > index 4af0b82569..447ab32c01 100644
> > > --- a/docs/formatdomain.rst
> > > +++ b/docs/formatdomain.rst
> > > @@ -3275,9 +3275,9 @@ paravirtualized driver is specified via the
> > ``disk`` element.
> > >"virtio" ``bus`` and "pci" or "ccw" ``address`` types.
> > :since:`Since 1.2.8
> > >(QEMU 2.1)`
> > > -  The optional ``queues`` attribute specifies the number of
> > virt queues for
> > > -  virtio-blk. ( :since:`Since 3.9.0` )
> > > +  virtio-blk or vhost-user-blk. ( :since:`Since 3.9.0` )
> >
> > This doesn't feel right. The vhost-user-blk disk was introduced
> fairly
> > recently and 3.9.0 is just ancient. Digging into commits,
> vhost-user-blk
> > disk was introduced in v7.1.0 and I didn't check whether it supported
> > the attribute from the very beginning.
> >
> > Thank you for pointing this out.  It looks libvirt allows the user to
> > set the queues for
> > all the bus=='virtio':
> >
> https://gitlab.com/libvirt/libvirt/-/blob/v7.1.0/src/conf/domain_validate.c#L465
> <
> https://gitlab.com/libvirt/libvirt/-/blob/v7.1.0/src/conf/domain_validate.c#L465
> >
> >
> > So vhost-user-blk could use the queues at the beginning.
>
> Okay, can you post v2 then please? I'll review it.
>
> Yeah. V2 link:
https://listman.redhat.com/archives/libvir-list/2023-July/240841.html

> Michal
>
>


[PATCH 0/2] Improve the validation for queues and queue_size

2023-07-20 Thread Han Han


Han Han (2):
  conf/domain_validate.c: Improve the err for queue validation
  conf/domain_validate: Validate the disk queue_size

 src/conf/domain_validate.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

-- 
2.41.0



[PATCH 1/2] conf/domain_validate.c: Improve the err for queue validation

2023-07-20 Thread Han Han
Queues is supported by virtio bus, including virtio-blk and
vhost-user-blk.

Signed-off-by: Han Han 
---
 src/conf/domain_validate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index 16bf3b559f..e835ad33ad 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -784,7 +784,7 @@ virDomainDiskDefValidate(const virDomainDef *def,
 
 if (disk->queues) {
 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-   _("queues attribute in disk driver element is only 
supported by virtio-blk"));
+   _("queues attribute in disk driver element is only 
supported for virtio bus"));
 return -1;
 }
 
-- 
2.41.0



[PATCH 2/2] conf/domain_validate: Validate the disk queue_size

2023-07-20 Thread Han Han
Signed-off-by: Han Han 
---
 src/conf/domain_validate.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index e835ad33ad..ad383b604e 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -788,6 +788,12 @@ virDomainDiskDefValidate(const virDomainDef *def,
 return -1;
 }
 
+if (disk->queue_size) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+   _("queue_size attribute in disk driver is only 
supported for virtio bus"));
+return -1;
+}
+
 if (disk->event_idx != VIR_TRISTATE_SWITCH_ABSENT) {
 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("disk event_idx mode supported only for virtio 
bus"));
-- 
2.41.0



[PATCH v2] docs: Mention vhostuser for queues and queue_size

2023-07-20 Thread Han Han
These two attributes are supported for vhost-user-blk as well.

Signed-off-by: Han Han 
---
Update the supported version of the queues attribute of vhost-user-blk
v1: https://listman.redhat.com/archives/libvir-list/2023-July/240836.html

 docs/formatdomain.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 4af0b82569..973de8dd4f 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -3275,9 +3275,10 @@ paravirtualized driver is specified via the ``disk`` 
element.
   "virtio" ``bus`` and "pci" or "ccw" ``address`` types. :since:`Since 
1.2.8
   (QEMU 2.1)`
-  The optional ``queues`` attribute specifies the number of virt queues for
-  virtio-blk. ( :since:`Since 3.9.0` )
+  virtio-blk ( :since:`Since 3.9.0` ) or vhost-user-blk
+  ( :since `Since 7.1.0` )
-  The optional ``queue_size`` attribute specifies the size of each virt
-  queue for virtio-blk. ( :since:`Since 7.8.0` )
+  queue for virtio-blk or vhost-user-blk. ( :since:`Since 7.8.0` )
-  For virtio disks, `Virtio-related options`_ can also
   be set. ( :since:`Since 3.5.0` )
-  The optional ``metadata_cache`` subelement controls aspects related to 
the
-- 
2.41.0



Re: [PATCH] docs: Mention vhostuser for queues and queue_size

2023-07-20 Thread Han Han
On Thu, Jul 20, 2023 at 2:56 PM Michal Prívozník 
wrote:

> On 7/20/23 08:22, Han Han wrote:
> > These two attributes are supported for vhost-user-blk as well.
> >
> > Signed-off-by: Han Han 
> > ---
> >  docs/formatdomain.rst | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
> > index 4af0b82569..447ab32c01 100644
> > --- a/docs/formatdomain.rst
> > +++ b/docs/formatdomain.rst
> > @@ -3275,9 +3275,9 @@ paravirtualized driver is specified via the
> ``disk`` element.
> >"virtio" ``bus`` and "pci" or "ccw" ``address`` types.
> :since:`Since 1.2.8
> >(QEMU 2.1)`
> > -  The optional ``queues`` attribute specifies the number of virt
> queues for
> > -  virtio-blk. ( :since:`Since 3.9.0` )
> > +  virtio-blk or vhost-user-blk. ( :since:`Since 3.9.0` )
>
> This doesn't feel right. The vhost-user-blk disk was introduced fairly
> recently and 3.9.0 is just ancient. Digging into commits, vhost-user-blk
> disk was introduced in v7.1.0 and I didn't check whether it supported
> the attribute from the very beginning.
>
> Thank you for pointing this out.  It looks libvirt allows the user to set
the queues for
all the bus=='virtio':
https://gitlab.com/libvirt/libvirt/-/blob/v7.1.0/src/conf/domain_validate.c#L465

So vhost-user-blk could use the queues at the beginning.

> I think if we want to document the attribute then we should probably do
> it like this:
>
> The optional ``queues`` attribute specifies the number of virt queues
> for virtio-blk ( :sinnce:`Since 3.9.0) or vhost-user-blk ( :since:`Since
> X.Y.Z` ).
>
> > -  The optional ``queue_size`` attribute specifies the size of each
> virt
> > -  queue for virtio-blk. ( :since:`Since 7.8.0` )
> > +  queue for virtio-blk or vhost-user-blk. ( :since:`Since 7.8.0` )
> > -  For virtio disks, `Virtio-related options`_ can also
> >be set. ( :since:`Since 3.5.0` )
> > -  The optional ``metadata_cache`` subelement controls aspects
> related to the
>
> I have not checked this later hunk.
>
> Michal
>
>


[PATCH] docs: Mention vhostuser for queues and queue_size

2023-07-20 Thread Han Han
These two attributes are supported for vhost-user-blk as well.

Signed-off-by: Han Han 
---
 docs/formatdomain.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 4af0b82569..447ab32c01 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -3275,9 +3275,9 @@ paravirtualized driver is specified via the ``disk`` 
element.
   "virtio" ``bus`` and "pci" or "ccw" ``address`` types. :since:`Since 
1.2.8
   (QEMU 2.1)`
-  The optional ``queues`` attribute specifies the number of virt queues for
-  virtio-blk. ( :since:`Since 3.9.0` )
+  virtio-blk or vhost-user-blk. ( :since:`Since 3.9.0` )
-  The optional ``queue_size`` attribute specifies the size of each virt
-  queue for virtio-blk. ( :since:`Since 7.8.0` )
+  queue for virtio-blk or vhost-user-blk. ( :since:`Since 7.8.0` )
-  For virtio disks, `Virtio-related options`_ can also
   be set. ( :since:`Since 3.5.0` )
-  The optional ``metadata_cache`` subelement controls aspects related to 
the
-- 
2.41.0



[PATCH 1/2] NEWS: qemu: Support removable attribute for scsi disk

2023-07-17 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 42c2c53091..5ee880efcb 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -27,6 +27,11 @@ v9.6.0 (unreleased)
 ``abstractions/foo`` can be overridden by creating ``local/foo`` and
 ``abstractions/foo.d`` respectively.
 
+  * qemu: Support removable attribute for scsi disk
+
+Now the scsi disk device (``/disk@device='disk'`` and 
``/disk/target@bus='scsi'``) supports
+the removable attribute at ``/disk/target@removable```.
+
 * **Bug fixes**
 
 
-- 
2.41.0



[PATCH 2/2] NEWS: cpu_map: Add SapphireRapids cpu model

2023-07-17 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 4 
 1 file changed, 4 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 5ee880efcb..7abc871f20 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -106,6 +106,10 @@ v9.4.0 (2023-06-01)
 
 QEMU supports parallel migration to be compressed using either zstd or 
zlib.
 
+  * cpu_map: Add SapphireRapids cpu model
+
+This model is introduced since QEMU 8.0.
+
 * **Improvements**
 
   * Adapt to musl-1.2.4
-- 
2.41.0



[PATCH 0/2] NEWS update for 9.4 and 9.6

2023-07-17 Thread Han Han
Han Han (2):
  NEWS: qemu: Support removable attribute for scsi disk
  NEWS: cpu_map: Add SapphireRapids cpu model

 NEWS.rst | 9 +
 1 file changed, 9 insertions(+)

-- 
2.41.0



Re: [PATCH] qemu: Support removable for scsi disk

2023-07-10 Thread Han Han
Thanks

On Mon, Jul 10, 2023 at 3:50 PM Michal Prívozník 
wrote:

> On 6/29/23 13:03, Michal Prívozník wrote:
> > On 6/5/23 07:07, Han Han wrote:
> >> Allow //disk/target@removable for scsi disk devices, since QEMU has
> support
> >> the removable attribute for scsi-hd device from v0.14.0[1].
> >>
> >> [1]: 419e691f8e: scsi-disk: Allow overriding SCSI INQUIRY removable bit
> >>
> >> Signed-off-by: Han Han 
> >> ---
> >>  docs/formatdomain.rst  |  2 +-
> >>  src/conf/domain_validate.c |  5 +++--
> >>  src/qemu/qemu_command.c|  6 --
> >>  ...gs => disk-device-removable.x86_64-latest.args} | 14 +-
> >>  ...ice-removable.xml => disk-device-removable.xml} |  5 +
> >>  tests/qemuxml2argvtest.c   |  2 +-
> >>  6 files changed, 23 insertions(+), 11 deletions(-)
> >>  rename
> tests/qemuxml2argvdata/{disk-usb-device-removable.x86_64-latest.args =>
> disk-device-removable.x86_64-latest.args} (70%)
> >>  rename tests/qemuxml2argvdata/{disk-usb-device-removable.xml =>
> disk-device-removable.xml} (80%)
> >>
> >> diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
> >> index c3526439bf..676e4b9fd3 100644
> >> --- a/docs/formatdomain.rst
> >> +++ b/docs/formatdomain.rst
> >> @@ -3094,7 +3094,7 @@ paravirtualized driver is specified via the
> ``disk`` element.
> >> CDROM or Floppy disk), the value can be either "open" or "closed",
> defaults
> >> to "closed". NB, the value of ``tray`` could be updated while the
> domain is
> >> running. The optional attribute ``removable`` sets the removable
> flag for USB
> >> -   disks, and its value can be either "on" or "off", defaulting to
> "off".
> >> +   or SCSI disks, and its value can be either "on" or "off",
> defaulting to "off".
> >> The optional attribute ``rotation_rate`` sets the rotation rate of
> the
> >> storage for disks on a SCSI, IDE, or SATA bus. Values in the range
> 1025 to
> >> 65534 are used to indicate rotational media speed in revolutions
> per minute.
> >> diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
> >> index 80d6a2ffd9..e7122f6297 100644
> >> --- a/src/conf/domain_validate.c
> >> +++ b/src/conf/domain_validate.c
> >> @@ -881,9 +881,10 @@ virDomainDiskDefValidate(const virDomainDef *def,
> >>  }
> >>
> >>  if (disk->removable != VIR_TRISTATE_SWITCH_ABSENT &&
> >> -disk->bus != VIR_DOMAIN_DISK_BUS_USB) {
> >> +disk->bus != VIR_DOMAIN_DISK_BUS_USB &&
> >> +!(disk->bus == VIR_DOMAIN_DISK_BUS_SCSI && disk->device ==
> VIR_DOMAIN_DISK_DEVICE_DISK)) {
> >
> > This is a long long line and could be split into two.
> >
> >>  virReportError(VIR_ERR_XML_ERROR, "%s",
> >> -   _("removable is only valid for usb disks"));
> >> +   _("removable is only valid for usb or scsi
> disks"));
> >>  return -1;
> >>  }
> >>
> >
> > The rest looks okay. I'd merge this but it's a feature and we're
> > currently in the freeze, preparing for upcoming release (i.e. only bug
> > fixes should be merged). I'll merge this after the release.
> >
> > Reviewed-by: Michal Privoznik 
> >
>
> Merged now.
>
> Michal
>
>


Re: [PATCH] qemu: Support removable for scsi disk

2023-06-29 Thread Han Han
ping~

On Mon, Jun 5, 2023 at 1:07 PM Han Han  wrote:

> Allow //disk/target@removable for scsi disk devices, since QEMU has
> support
> the removable attribute for scsi-hd device from v0.14.0[1].
>
> [1]: 419e691f8e: scsi-disk: Allow overriding SCSI INQUIRY removable bit
>
> Signed-off-by: Han Han 
> ---
>  docs/formatdomain.rst  |  2 +-
>  src/conf/domain_validate.c |  5 +++--
>  src/qemu/qemu_command.c|  6 --
>  ...gs => disk-device-removable.x86_64-latest.args} | 14 +-
>  ...ice-removable.xml => disk-device-removable.xml} |  5 +
>  tests/qemuxml2argvtest.c   |  2 +-
>  6 files changed, 23 insertions(+), 11 deletions(-)
>  rename
> tests/qemuxml2argvdata/{disk-usb-device-removable.x86_64-latest.args =>
> disk-device-removable.x86_64-latest.args} (70%)
>  rename tests/qemuxml2argvdata/{disk-usb-device-removable.xml =>
> disk-device-removable.xml} (80%)
>
> diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
> index c3526439bf..676e4b9fd3 100644
> --- a/docs/formatdomain.rst
> +++ b/docs/formatdomain.rst
> @@ -3094,7 +3094,7 @@ paravirtualized driver is specified via the ``disk``
> element.
> CDROM or Floppy disk), the value can be either "open" or "closed",
> defaults
> to "closed". NB, the value of ``tray`` could be updated while the
> domain is
> running. The optional attribute ``removable`` sets the removable flag
> for USB
> -   disks, and its value can be either "on" or "off", defaulting to "off".
> +   or SCSI disks, and its value can be either "on" or "off", defaulting
> to "off".
> The optional attribute ``rotation_rate`` sets the rotation rate of the
> storage for disks on a SCSI, IDE, or SATA bus. Values in the range
> 1025 to
> 65534 are used to indicate rotational media speed in revolutions per
> minute.
> diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
> index 80d6a2ffd9..e7122f6297 100644
> --- a/src/conf/domain_validate.c
> +++ b/src/conf/domain_validate.c
> @@ -881,9 +881,10 @@ virDomainDiskDefValidate(const virDomainDef *def,
>  }
>
>  if (disk->removable != VIR_TRISTATE_SWITCH_ABSENT &&
> -disk->bus != VIR_DOMAIN_DISK_BUS_USB) {
> +disk->bus != VIR_DOMAIN_DISK_BUS_USB &&
> +!(disk->bus == VIR_DOMAIN_DISK_BUS_SCSI && disk->device ==
> VIR_DOMAIN_DISK_DEVICE_DISK)) {
>  virReportError(VIR_ERR_XML_ERROR, "%s",
> -   _("removable is only valid for usb disks"));
> +   _("removable is only valid for usb or scsi
> disks"));
>  return -1;
>  }
>
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 72363238b8..5ec912ddee 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -1781,10 +1781,12 @@ qemuBuildDiskDeviceProps(const virDomainDef *def,
>  if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
>  driver = "scsi-block";
>  } else {
> -if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
> +if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
>  driver = "scsi-cd";
> -else
> +} else {
>  driver = "scsi-hd";
> +removable = disk->removable;
> +}
>
>  /* qemu historically used the name of -drive as one of the
> device
>   * ids in the Vital Product Data Device Identification page if
> diff --git
> a/tests/qemuxml2argvdata/disk-usb-device-removable.x86_64-latest.args
> b/tests/qemuxml2argvdata/disk-device-removable.x86_64-latest.args
> similarity index 70%
> rename from
> tests/qemuxml2argvdata/disk-usb-device-removable.x86_64-latest.args
> rename to tests/qemuxml2argvdata/disk-device-removable.x86_64-latest.args
> index c5bfd8e8e0..106f7b9ce2 100644
> --- a/tests/qemuxml2argvdata/disk-usb-device-removable.x86_64-latest.args
> +++ b/tests/qemuxml2argvdata/disk-device-removable.x86_64-latest.args
> @@ -27,13 +27,17 @@
> XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
>  -no-shutdown \
>  -boot strict=on \
>  -device
> '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
> --blockdev
> '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-2-st

Re: [PATCH] scripts: Fix the flake8 syntax-check failures

2023-06-29 Thread Han Han
ping~

On Mon, Jun 5, 2023 at 3:40 PM Han Han  wrote:

> Fix the syntax-check failures with the help of isort[1]:
> 289/316 libvirt:syntax-check / flake8   FAIL   5.24s   exit status 2
>
> [1]: https://pycqa.github.io/isort/
>
> Signed-off-by: Han Han 
> ---
>  ci/util.py   | 3 +--
>  run.in   | 2 +-
>  scripts/apibuild.py  | 6 +++---
>  scripts/check-html-references.py | 4 ++--
>  scripts/check-pot.py | 2 +-
>  scripts/esx_vi_generator.py  | 3 +--
>  scripts/hvsupport.py | 2 +-
>  scripts/hyperv_wmi_generator.py  | 2 +-
>  scripts/meson-timestamp.py   | 1 -
>  src/cpu_map/sync_qemu_models_i386.py | 3 ++-
>  tests/cputestdata/cpu-data.py| 1 -
>  tests/virsh-auth | 2 +-
>  tools/virt-qemu-qmp-proxy| 9 +
>  tools/virt-qemu-sev-validate | 9 +
>  14 files changed, 24 insertions(+), 25 deletions(-)
>
> diff --git a/ci/util.py b/ci/util.py
> index f9f3c550db..f18da8d662 100644
> --- a/ci/util.py
> +++ b/ci/util.py
> @@ -1,8 +1,7 @@
>  import json
>  import pathlib
> -import urllib.request
>  import urllib.parse
> -
> +import urllib.request
>  from typing import Dict, List
>
>
> diff --git a/run.in b/run.in
> index c6d3411082..80a5d2dd43 100644
> --- a/run.in
> +++ b/run.in
> @@ -44,8 +44,8 @@ import os
>  import os.path
>  import random
>  import signal
> -import sys
>  import subprocess
> +import sys
>
>
>  # Function to intelligently prepend a path to an environment variable.
> diff --git a/scripts/apibuild.py b/scripts/apibuild.py
> index f532dbe834..3ecc3eadf7 100755
> --- a/scripts/apibuild.py
> +++ b/scripts/apibuild.py
> @@ -8,11 +8,11 @@
>  # dan...@veillard.com
>  #
>
> -import os
> -import sys
> +import argparse
>  import glob
> +import os
>  import re
> -import argparse
> +import sys
>
>  quiet = True
>  warnings = 0
> diff --git a/scripts/check-html-references.py
> b/scripts/check-html-references.py
> index 788622a2d0..d15f28bea7 100755
> --- a/scripts/check-html-references.py
> +++ b/scripts/check-html-references.py
> @@ -16,10 +16,10 @@
>  #
>  # Check that external references between documentation HTML files are not
> broken.
>
> -import sys
> -import os
>  import argparse
> +import os
>  import re
> +import sys
>  import xml.etree.ElementTree as ET
>
>  ns = {'html': 'http://www.w3.org/1999/xhtml'}
> diff --git a/scripts/check-pot.py b/scripts/check-pot.py
> index f6b4fbf36d..6b6b1879fa 100755
> --- a/scripts/check-pot.py
> +++ b/scripts/check-pot.py
> @@ -1,7 +1,7 @@
>  #!/usr/bin/env python3
>
> -import sys
>  import re
> +import sys
>
>  if len(sys.argv) != 2:
>  print(f"usage: {sys.argv[0]} POTFILE", file=sys.stderr)
> diff --git a/scripts/esx_vi_generator.py b/scripts/esx_vi_generator.py
> index 31c36f42e2..0e9adeeefd 100755
> --- a/scripts/esx_vi_generator.py
> +++ b/scripts/esx_vi_generator.py
> @@ -22,10 +22,9 @@
>  # <http://www.gnu.org/licenses/>.
>  #
>
> -import sys
>  import os
>  import os.path
> -
> +import sys
>
>  OCCURRENCE__REQUIRED_ITEM = "r"
>  OCCURRENCE__REQUIRED_LIST = "rl"
> diff --git a/scripts/hvsupport.py b/scripts/hvsupport.py
> index be6bf7b0d2..2327bdf3b8 100755
> --- a/scripts/hvsupport.py
> +++ b/scripts/hvsupport.py
> @@ -16,9 +16,9 @@
>  # License along with this library.  If not, see
>  # <http://www.gnu.org/licenses/>.
>
> -import sys
>  import os.path
>  import re
> +import sys
>
>  if len(sys.argv) != 3:
>  print("syntax: %s TOP-SRCDIR TOP-BUILDDIR\n" % sys.argv[0],
> file=sys.stderr)
> diff --git a/scripts/hyperv_wmi_generator.py
> b/scripts/hyperv_wmi_generator.py
> index d11dfb1809..e10f7f79a7 100755
> --- a/scripts/hyperv_wmi_generator.py
> +++ b/scripts/hyperv_wmi_generator.py
> @@ -20,9 +20,9 @@
>  # <http://www.gnu.org/licenses/>.
>  #
>
> -import sys
>  import os
>  import os.path
> +import sys
>
>  separator = "/*" + ("*" * 50) + "*\n"
>  wmi_classes_by_name = {}
> diff --git a/scripts/meson-timestamp.py b/scripts/meson-timestamp.py
> index f109cad66e..01dc794a5a 100755
> --- a/scripts/meson-timestamp.py
> +++ b/scripts/meson-timestamp.py
> @@ -1,7 +1,6 @@
>  #!/usr/bin/env python3
>
>  import os
> -
>  from datetime import datetime, timezone
>
>  timestamp = os.environ.get('SOURCE_DATE_EPOCH', None)
> diff --git a/src/cpu_map/sync_qemu_models_i386.py
> b/src/cpu_map/sync_qemu_m

[PATCH] scripts: Fix the flake8 syntax-check failures

2023-06-05 Thread Han Han
Fix the syntax-check failures with the help of isort[1]:
289/316 libvirt:syntax-check / flake8   FAIL   5.24s   exit status 2

[1]: https://pycqa.github.io/isort/

Signed-off-by: Han Han 
---
 ci/util.py   | 3 +--
 run.in   | 2 +-
 scripts/apibuild.py  | 6 +++---
 scripts/check-html-references.py | 4 ++--
 scripts/check-pot.py | 2 +-
 scripts/esx_vi_generator.py  | 3 +--
 scripts/hvsupport.py | 2 +-
 scripts/hyperv_wmi_generator.py  | 2 +-
 scripts/meson-timestamp.py   | 1 -
 src/cpu_map/sync_qemu_models_i386.py | 3 ++-
 tests/cputestdata/cpu-data.py| 1 -
 tests/virsh-auth | 2 +-
 tools/virt-qemu-qmp-proxy| 9 +
 tools/virt-qemu-sev-validate | 9 +
 14 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/ci/util.py b/ci/util.py
index f9f3c550db..f18da8d662 100644
--- a/ci/util.py
+++ b/ci/util.py
@@ -1,8 +1,7 @@
 import json
 import pathlib
-import urllib.request
 import urllib.parse
-
+import urllib.request
 from typing import Dict, List
 
 
diff --git a/run.in b/run.in
index c6d3411082..80a5d2dd43 100644
--- a/run.in
+++ b/run.in
@@ -44,8 +44,8 @@ import os
 import os.path
 import random
 import signal
-import sys
 import subprocess
+import sys
 
 
 # Function to intelligently prepend a path to an environment variable.
diff --git a/scripts/apibuild.py b/scripts/apibuild.py
index f532dbe834..3ecc3eadf7 100755
--- a/scripts/apibuild.py
+++ b/scripts/apibuild.py
@@ -8,11 +8,11 @@
 # dan...@veillard.com
 #
 
-import os
-import sys
+import argparse
 import glob
+import os
 import re
-import argparse
+import sys
 
 quiet = True
 warnings = 0
diff --git a/scripts/check-html-references.py b/scripts/check-html-references.py
index 788622a2d0..d15f28bea7 100755
--- a/scripts/check-html-references.py
+++ b/scripts/check-html-references.py
@@ -16,10 +16,10 @@
 #
 # Check that external references between documentation HTML files are not 
broken.
 
-import sys
-import os
 import argparse
+import os
 import re
+import sys
 import xml.etree.ElementTree as ET
 
 ns = {'html': 'http://www.w3.org/1999/xhtml'}
diff --git a/scripts/check-pot.py b/scripts/check-pot.py
index f6b4fbf36d..6b6b1879fa 100755
--- a/scripts/check-pot.py
+++ b/scripts/check-pot.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 
-import sys
 import re
+import sys
 
 if len(sys.argv) != 2:
 print(f"usage: {sys.argv[0]} POTFILE", file=sys.stderr)
diff --git a/scripts/esx_vi_generator.py b/scripts/esx_vi_generator.py
index 31c36f42e2..0e9adeeefd 100755
--- a/scripts/esx_vi_generator.py
+++ b/scripts/esx_vi_generator.py
@@ -22,10 +22,9 @@
 # <http://www.gnu.org/licenses/>.
 #
 
-import sys
 import os
 import os.path
-
+import sys
 
 OCCURRENCE__REQUIRED_ITEM = "r"
 OCCURRENCE__REQUIRED_LIST = "rl"
diff --git a/scripts/hvsupport.py b/scripts/hvsupport.py
index be6bf7b0d2..2327bdf3b8 100755
--- a/scripts/hvsupport.py
+++ b/scripts/hvsupport.py
@@ -16,9 +16,9 @@
 # License along with this library.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-import sys
 import os.path
 import re
+import sys
 
 if len(sys.argv) != 3:
 print("syntax: %s TOP-SRCDIR TOP-BUILDDIR\n" % sys.argv[0], 
file=sys.stderr)
diff --git a/scripts/hyperv_wmi_generator.py b/scripts/hyperv_wmi_generator.py
index d11dfb1809..e10f7f79a7 100755
--- a/scripts/hyperv_wmi_generator.py
+++ b/scripts/hyperv_wmi_generator.py
@@ -20,9 +20,9 @@
 # <http://www.gnu.org/licenses/>.
 #
 
-import sys
 import os
 import os.path
+import sys
 
 separator = "/*" + ("*" * 50) + "*\n"
 wmi_classes_by_name = {}
diff --git a/scripts/meson-timestamp.py b/scripts/meson-timestamp.py
index f109cad66e..01dc794a5a 100755
--- a/scripts/meson-timestamp.py
+++ b/scripts/meson-timestamp.py
@@ -1,7 +1,6 @@
 #!/usr/bin/env python3
 
 import os
-
 from datetime import datetime, timezone
 
 timestamp = os.environ.get('SOURCE_DATE_EPOCH', None)
diff --git a/src/cpu_map/sync_qemu_models_i386.py 
b/src/cpu_map/sync_qemu_models_i386.py
index b5e738def7..65181b6f90 100755
--- a/src/cpu_map/sync_qemu_models_i386.py
+++ b/src/cpu_map/sync_qemu_models_i386.py
@@ -2,11 +2,12 @@
 
 import argparse
 import copy
-import lark
 import os
 import re
 import xml.etree.ElementTree
 
+import lark
+
 
 def translate_vendor(name):
 T = {
diff --git a/tests/cputestdata/cpu-data.py b/tests/cputestdata/cpu-data.py
index b5641f7c16..37fb2e3791 100755
--- a/tests/cputestdata/cpu-data.py
+++ b/tests/cputestdata/cpu-data.py
@@ -10,7 +10,6 @@ import subprocess
 import sys
 import xml.etree.ElementTree
 
-
 _KEYS = {
 "cpuid": ["eax_in", "ecx_in"],
 "msr": ["index"],
diff --git a/tests/virsh-auth b/tests/virsh-auth
index ce3a599107..f4ed798ec4 100755
--- a/tests/virsh-auth
+++ b/tests/virsh-auth
@@ -19,8 +19,8 @

[PATCH] qemu: Support removable for scsi disk

2023-06-04 Thread Han Han
Allow //disk/target@removable for scsi disk devices, since QEMU has support
the removable attribute for scsi-hd device from v0.14.0[1].

[1]: 419e691f8e: scsi-disk: Allow overriding SCSI INQUIRY removable bit

Signed-off-by: Han Han 
---
 docs/formatdomain.rst  |  2 +-
 src/conf/domain_validate.c |  5 +++--
 src/qemu/qemu_command.c|  6 --
 ...gs => disk-device-removable.x86_64-latest.args} | 14 +-
 ...ice-removable.xml => disk-device-removable.xml} |  5 +
 tests/qemuxml2argvtest.c   |  2 +-
 6 files changed, 23 insertions(+), 11 deletions(-)
 rename tests/qemuxml2argvdata/{disk-usb-device-removable.x86_64-latest.args => 
disk-device-removable.x86_64-latest.args} (70%)
 rename tests/qemuxml2argvdata/{disk-usb-device-removable.xml => 
disk-device-removable.xml} (80%)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index c3526439bf..676e4b9fd3 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -3094,7 +3094,7 @@ paravirtualized driver is specified via the ``disk`` 
element.
CDROM or Floppy disk), the value can be either "open" or "closed", defaults
to "closed". NB, the value of ``tray`` could be updated while the domain is
running. The optional attribute ``removable`` sets the removable flag for 
USB
-   disks, and its value can be either "on" or "off", defaulting to "off".
+   or SCSI disks, and its value can be either "on" or "off", defaulting to 
"off".
The optional attribute ``rotation_rate`` sets the rotation rate of the
storage for disks on a SCSI, IDE, or SATA bus. Values in the range 1025 to
65534 are used to indicate rotational media speed in revolutions per minute.
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index 80d6a2ffd9..e7122f6297 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -881,9 +881,10 @@ virDomainDiskDefValidate(const virDomainDef *def,
 }
 
 if (disk->removable != VIR_TRISTATE_SWITCH_ABSENT &&
-disk->bus != VIR_DOMAIN_DISK_BUS_USB) {
+disk->bus != VIR_DOMAIN_DISK_BUS_USB &&
+!(disk->bus == VIR_DOMAIN_DISK_BUS_SCSI && disk->device == 
VIR_DOMAIN_DISK_DEVICE_DISK)) {
 virReportError(VIR_ERR_XML_ERROR, "%s",
-   _("removable is only valid for usb disks"));
+   _("removable is only valid for usb or scsi disks"));
 return -1;
 }
 
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 72363238b8..5ec912ddee 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1781,10 +1781,12 @@ qemuBuildDiskDeviceProps(const virDomainDef *def,
 if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
 driver = "scsi-block";
 } else {
-if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
+if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
 driver = "scsi-cd";
-else
+} else {
 driver = "scsi-hd";
+removable = disk->removable;
+}
 
 /* qemu historically used the name of -drive as one of the device
  * ids in the Vital Product Data Device Identification page if
diff --git 
a/tests/qemuxml2argvdata/disk-usb-device-removable.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-device-removable.x86_64-latest.args
similarity index 70%
rename from tests/qemuxml2argvdata/disk-usb-device-removable.x86_64-latest.args
rename to tests/qemuxml2argvdata/disk-device-removable.x86_64-latest.args
index c5bfd8e8e0..106f7b9ce2 100644
--- a/tests/qemuxml2argvdata/disk-usb-device-removable.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-device-removable.x86_64-latest.args
@@ -27,13 +27,17 @@ 
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -no-shutdown \
 -boot strict=on \
 -device 
'{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
--blockdev 
'{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}'
 \
+-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.0","addr":"0x2"}' 
\
+-blockdev 
'{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}'
 \
+-blockdev 
'{"node-nam

[PATCH python] virDomainMigrate3Params: Add missing params

2023-05-31 Thread Han Han
Add these missing migrate params:
- VIR_MIGRATE_PARAM_DISKS_URI, since libvirt v6.8.0(49186372db)
- VIR_MIGRATE_PARAM_TLS_DESTINATION, since libvirt v6.0.0(1b8af37213e)
- VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL and 
VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL,
since libvirt v9.4.0(150ae3e62b9)

Signed-off-by: Han Han 
---
 libvirt-override.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/libvirt-override.c b/libvirt-override.c
index 0c198cb..8a86174 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -8154,6 +8154,18 @@ static virPyTypedParamsHint virPyDomainMigrate3Params[] 
= {
 # ifdef VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS
 { VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, VIR_TYPED_PARAM_INT },
 # endif
+# ifdef VIR_MIGRATE_PARAM_DISKS_URI
+{ VIR_MIGRATE_PARAM_DISKS_URI, VIR_TYPED_PARAM_STRING },
+#endif
+#ifdef VIR_MIGRATE_PARAM_TLS_DESTINATION
+{ VIR_MIGRATE_PARAM_TLS_DESTINATION, VIR_TYPED_PARAM_STRING },
+#endif
+#ifdef VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL
+{ VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL, VIR_TYPED_PARAM_INT },
+#endif
+#ifdef VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL
+{ VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL, VIR_TYPED_PARAM_INT },
+#endif
 };
 
 
-- 
2.40.1



[PATCH] docs: drvqemu: Fix a typo

2023-01-11 Thread Han Han
Fixes: a677ea92

Signed-off-by: Han Han 
---
 docs/drvqemu.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/drvqemu.rst b/docs/drvqemu.rst
index fa23912937..22d7e6502b 100644
--- a/docs/drvqemu.rst
+++ b/docs/drvqemu.rst
@@ -295,7 +295,7 @@ to ``system_u:object_r:virt_image_t``. In the case of NFS, 
there is an
 alternative option, of enabling the ``virt_use_nfs`` SELinux boolean.
 
 There are some network filesystems, however, that propagate SELinux labels
-properly, just like a local filesystem (e.g. ceph of CIFS). In such case,
+properly, just like a local filesystem (e.g. ceph or CIFS). In such case,
 dynamic labelling (described below) might prevent migration of a virtual
 machine as new unique SELinux label is assigned to the virtual machine on the
 migration destination side. Users are advised to use static labels (``

[PATCH 1/3] NEWS: Mention UNDEFINE_TPM and UNDEFINE_KEEP_TPM flags

2022-10-31 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 893ad6f370..1d4fb62d5e 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -17,6 +17,13 @@ v8.9.0 (unreleased)
 
 * **New features**
 
+  * qemu: Add flags to keep or remove TPM state for the virDomainUndefineFlags
+
+``VIR_DOMAIN_UNDEFINE_TPM`` and ``VIR_DOMAIN_UNDEFINE_KEEP_TPM`` specify
+accordingly to delete or keep a TPM's persistent state directory structure
+and files when undefine a domain. In virsh, they are the ``--tpm`` and
+``--keep-tpm`` for the sub-command undefine.
+
   * qemu: Core Scheduling support
 
 To avoid side channel attacks, the Linux kernel allows creating groups of
-- 
2.38.1



[PATCH 2/3] NEWS: Mention the tool virt-qemu-qmp-proxy

2022-10-31 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 1d4fb62d5e..7b856f4d3f 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -17,6 +17,13 @@ v8.9.0 (unreleased)
 
 * **New features**
 
+  * tools: Add the tool for proxying QMP via libvirt QEMU guests
+
+This tool ``virt-qemu-qmp-proxy`` provides a way to expose a QMP proxy 
server
+that communicates with a QEMU guest managed by libvirt. This enables 
standard
+QMP client tools to interact with libvirt managed guests.
+
+
   * qemu: Add flags to keep or remove TPM state for the virDomainUndefineFlags
 
 ``VIR_DOMAIN_UNDEFINE_TPM`` and ``VIR_DOMAIN_UNDEFINE_KEEP_TPM`` specify
-- 
2.38.1



[PATCH 3/3] NEWS: Add the stats VIR_DOMAIN_STATS_VM of virConnectGetAllDomainStats

2022-10-31 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 7b856f4d3f..06fd4fa84f 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -41,6 +41,12 @@ v8.9.0 (unreleased)
 
 * **Improvements**
 
+  * qemu: Add the stats of VM for virConnectGetAllDomainStats
+
+The stats ``VIR_DOMAIN_STATS_VM`` of virConnectGetAllDomainStats is to
+get the fd-based KVM statistics for the target VM. It could be used by
+the command line ``virsh domstats --vm``
+
   * Add ``vendor`` attribute for CPU models in domain capabilities
 
 Users can now see the vendor of each CPU model in domain capabilities and
-- 
2.38.1



[PATCH 0/3] The NEWS for v8.9

2022-10-31 Thread Han Han
Han Han (3):
  NEWS: Mention UNDEFINE_TPM and UNDEFINE_KEEP_TPM flags
  NEWS: Mention the tool virt-qemu-qmp-proxy
  NEWS: Add the stats VIR_DOMAIN_STATS_VM of virConnectGetAllDomainStats

 NEWS.rst | 20 
 1 file changed, 20 insertions(+)

-- 
2.38.1



[PATCH] include: Fix the introduced version for VIR_DOMAIN_STATS_VM

2022-10-31 Thread Han Han
Fixes: 8c9e3dae14

Signed-off-by: Han Han 
---
 include/libvirt/libvirt-domain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index a37244e4b1..295fd30c93 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -2710,7 +2710,7 @@ typedef enum {
 VIR_DOMAIN_STATS_IOTHREAD = (1 << 7), /* return iothread poll info (Since: 
4.10.0) */
 VIR_DOMAIN_STATS_MEMORY = (1 << 8), /* return domain memory info (Since: 
6.0.0) */
 VIR_DOMAIN_STATS_DIRTYRATE = (1 << 9), /* return domain dirty rate info 
(Since: 7.2.0) */
-VIR_DOMAIN_STATS_VM = (1 << 10), /* return vm info (Since: 8.6.0) */
+VIR_DOMAIN_STATS_VM = (1 << 10), /* return vm info (Since: 8.9.0) */
 } virDomainStatsTypes;
 
 /**
-- 
2.38.1



Re: [libvirt-dbus] README: Fix the broken link of libvirt-dbus

2022-08-04 Thread Han Han
On Thu, Aug 4, 2022 at 3:35 PM Erik Skultety  wrote:

> On Thu, Aug 04, 2022 at 11:34:16AM +0800, Han Han wrote:
> > Signed-off-by: Han Han 
> > ---
> >  README.rst | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/README.rst b/README.rst
> > index eacbbf2..ee20e85 100644
> > --- a/README.rst
> > +++ b/README.rst
> > @@ -13,7 +13,7 @@ API better suited for dbus-based applications.
> >
> >  libvirt-dbus is Free Software and licenced under LGPLv2+.
> >
> > -* https://libvirt.org/libvirt-dbus.html
> > +* https://libvirt.org/dbus.html
> >
> >  The latest official releases can be found at:
> >
> > --
> > 2.37.1
> >
>
> Since we still tell contributors to send patches to the list, I'm going to
> ACK
> this one and push, but we've already switched all the other
> libvirt-
> repos to MR workflow, I'm going to delete that paragraph.
>
> Thanks. Please also update the paragraph "Patches submissions" of
https://gitlab.com/libvirt/libvirt-dbus for the MR workflow.

> Reviewed-by: Erik Skultety 
>
> Regards,
> Erik
>
>


[libvirt-dbus] README: Fix the broken link of libvirt-dbus

2022-08-03 Thread Han Han
Signed-off-by: Han Han 
---
 README.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.rst b/README.rst
index eacbbf2..ee20e85 100644
--- a/README.rst
+++ b/README.rst
@@ -13,7 +13,7 @@ API better suited for dbus-based applications.
 
 libvirt-dbus is Free Software and licenced under LGPLv2+.
 
-* https://libvirt.org/libvirt-dbus.html
+* https://libvirt.org/dbus.html
 
 The latest official releases can be found at:
 
-- 
2.37.1



[PATCH] schemas: Update ref acpi for devices

2022-07-19 Thread Han Han
According to a9fe9569ab, the  is only for PCI
devices. Remove the ref acpi from devices channel, smartcard, tpm,
redirdev, panic, hub because none of them has PCI address. And add the
ref acpi to iommu device.

Fixes: a9fe9569ab

Signed-off-by: Han Han 
---
 src/conf/schemas/domaincommon.rng | 21 +++--
 1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/src/conf/schemas/domaincommon.rng 
b/src/conf/schemas/domaincommon.rng
index faa2561665..2f07c25430 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -5409,9 +5409,6 @@
 
   
 
-
-  
-
 
   
 
@@ -5453,9 +5450,6 @@
   
 
   
-  
-
-  
   
 
   
@@ -5486,9 +5480,6 @@
   
 
   
-  
-
-  
   
 
   
@@ -5661,6 +5652,9 @@
 
   
 
+
+  
+
 
   
 
@@ -5772,9 +5766,6 @@
 
   
 
-
-  
-
 
   
 
@@ -5794,9 +5785,6 @@
 
   
 
-
-  
-
 
   
 
@@ -8048,9 +8036,6 @@
 
   
 
-
-  
-
 
   
 
-- 
2.37.1



[PATCH] docs: Fix syntax error for defaultiothread

2022-07-06 Thread Han Han
Signed-off-by: Han Han 
---
 docs/formatdomain.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index a4e3c39928..89b627f4bd 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -715,7 +715,7 @@ host/guest with many LUNs. :since:`Since 1.2.8 (QEMU only)`


  
- 
+ 
  ...

 
-- 
2.36.1



[PATCH] schemas: rng: Make secret optional in storage vol

2022-07-05 Thread Han Han
For a qcow2 storage volume with luks encryption created by qemu-img, its
dumped storage vol XML has no secret element in encryption:

...


...


That will cause a failure in rng validation. Fix that validation failure.

Signed-off-by: Han Han 
---
 src/conf/schemas/storagecommon.rng | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/conf/schemas/storagecommon.rng 
b/src/conf/schemas/storagecommon.rng
index 10f1bc6a15..76714c9aad 100644
--- a/src/conf/schemas/storagecommon.rng
+++ b/src/conf/schemas/storagecommon.rng
@@ -24,17 +24,19 @@
   
 
   
-  
-
-
-  
-
-  
-  
-
-  
-
-  
+  
+
+  
+  
+
+  
+
+
+  
+
+  
+
+  
 
   
 
-- 
2.36.1



[PATCH] virt-xml-validate: Fix incorrect wildcards for XML roots

2022-07-05 Thread Han Han
To match the XML roots domainCapabilities and storagepoolCapabilities,
the wildcards should be *domainCap* and *storagepoolCap*.

Fixes: 7b0e2e4a55
Signed-off-by: Han Han 
---
 tools/virt-xml-validate.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in
index e444ef2fbc..2d5ba510ab 100644
--- a/tools/virt-xml-validate.in
+++ b/tools/virt-xml-validate.in
@@ -86,7 +86,7 @@ if [ -z "$TYPE" ]; then
  *domainbackup*)
 TYPE="domainbackup"
 ;;
- *domaincaps*)
+ *domainCap*)
 TYPE="domaincaps"
 ;;
  *domain*)
@@ -98,7 +98,7 @@ if [ -z "$TYPE" ]; then
  *network*)
 TYPE="network"
 ;;
- *storagepoolcaps*)
+ *storagepoolCap*)
 TYPE="storagepoolcaps"
 ;;
  *pool*)
-- 
2.36.1



Re: [Questions] non-shared disk migration: jobs abort and bandwidth

2022-06-09 Thread Han Han
On Wed, Jun 8, 2022 at 6:49 PM Peter Krempa  wrote:

> On Wed, Jun 08, 2022 at 17:32:57 +0800, Han Han wrote:
> > Hi developers,
> > Recently, I am researching migration with non-share disk(flags
> > VIR_MIGRATE_NON_SHARED_DISK and VIR_MIGRATE_NON_SHARED_INC).
> > As we know, the non-shared disk migration could have block jobs to copy
> the
> > disk image from the src host to the dst host. So here are my questions
> for
> > non-shared disk migration:
> > q1. For the API virDomainMigrate3 with the bandwidth param, could it set
> > the bandwidth of block jobs?
> > q2. For the API virDomainMigrateSetMaxSpeed, could it set the bandwidth
> of
> > block jobs?
> > q3. For the domain job abort API virDomainAbortJob, could it stop the
> block
> > job of non-shared disk migration?
> > q4. For the block job bandwidth API virDomainBlockJobSetSpeed, could it
> set
> > the block job of non-shared disk migration?
> > q5. For the block job abort API virDomainBlockJobAbort, could it stop the
> > block job of non-shared disk migration?
> >
> >
> >
> > Then I got the test results of libvirt-8.4.0-1.el9.x86_64
> > qemu-kvm-7.0.0-4.el9.x86_64:
> > q1: The bandwidth limit of virDomainMigrate3 is effective to the
> blockjob:
> > ➜  ~ virsh migrate OVMF qemu+ssh://root@hhan-rhel9--1/system --live
> --p2p
> > --tls --tls-destination hhan-rhel9--1 --copy-storage-all --disks-uri
> > tcp://hhan-rhel9--1:49156 --bandwidth 2
> > ➜  ~ virsh blockjob OVMF vda
> > Block Copy: [  0 %]Bandwidth limit: 2097152 bytes/s (2.000 MiB/s)
>
> This is expected and desired.
>
> > q2: The virDomainMigrateSetMaxSpeed doesn't change the the bandwidth of
> > block jobs.
> > ➜  ~ virsh migrate-setspeed OVMF 8
> >
> > ➜  ~ virsh blockjob OVMF vda
> > Block Copy: [  9 %]Bandwidth limit: 2097152 bytes/s (2.000 MiB/s)
>
> This is a bug though, setting the migration speed should, based on the
> fact that  we want to use the global migration speed flag for disks too
> , apply also to the disk migration streams.
>
File a bug here: https://bugzilla.redhat.com/show_bug.cgi?id=2095093

>
> > q3: The virDomainAbortJob could stop a block job of non-shared disk
> > migration
> > ➜  ~ virsh migrate OVMF qemu+ssh://root@hhan-rhel9--1/system --live
> --p2p
> > --tls --tls-destination hhan-rhel9--1 --copy-storage-all --disks-uri
> > tcp://hhan-rhel9--1:49156 --bandwidth 2
> > Then start a virsh event on another terminal:
> > ➜  ~ virsh event --loop --all
> >
> > Abort the domain job:
> > ➜  ~ virsh domjobabort OVMF
> >
> > The error "error: operation aborted: migration out: canceled by client"
> > appears at the terminal of "virsh migrate"
> > The terminal of "virsh event" shows the block job has been failed:
> > event 'block-job' for domain 'OVMF': Block Copy for
> > /var/lib/libvirt/images/OVMF.qcow2 failed
> > event 'block-job-2' for domain 'OVMF': Block Copy for vda failed
>
> This is again expected, the blockjobs are started by the migration thus
> when you cancel the migration we also need to cancel the blockjobs.
>
> > q4: The block job bandwidth of non-shared disk migration cannot be set by
> > virDomainBlockJobSetSpeed:
> > ➜  ~ virsh blockjob OVMF vda --bandwidth 10
> > error: Timed out during operation: cannot acquire state change lock (held
> > by monitor=remoteDispatchDomainMigratePerform3Params)
>
> This is okay, but we could take it a sa feature request to allow tuning
> of the individual blockjobs.
>
Assuming that tuning the individual blockjobs is supported, it is hard to
tell the bandwidth got from
virDomainMigrateGetMaxSpeed is the speed of  VM migration or the speed of
blockjob.
In contrast to virDomainMigrateSetMaxSpeed, the bandwidth is aimed for both
bandwidths.

I am not sure if there is such a user case: the VM migration data is
transported via sub-netA while
the block is transported via sub-netB. Then it may require to set different
bandwidth for different sub-nets.
If all the data is transported via the same net interface, just  keep it as
it is now.

BWT, what is the meaning of  "sa feature"?

>
> > q5: The block job of non-shared disk migration cannot be aborted by
> > virDomainBlockJobAbort:
> > ➜  ~ virsh blockjob OVMF vda --abort
> > error: Timed out during operation: cannot acquire state change lock (held
> > by monitor=remoteDispatchDomainMigratePerform3Params)
>
> This is expected. Same as above, we dodn't want to allow users to
> control this. In contrast to 'q4' I'd refuse a RFE to allow cancelling
> of individual jobs.
>
> > Are

[Questions] non-shared disk migration: jobs abort and bandwidth

2022-06-08 Thread Han Han
Hi developers,
Recently, I am researching migration with non-share disk(flags
VIR_MIGRATE_NON_SHARED_DISK and VIR_MIGRATE_NON_SHARED_INC).
As we know, the non-shared disk migration could have block jobs to copy the
disk image from the src host to the dst host. So here are my questions for
non-shared disk migration:
q1. For the API virDomainMigrate3 with the bandwidth param, could it set
the bandwidth of block jobs?
q2. For the API virDomainMigrateSetMaxSpeed, could it set the bandwidth of
block jobs?
q3. For the domain job abort API virDomainAbortJob, could it stop the block
job of non-shared disk migration?
q4. For the block job bandwidth API virDomainBlockJobSetSpeed, could it set
the block job of non-shared disk migration?
q5. For the block job abort API virDomainBlockJobAbort, could it stop the
block job of non-shared disk migration?



Then I got the test results of libvirt-8.4.0-1.el9.x86_64
qemu-kvm-7.0.0-4.el9.x86_64:
q1: The bandwidth limit of virDomainMigrate3 is effective to the blockjob:
➜  ~ virsh migrate OVMF qemu+ssh://root@hhan-rhel9--1/system --live --p2p
--tls --tls-destination hhan-rhel9--1 --copy-storage-all --disks-uri
tcp://hhan-rhel9--1:49156 --bandwidth 2
➜  ~ virsh blockjob OVMF vda
Block Copy: [  0 %]Bandwidth limit: 2097152 bytes/s (2.000 MiB/s)


q2: The virDomainMigrateSetMaxSpeed doesn't change the the bandwidth of
block jobs.
➜  ~ virsh migrate-setspeed OVMF 8

➜  ~ virsh blockjob OVMF vda
Block Copy: [  9 %]Bandwidth limit: 2097152 bytes/s (2.000 MiB/s)


q3: The virDomainAbortJob could stop a block job of non-shared disk
migration
➜  ~ virsh migrate OVMF qemu+ssh://root@hhan-rhel9--1/system --live --p2p
--tls --tls-destination hhan-rhel9--1 --copy-storage-all --disks-uri
tcp://hhan-rhel9--1:49156 --bandwidth 2
Then start a virsh event on another terminal:
➜  ~ virsh event --loop --all

Abort the domain job:
➜  ~ virsh domjobabort OVMF

The error "error: operation aborted: migration out: canceled by client"
appears at the terminal of "virsh migrate"
The terminal of "virsh event" shows the block job has been failed:
event 'block-job' for domain 'OVMF': Block Copy for
/var/lib/libvirt/images/OVMF.qcow2 failed
event 'block-job-2' for domain 'OVMF': Block Copy for vda failed


q4: The block job bandwidth of non-shared disk migration cannot be set by
virDomainBlockJobSetSpeed:
➜  ~ virsh blockjob OVMF vda --bandwidth 10
error: Timed out during operation: cannot acquire state change lock (held
by monitor=remoteDispatchDomainMigratePerform3Params)


q5: The block job of non-shared disk migration cannot be aborted by
virDomainBlockJobAbort:
➜  ~ virsh blockjob OVMF vda --abort
error: Timed out during operation: cannot acquire state change lock (held
by monitor=remoteDispatchDomainMigratePerform3Params)


Are the results above expected?
Here are my personal thoughts:
For the bandwidth in q1 and q2, they are commented as migration bandwidth(
https://gitlab.com/libvirt/libvirt/-/blob/master/include/libvirt/libvirt-domain.h#L1165
,
https://gitlab.com/libvirt/libvirt/-/blob/master/src/libvirt-domain.c#L9696
), but one works for block jobs while one doesn't. So we should make the
comment clear whether they are the bandwidth of VM migration or the
bandwidth of migration with blockjobs. What's more, add a flag to
virDomainMigrateMaxSpeedFlags to support set bandwidth to the blockjobs in
migration.
For q4 and q5, if we will not support to change the block job of non-shared
disk migration by blockjob APIs, we should note that in the migration doc
or the block job doc, to present the difference between this type of block
job and the others.


[PATCH v2 1/2] news: Add qemu-vdagent

2022-05-30 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index e50010f9b2..bb2713f4e2 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -33,6 +33,11 @@ v8.4.0 (unreleased)
 to be kept set to an arbitrary time for e.g. testing or working around
 broken software.
 
+  * qemu: add qemu-vdagent channel
+
+This paravirtualized qemu vdagent channel can enable copy and paste between
+a guest and a VNC client. It is available in QEMU 6.1.0.
+
 * **Improvements**
 
 * **Bug fixes**
-- 
2.36.1



[PATCH v2 2/2] news: Add APIs virDomainSaveParams virDomainRestoreParams

2022-05-30 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index bb2713f4e2..8a2073d800 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -38,6 +38,13 @@ v8.4.0 (unreleased)
 This paravirtualized qemu vdagent channel can enable copy and paste between
 a guest and a VNC client. It is available in QEMU 6.1.0.
 
+  * api: Add new APIs ``virDomainSaveParams`` and ``virDomainRestoreParams``
+
+* ``virDomainSaveParams``: An alternative domain saving API, extends
+  ``virDomainSaveFlags`` by adding parameters.
+* ``virDomainRestoreParams``: An alternative domain restoring API, extends
+  ``virDomainRestoreFlags`` by adding parameters.
+
 * **Improvements**
 
 * **Bug fixes**
-- 
2.36.1



[PATCH v2 0/2] 2 release notes for v8.4.0

2022-05-30 Thread Han Han
v1: https://listman.redhat.com/archives/libvir-list/2022-May/231901.html
diff from v1: rebase to latest and resolve conflicts

Han Han (2):
  news: Add qemu-vdagent
  news: Add APIs virDomainSaveParams virDomainRestoreParams

 NEWS.rst | 12 
 1 file changed, 12 insertions(+)

-- 
2.36.1



[PATCH 0/2] 2 release notes for v8.4.0

2022-05-29 Thread Han Han
Han Han (2):
  news: Add qemu-vdagent
  news: Add APIs virDomainSaveParams virDomainRestoreParams

 NEWS.rst | 12 
 1 file changed, 12 insertions(+)

-- 
2.36.1



[PATCH 2/2] news: Add APIs virDomainSaveParams virDomainRestoreParams

2022-05-29 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index f20900a38d..a50afa01e1 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -31,6 +31,13 @@ v8.4.0 (unreleased)
 This paravirtualized qemu vdagent channel can enable copy and paste between
 a guest and a VNC client. It is available in QEMU 6.1.0.
 
+  * api: Add new APIs ``virDomainSaveParams`` and ``virDomainRestoreParams``
+
+* ``virDomainSaveParams``: An alternative domain saving API, extends
+  ``virDomainSaveFlags`` by adding parameters.
+* ``virDomainRestoreParams``: An alternative domain restoring API, extends
+  ``virDomainRestoreFlags`` by adding parameters.
+
 * **Improvements**
 
 * **Bug fixes**
-- 
2.36.1



[PATCH 1/2] news: Add qemu-vdagent

2022-05-29 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index b0d4297d53..f20900a38d 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -26,6 +26,11 @@ v8.4.0 (unreleased)
 
 Support for the recently released IBM Power10 processor was added.
 
+  * qemu: add qemu-vdagent channel
+
+This paravirtualized qemu vdagent channel can enable copy and paste between
+a guest and a VNC client. It is available in QEMU 6.1.0.
+
 * **Improvements**
 
 * **Bug fixes**
-- 
2.36.1



Re: [PATCH 00/16] New update from 6.9 to 7.8

2022-05-18 Thread Han Han
On Thu, May 19, 2022 at 2:01 AM Andrea Bolognani 
wrote:

> On Wed, May 11, 2022 at 10:16:58AM +0800, Han Han wrote:
> > Han Han (16):
> >   news: make SEV attrs 'cbitpos' & 'reducedPhysBits' optional
> >   news: support device stats collection for SR-IOV VF hostdev
> >   news: cpu_map: Add EPYC-Rome cpu model
> >   news: cpu: Support for XML validation in cpu comparison
> >   news: logging: allow max_len=0 to disable log rollover
> >   news: qemu: Set noqueue qdisc for TAP devices
> >   news: qemu: Introduce virtio free page reporting feature
> >   news: qemu: virtiofs can be used without NUMA nodes
> >   news: qemu: Add 'fmode' and 'dmode' options for 9pfs
> >   news: Introduce "migrate_tls_force" to qemu.conf
> >   news: qemu: support kvm-poll-control performance hint
> >   news: cpu_map: Add Snowridge cpu model
> >   news: qemu: Add support for NFS disk protocol
> >   news: Support vhostuser in virsh attach-interface since v7.7.0
> >   news: Add queue_size option to virtio disk
> >   news: Validation flags for creating net, nwfilter-binding, net port
> >
> >  NEWS.rst | 89 
> >  1 file changed, 89 insertions(+)
>
> Series
>
>   Reviewed-by: Andrea Bolognani 
>
> and pushed with some tweaks. Thanks!
>
>
> If you enjoy making this kind of contributions to libvirt, the very
> best time for them would be during the freeze period right before
> each release. But no pressure :)
>
Thanks for your advice :)

>
> --
> Andrea Bolognani / Red Hat / Virtualization
>
>


Re: [libvirt PATCH v3 4/6] conf: add support for 'blob' in virtio video device

2022-05-11 Thread Han Han
On Thu, May 12, 2022 at 2:28 AM Jonathon Jongsma 
wrote:

> On 5/11/22 9:56 AM, Han Han wrote:
> >
> >
> > On Wed, May 11, 2022 at 12:26 AM Jonathon Jongsma  > <mailto:jjong...@redhat.com>> wrote:
> >
> > Add the ability to enable blob resources for the virtio video device.
> > This will accelerate the display path due to less or no copying of
> pixel
> > data.
> >
> > Blob resource support can be enabled with e.g.:
> >
> >  
> >
> >  
> >
> > Some additional background information about blob resources:
> >
> https://lists.freedesktop.org/archives/dri-devel/2020-August/275972.html
> > <
> https://lists.freedesktop.org/archives/dri-devel/2020-August/275972.html>
> > https://www.kraxel.org/blog/2021/05/virtio-gpu-qemu-graphics-update/
> > <
> https://www.kraxel.org/blog/2021/05/virtio-gpu-qemu-graphics-update/>
> >
> > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2032406
> > <https://bugzilla.redhat.com/show_bug.cgi?id=2032406>
> >
> > Signed-off-by: Jonathon Jongsma  > <mailto:jjong...@redhat.com>>
> > ---
> >   docs/formatdomain.rst |  6 ++
> >   src/conf/domain_conf.c|  6 ++
> >   src/conf/domain_conf.h|  1 +
> >   src/conf/domain_validate.c| 13 ++---
> >   src/conf/schemas/domaincommon.rng |  5 +
> >   5 files changed, 28 insertions(+), 3 deletions(-)
> >
> > diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
> > index 993c65e50b..2161cc7e30 100644
> > --- a/docs/formatdomain.rst
> > +++ b/docs/formatdomain.rst
> > @@ -6198,6 +6198,12 @@ A video device.
> >  :since:`since 1.3.3` ) extends secondary bar and makes it
> > addressable as
> >  64bit memory.
> >
> > +   :since:`Since 8.2.0`, devices with type "virtio" have an
> > optional ``blob``
> >
> > Since 8.4.0 for libvirt.
>
> Oops. Didn't catch that in the rebase.
>
> > And please mention the QEMU version 6.1.0
>
> There are a lot of libvirt features that require minimum versions of
> qemu, but it doesn't look like we generally specify these qemu version
> requirements in the libvirt documentation. Not sure if I should add it
> here...
>
Generally, the minimal required QEMU version is 3.1.0(
https://libvirt.org/drvqemu.html):
"The libvirt KVM/QEMU driver can manage any QEMU emulator from version
3.1.0 or later"
That's to say, a user can use 3.1.0<=QEMU<6.2.0 with current libvirt.
So it's better to mention the required QEMU version for 'blob' to help
users resolved the unsupported error.

>
> >
> > +   attribute that can be set to "on" or "off". Setting ``blob`` to
> > "on" will
> > +   enable the use of blob resources in the device. This can
> > accelerate the
> > +   display path by reducing or eliminating copying of pixel data
> > between the
> > +   guest and host.
> > +
> >  :since:`Since 5.9.0` , the ``model`` element may also have an
> > optional
> >  ``resolution`` sub-element. The ``resolution`` element has
> > attributes ``x``
> >  and ``y`` to set the minimum resolution for the video device.
> This
> > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> > index 60c27ddd34..ae86f455bd 100644
> > --- a/src/conf/domain_conf.c
> > +++ b/src/conf/domain_conf.c
> > @@ -14154,6 +14154,9 @@
> > virDomainVideoModelDefParseXML(virDomainVideoDef *def,
> >   else if (rc == 0)
> >   def->heads = 1;
> >
> > +if (virXMLPropTristateSwitch(node, "blob", VIR_XML_PROP_NONE,
> > >blob) < 0)
> > +return -1;
> > +
> >   return 0;
> >   }
> >
> > @@ -26075,6 +26078,9 @@ virDomainVideoDefFormat(virBuffer *buf,
> >   virBufferAsprintf(buf, " heads='%u'", def->heads);
> >   if (def->primary)
> >   virBufferAddLit(buf, " primary='yes'");
> > +if (def->blob != VIR_TRISTATE_SWITCH_ABSENT)
> > +virBufferAsprintf(buf, " blob='%s'",
> > +  virTristateSwitchTypeToString(def->blob));
> >   if (def->accel || def->res) {
> >   virBufferAddLit(buf, ">\n");
> > 

Re: [libvirt][PATCH v11 3/4] conf: Introduce SGX EPC element into device memory xml

2022-05-11 Thread Han Han
On Wed, May 11, 2022 at 2:12 PM Lin Yang  wrote:

> 
>   ...
>   
> 
>   512
> 
>   
>   ...
> 
>
> Signed-off-by: Lin Yang 
> ---
>  docs/formatdomain.rst |  9 +++-
>  src/conf/domain_conf.c|  6 +++
>  src/conf/domain_conf.h|  1 +
>  src/conf/domain_validate.c| 16 ++
>  src/conf/schemas/domaincommon.rng |  1 +
>  src/qemu/qemu_alias.c |  3 ++
>  src/qemu/qemu_command.c   |  1 +
>  src/qemu/qemu_domain.c| 38 +-
>  src/qemu/qemu_domain_address.c|  6 +++
>  src/qemu/qemu_driver.c|  1 +
>  src/qemu/qemu_process.c   |  2 +
>  src/qemu/qemu_validate.c  |  8 +++
>  src/security/security_apparmor.c  |  1 +
>  src/security/security_dac.c   |  2 +
>  src/security/security_selinux.c   |  2 +
>  tests/qemuxml2argvdata/sgx-epc.xml| 36 +
>  .../sgx-epc.x86_64-latest.xml | 52 +++
>  tests/qemuxml2xmltest.c   |  2 +
>  18 files changed, 172 insertions(+), 15 deletions(-)
>  create mode 100644 tests/qemuxml2argvdata/sgx-epc.xml
>  create mode 100644 tests/qemuxml2xmloutdata/sgx-epc.x86_64-latest.xml
>
> diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
> index 9be305f3e6..cdb61068b9 100644
> --- a/docs/formatdomain.rst
> +++ b/docs/formatdomain.rst
> @@ -7836,6 +7836,11 @@ Example: usage of the memory devices
>   524288
> 
>   
> + 
> +   
> + 16384
> +   
> + 
> 
> ...
>
> @@ -7844,7 +7849,9 @@ Example: usage of the memory devices
> 1.2.14` Provide ``nvdimm`` model that adds a Non-Volatile DIMM module.
> :since:`Since 3.2.0` Provide ``virtio-pmem`` model to add a
> paravirtualized
> persistent memory device. :since:`Since 7.1.0` Provide ``virtio-mem``
> model
> -   to add paravirtualized memory device. :since:`Since 7.9.0`
> +   to add paravirtualized memory device. :since:`Since 7.9.0` Provide
> +   ``sgx-epc`` model to add a SGX enclave page cache (EPC) memory to the
> guest.
> +   :since:`Since 8.1.0`
>
s/8.1.0/8.4.0/
and QEMU 6.2.0

>
>  ``access``
> An optional attribute ``access`` ( :since:`since 3.2.0` ) that provides
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index bd2884088c..a35f9e6c02 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -1429,6 +1429,7 @@ VIR_ENUM_IMPL(virDomainMemoryModel,
>"nvdimm",
>"virtio-pmem",
>"virtio-mem",
> +  "sgx-epc",
>  );
>
>  VIR_ENUM_IMPL(virDomainShmemModel,
> @@ -5630,6 +5631,7 @@ virDomainMemoryDefPostParse(virDomainMemoryDef *mem,
>
>  case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM:
>  case VIR_DOMAIN_MEMORY_MODEL_DIMM:
> +case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC:
>  case VIR_DOMAIN_MEMORY_MODEL_NONE:
>  case VIR_DOMAIN_MEMORY_MODEL_LAST:
>  break;
> @@ -14552,6 +14554,7 @@ virDomainMemorySourceDefParseXML(xmlNodePtr node,
>  def->nvdimmPath = virXPathString("string(./path)", ctxt);
>  break;
>
> +case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC:
>  case VIR_DOMAIN_MEMORY_MODEL_NONE:
>  case VIR_DOMAIN_MEMORY_MODEL_LAST:
>  break;
> @@ -14620,6 +14623,7 @@ virDomainMemoryTargetDefParseXML(xmlNodePtr node,
>  case VIR_DOMAIN_MEMORY_MODEL_NONE:
>  case VIR_DOMAIN_MEMORY_MODEL_DIMM:
>  case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM:
> +case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC:
>  case VIR_DOMAIN_MEMORY_MODEL_LAST:
>  break;
>  }
> @@ -16416,6 +16420,7 @@ virDomainMemoryFindByDefInternal(virDomainDef *def,
>  continue;
>  break;
>
> +case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC:
>  case VIR_DOMAIN_MEMORY_MODEL_NONE:
>  case VIR_DOMAIN_MEMORY_MODEL_LAST:
>  break;
> @@ -25874,6 +25879,7 @@ virDomainMemorySourceDefFormat(virBuffer *buf,
>  virBufferEscapeString(, "%s\n",
> def->nvdimmPath);
>  break;
>
> +case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC:
>  case VIR_DOMAIN_MEMORY_MODEL_NONE:
>  case VIR_DOMAIN_MEMORY_MODEL_LAST:
>  break;
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index 88a411d00c..8c89690ca5 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -2536,6 +2536,7 @@ typedef enum {
>  VIR_DOMAIN_MEMORY_MODEL_NVDIMM, /* nvdimm memory device */
>  VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM, /* virtio-pmem memory device */
>  VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM, /* virtio-mem memory device */
> +VIR_DOMAIN_MEMORY_MODEL_SGX_EPC, /* SGX enclave page cache */
>
>  VIR_DOMAIN_MEMORY_MODEL_LAST
>  } virDomainMemoryModel;
> diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
> index 

Re: [libvirt PATCH v3 4/6] conf: add support for 'blob' in virtio video device

2022-05-11 Thread Han Han
On Wed, May 11, 2022 at 12:26 AM Jonathon Jongsma 
wrote:

> Add the ability to enable blob resources for the virtio video device.
> This will accelerate the display path due to less or no copying of pixel
> data.
>
> Blob resource support can be enabled with e.g.:
>
> 
>   
> 
>
> Some additional background information about blob resources:
> https://lists.freedesktop.org/archives/dri-devel/2020-August/275972.html
> https://www.kraxel.org/blog/2021/05/virtio-gpu-qemu-graphics-update/
>
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2032406
>
> Signed-off-by: Jonathon Jongsma 
> ---
>  docs/formatdomain.rst |  6 ++
>  src/conf/domain_conf.c|  6 ++
>  src/conf/domain_conf.h|  1 +
>  src/conf/domain_validate.c| 13 ++---
>  src/conf/schemas/domaincommon.rng |  5 +
>  5 files changed, 28 insertions(+), 3 deletions(-)
>
> diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
> index 993c65e50b..2161cc7e30 100644
> --- a/docs/formatdomain.rst
> +++ b/docs/formatdomain.rst
> @@ -6198,6 +6198,12 @@ A video device.
> :since:`since 1.3.3` ) extends secondary bar and makes it addressable
> as
> 64bit memory.
>
> +   :since:`Since 8.2.0`, devices with type "virtio" have an optional
> ``blob``
>
Since 8.4.0 for libvirt.
And please mention the QEMU version 6.1.0

> +   attribute that can be set to "on" or "off". Setting ``blob`` to "on"
> will
> +   enable the use of blob resources in the device. This can accelerate the
> +   display path by reducing or eliminating copying of pixel data between
> the
> +   guest and host.
> +
> :since:`Since 5.9.0` , the ``model`` element may also have an optional
> ``resolution`` sub-element. The ``resolution`` element has attributes
> ``x``
> and ``y`` to set the minimum resolution for the video device. This
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 60c27ddd34..ae86f455bd 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -14154,6 +14154,9 @@ virDomainVideoModelDefParseXML(virDomainVideoDef
> *def,
>  else if (rc == 0)
>  def->heads = 1;
>
> +if (virXMLPropTristateSwitch(node, "blob", VIR_XML_PROP_NONE,
> >blob) < 0)
> +return -1;
> +
>  return 0;
>  }
>
> @@ -26075,6 +26078,9 @@ virDomainVideoDefFormat(virBuffer *buf,
>  virBufferAsprintf(buf, " heads='%u'", def->heads);
>  if (def->primary)
>  virBufferAddLit(buf, " primary='yes'");
> +if (def->blob != VIR_TRISTATE_SWITCH_ABSENT)
> +virBufferAsprintf(buf, " blob='%s'",
> +  virTristateSwitchTypeToString(def->blob));
>  if (def->accel || def->res) {
>  virBufferAddLit(buf, ">\n");
>  virBufferAdjustIndent(buf, 2);
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index acd0588e9b..afa6db2403 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -1763,6 +1763,7 @@ struct _virDomainVideoDef {
>  bool primary;
>  virDomainVideoAccelDef *accel;
>  virDomainVideoResolutionDef *res;
> +virTristateSwitch blob;
>  virDomainVideoDriverDef *driver;
>  virDomainDeviceInfo info;
>  virDomainVirtioOptions *virtio;
> diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
> index 18eb8d697d..da0ff06570 100644
> --- a/src/conf/domain_validate.c
> +++ b/src/conf/domain_validate.c
> @@ -226,9 +226,16 @@ virDomainVideoDefValidate(const virDomainVideoDef
> *video,
>  }
>  }
>
> -if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
> -(virDomainCheckVirtioOptionsAreAbsent(video->virtio) < 0))
> -return -1;
> +if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
> +if (virDomainCheckVirtioOptionsAreAbsent(video->virtio) < 0)
> +return -1;
> +if (video->blob != VIR_TRISTATE_SWITCH_ABSENT) {
> +virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> +   _("video type '%s' does not support blob
> resources"),
> +   virDomainVideoTypeToString(video->type));
> +return -1;
> +}
> +}
>
>  return 0;
>  }
> diff --git a/src/conf/schemas/domaincommon.rng
> b/src/conf/schemas/domaincommon.rng
> index 2544864eb4..16b3fd9c53 100644
> --- a/src/conf/schemas/domaincommon.rng
> +++ b/src/conf/schemas/domaincommon.rng
> @@ -4251,6 +4251,11 @@
>  
>
>  
> +
> +  
> +
> +  
> +
>  
>
>  
> --
> 2.35.1
>
>


[PATCH] docs: formatdomain: Fix the introduced version of vdagent

2022-05-11 Thread Han Han
The qemu-vdagent channel is introduced since:
"05b09f039econf: add qemu-vdagent channel"

It will be in the version 8.4.0.

Signed-off-by: Han Han 
---
 docs/formatdomain.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 993c65e50b..c1e99951a6 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -6630,7 +6630,7 @@ types have different ``target`` attributes.
Mouse mode is set by the ``mouse`` element, setting its ``mode`` attribute
to one of ``server`` or ``client``. If no mode is specified, the qemu
default will be used (client mode).
-   :since:`Since 8.2.0`
+   :since:`Since 8.4.0`
 
 :anchor:``
 
-- 
2.36.0



[PATCH v2] virt-xml-validate: Add more XML formats support

2022-05-11 Thread Han Han
Add these XML formats validation in manpage or script:
cpu, domainbackup, domaincaps, domaincheckpoint, networkport,
storagepoolcaps.

Signed-off-by: Han Han 
---
Diff from v1: Add domainbackup, domaincaps, networkport, storagepoolcaps
v1: https://listman.redhat.com/archives/libvir-list/2021-November/225070.html
---
 docs/manpages/virt-xml-validate.rst | 24 
 tools/virt-xml-validate.in  | 15 +++
 2 files changed, 39 insertions(+)

diff --git a/docs/manpages/virt-xml-validate.rst 
b/docs/manpages/virt-xml-validate.rst
index 940eada3a8..503ddbd35a 100644
--- a/docs/manpages/virt-xml-validate.rst
+++ b/docs/manpages/virt-xml-validate.rst
@@ -31,18 +31,42 @@ from the name of the root element in the XML document.
 
 Valid schema names currently include
 
+- ``cpu``
+
+The schema for the XML format of cpu
+
 - ``domainsnapshot``
 
 The schema for the XML format used by domain snapshot configuration
 
+- ``domaincheckpoint``
+
+The schema for the XML format used by domain checkpoint configuration
+
+- ``domainbackup``
+
+The schema for the XML format used by domain backup configuration
+
+- ``domaincaps``
+
+The schema for the XML format of domain capabilities
+
 - ``domain``
 
 The schema for the XML format used by guest domains configuration
 
+- ``networkport``
+
+The schema for the XML format used by network port configuration
+
 - ``network``
 
 The schema for the XML format used by virtual network configuration
 
+- ``storagepoolcaps``
+
+The schema for the XML format of storage pool capabilities
+
 - ``storagepool``
 
 The schema for the XML format used by storage pool configuration
diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in
index 249bcf7eef..e444ef2fbc 100644
--- a/tools/virt-xml-validate.in
+++ b/tools/virt-xml-validate.in
@@ -74,9 +74,21 @@ if [ -z "$TYPE" ]; then
 ROOT=`xmllint --stream --debug "$XMLFILE" 2>/dev/null | grep "^0 1 " | awk 
'{ print $3 }'`
   fi
   case "$ROOT" in
+ *cpu*)
+TYPE="cpu"
+;;
  *domainsnapshot*) # Must come first, since *domain* is a substring
 TYPE="domainsnapshot"
 ;;
+ *domaincheckpoint*)
+TYPE="domaincheckpoint"
+;;
+ *domainbackup*)
+TYPE="domainbackup"
+;;
+ *domaincaps*)
+TYPE="domaincaps"
+;;
  *domain*)
 TYPE="domain"
 ;;
@@ -86,6 +98,9 @@ if [ -z "$TYPE" ]; then
  *network*)
 TYPE="network"
 ;;
+ *storagepoolcaps*)
+TYPE="storagepoolcaps"
+;;
  *pool*)
 TYPE="storagepool"
 ;;
-- 
2.36.0



[PATCH 13/16] news: qemu: Add support for NFS disk protocol

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 4 
 1 file changed, 4 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index f27e8bb22d..34934b42f3 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1020,6 +1020,10 @@ v7.0.0 (2021-01-15)
 
 The cpu model Snowridge is supported since QEMU 4.1.
 
+  * qemu: Add support for NFS disk protocol
+
+Implement support for the 'nfs' native protocol driver in the qemu driver.
+
 * **Improvements**
 
   * qemu: Discourage users from polling ``virDomainGetBlockJobInfo`` for block
-- 
2.36.0



[PATCH 03/16] news: cpu_map: Add EPYC-Rome cpu model

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 4 
 1 file changed, 4 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 68e89e0fc8..115114789d 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1192,6 +1192,10 @@ v6.9.0 (2020-11-02)
 using . The node device APIs also now
 list and provide XML descriptions for vDPA devices.
 
+  * cpu_map: Add EPYC-Rome cpu model
+
+The EPYC-Rome is supported in QEMU since ``v5.0.0``.
+
 * **Improvements**
 
   * qemu: Make 'cbitpos' & 'reducedPhysBits' attrs optional
-- 
2.36.0



[PATCH 00/16] New update from 6.9 to 7.8

2022-05-10 Thread Han Han


Han Han (16):
  news: make SEV attrs 'cbitpos' & 'reducedPhysBits' optional
  news: support device stats collection for SR-IOV VF hostdev
  news: cpu_map: Add EPYC-Rome cpu model
  news: cpu: Support for XML validation in cpu comparison
  news: logging: allow max_len=0 to disable log rollover
  news: qemu: Set noqueue qdisc for TAP devices
  news: qemu: Introduce virtio free page reporting feature
  news: qemu: virtiofs can be used without NUMA nodes
  news: qemu: Add 'fmode' and 'dmode' options for 9pfs
  news: Introduce "migrate_tls_force" to qemu.conf
  news: qemu: support kvm-poll-control performance hint
  news: cpu_map: Add Snowridge cpu model
  news: qemu: Add support for NFS disk protocol
  news: Support vhostuser in virsh attach-interface since v7.7.0
  news: Add queue_size option to virtio disk
  news: Validation flags for creating net, nwfilter-binding, net port

 NEWS.rst | 89 
 1 file changed, 89 insertions(+)

-- 
2.36.0



[PATCH 01/16] news: make SEV attrs 'cbitpos' & 'reducedPhysBits' optional

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 7903449f9b..b17d6f58ec 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1192,6 +1192,13 @@ v6.9.0 (2020-11-02)
 using . The node device APIs also now
 list and provide XML descriptions for vDPA devices.
 
+* **Improvements**
+
+  * qemu: Make 'cbitpos' & 'reducedPhysBits' attrs optional
+
+Libvirt probes the underlying platform in order to fill in these SEV
+attributes automatically before launching a guest.
+
 * **Bug fixes**
 
   * hyperv: ensure WQL queries work in all locales
-- 
2.36.0



[PATCH 11/16] news: qemu: support kvm-poll-control performance hint

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 3a19ac1d43..008601c0f5 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1137,6 +1137,11 @@ v6.10.0 (2020-12-01)
 mode of files and directories, respectively, when using accessmode=mapped.
 It requires QEMU 2.10 or above.
 
+  * qemu: support kvm-poll-control performance hint
+
+Implement the new KVM feature 'poll-control' to set this performance hint
+for KVM guests. It requires QEMU 4.2 or above.
+
 * **Improvements**
 
   * virsh: Support network disks in ``virsh attach-disk``
-- 
2.36.0



[PATCH 10/16] news: Introduce "migrate_tls_force" to qemu.conf

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 92cb7ea1de..3a19ac1d43 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1106,6 +1106,12 @@ v6.10.0 (2020-12-01)
   option is missing are now '1'. This ensures that only legitimate clients
   access servers, which don't have any additional form of authentication.
 
+  * qemu: Introduce "migrate_tls_force" to qemu.conf
+
+The ``migrate_tls_force`` configuration option allows administrators to
+always force migration connections to be TLS secured as if
+``VIR_MIGRATE_TLS`` flag was used.
+
 * **New features**
 
   * qemu: Implement OpenSSH authorized key file management APIs
-- 
2.36.0



[PATCH 14/16] news: Support vhostuser in virsh attach-interface since v7.7.0

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 34934b42f3..aa0eaa7d9a 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -541,6 +541,8 @@ v7.7.0 (2021-09-01)
   forbidden for older qemus which don't support the update API as the guest
   could still reboot and execute some instructions until it was terminated.
 
+  * virsh: Support vhostuser in attach-interface
+
 * **Bug fixes**
 
   * qemu: Open chardev logfile on behalf of QEMU
-- 
2.36.0



[PATCH 15/16] news: Add queue_size option to virtio disk

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index aa0eaa7d9a..f8c4b5d3f8 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -470,6 +470,9 @@ v7.8.0 (2021-10-01)
 active. This information can also be retrieved with the new virsh command
 ``nodedev-info``.
 
+  * qemu: Add attribute ``queue_size`` to set the queue size of virtio-blk
+
+Implement the queue-size from QEMU to adjust the virtio disk queue size.
 
 v7.7.0 (2021-09-01)
 ===
-- 
2.36.0



[PATCH 16/16] news: Validation flags for creating net, nwfilter-binding, net port

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 12 
 1 file changed, 12 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index f8c4b5d3f8..5bc1eda149 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -474,6 +474,18 @@ v7.8.0 (2021-10-01)
 
 Implement the queue-size from QEMU to adjust the virtio disk queue size.
 
+* **Improvements**
+
+  * api: Add XML validation for creating of: networkport, nwfilter-binding,
+network
+
+* Add flag ``VIR_NETWORK_PORT_CREATE_VALIDATE`` to validate network port
+  input xml of network-port creating.
+* Add flag ``VIR_NETWORK_CREATE_VALIDATE`` to validate network input xml of
+  network creating.
+* Add flag ``VIR_NWFILTER_BINDING_CREATE_VALIDATE`` to validate
+  nwfilter-binding input xml of nwfilter-binding creating.
+
 v7.7.0 (2021-09-01)
 ===
 
-- 
2.36.0



[PATCH 12/16] news: cpu_map: Add Snowridge cpu model

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 4 
 1 file changed, 4 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 008601c0f5..f27e8bb22d 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1016,6 +1016,10 @@ v7.0.0 (2021-01-15)
 powered off or undefined. Add per-TPM emulator option ``persistent_state``
 for keeping TPM state.
 
+  * cpu_map: Add Snowridge cpu model
+
+The cpu model Snowridge is supported since QEMU 4.1.
+
 * **Improvements**
 
   * qemu: Discourage users from polling ``virDomainGetBlockJobInfo`` for block
-- 
2.36.0



[PATCH 09/16] news: qemu: Add 'fmode' and 'dmode' options for 9pfs

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 879e2d5f61..92cb7ea1de 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1124,6 +1124,13 @@ v6.10.0 (2020-12-01)
 ``virDomainSetVcpus()``, and ``virDomainSetVcpusFlags()`` APIs have been
 implemented in the Hyper-V driver.
 
+  * qemu: Add 'fmode' and 'dmode' options for 9pfs
+
+Expose QEMU's 9pfs 'fmode' and 'dmode' options via attributes on the
+'filesystem' node in the domain XML. These options control the creation
+mode of files and directories, respectively, when using accessmode=mapped.
+It requires QEMU 2.10 or above.
+
 * **Improvements**
 
   * virsh: Support network disks in ``virsh attach-disk``
-- 
2.36.0



[PATCH 08/16] news: qemu: virtiofs can be used without NUMA nodes

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index e00e4e173d..879e2d5f61 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1233,6 +1233,11 @@ v6.9.0 (2020-11-02)
 avoid needless cost of host CPU cycles and improve the performance of the
 TAP devices.
 
+  * qemu: virtiofs can be used without NUMA nodes
+
+Virtiofs is supported for the VM without NUMA nodes but configured with
+shared memory.
+
 * **Bug fixes**
 
   * hyperv: ensure WQL queries work in all locales
-- 
2.36.0



[PATCH 07/16] news: qemu: Introduce virtio free page reporting feature

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index a474a25cba..e00e4e173d 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1204,6 +1204,13 @@ v6.9.0 (2020-11-02)
 virsh, use the option ``--validate`` for sub-commmand ``cpu-compare`` or
 ``hypervisor-cpu-compare``.
 
+  * qemu: Introduce virtio free page reporting feature
+
+Introduce the optional attribute ``free-page-reporting`` for virtio
+memballoon device. It enables/disables the ability of the QEMU virtio
+memory balloon to return unused pages back to the hypervisor. It is
+supported since ``QEMU 5.1``.
+
 * **Improvements**
 
   * qemu: Make 'cbitpos' & 'reducedPhysBits' attrs optional
-- 
2.36.0



[PATCH 06/16] news: qemu: Set noqueue qdisc for TAP devices

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 9be6888277..a474a25cba 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1220,6 +1220,12 @@ v6.9.0 (2020-11-02)
 
 Set ``max_len=0`` in ``virtlogd.conf`` to disable log rollover.
 
+  * qemu: Set noqueue qdisc for TAP devices
+
+Set noqueue instead of the former pfifo_fast queue to TAP devices. It will
+avoid needless cost of host CPU cycles and improve the performance of the
+TAP devices.
+
 * **Bug fixes**
 
   * hyperv: ensure WQL queries work in all locales
-- 
2.36.0



[PATCH 05/16] news: logging: allow max_len=0 to disable log rollover

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 4 
 1 file changed, 4 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 1d6447a324..9be6888277 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1216,6 +1216,10 @@ v6.9.0 (2020-11-02)
 For SR-IOV VF hostdev, now libvirt supports to retrieve device traffic
 stats via the API ``virDomainInterfaceStats`` or ``virsh domifstat``.
 
+  * logging: allow max_len=0 to disable log rollover
+
+Set ``max_len=0`` in ``virtlogd.conf`` to disable log rollover.
+
 * **Bug fixes**
 
   * hyperv: ensure WQL queries work in all locales
-- 
2.36.0



[PATCH 04/16] news: cpu: Support for XML validation in cpu comparison

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 8 
 1 file changed, 8 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 115114789d..1d6447a324 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1196,6 +1196,14 @@ v6.9.0 (2020-11-02)
 
 The EPYC-Rome is supported in QEMU since ``v5.0.0``.
 
+  * cpu: Add a flag for XML validation in cpu comparison
+
+For the APIs ``virConnectCompareCPU`` and
+``virConnectCompareHypervisorCPU``, the flag
+``VIR_CONNECT_COMPARE_CPU_VALIDATE_XML`` is added for XML validation. As 
for
+virsh, use the option ``--validate`` for sub-commmand ``cpu-compare`` or
+``hypervisor-cpu-compare``.
+
 * **Improvements**
 
   * qemu: Make 'cbitpos' & 'reducedPhysBits' attrs optional
-- 
2.36.0



[PATCH 02/16] news: support device stats collection for SR-IOV VF hostdev

2022-05-10 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index b17d6f58ec..68e89e0fc8 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1199,6 +1199,11 @@ v6.9.0 (2020-11-02)
 Libvirt probes the underlying platform in order to fill in these SEV
 attributes automatically before launching a guest.
 
+  * util: support device stats collection for SR-IOV VF hostdev
+
+For SR-IOV VF hostdev, now libvirt supports to retrieve device traffic
+stats via the API ``virDomainInterfaceStats`` or ``virsh domifstat``.
+
 * **Bug fixes**
 
   * hyperv: ensure WQL queries work in all locales
-- 
2.36.0



[PATCH] docs: apps: Add the app cockpit

2022-05-09 Thread Han Han
Signed-off-by: Han Han 
---
 docs/apps.rst | 4 
 1 file changed, 4 insertions(+)

diff --git a/docs/apps.rst b/docs/apps.rst
index a21e2249ea..d01ad33f37 100644
--- a/docs/apps.rst
+++ b/docs/apps.rst
@@ -331,6 +331,10 @@ Web applications
   Secrets
-  Create and launch VMs
-  Configure VMs with easy panels or go pro and edit the VM's XML
+`Cockpit <https://cockpit-project.org/>`__
+   Cockpit is a web-based graphical interface for servers. With
+   `cockpit-machines <https://github.com/cockpit-project/cockpit-machines>`__
+   it can create and manage virtual machines via libvirt.
 
 Other
 -
-- 
2.36.0



[PATCH 2/5] docs: formatdomain: Add the introduced versions of net rss attrs

2022-05-06 Thread Han Han
Signed-off-by: Han Han 
---
 docs/formatdomain.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 9be305f3e6..11ecb77c66 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -5295,7 +5295,7 @@ following attributes are available for the ``"virtio"`` 
NIC driver:
virtio and tap backends only. Virtio NIC will be launched with "rss"
property. For now "in-qemu" RSS is supported by libvirt.
QEMU may load eBPF RSS if it has CAP_SYS_ADMIN permissions, which is
-   not supported by default in libvirt.
+   not supported by default in libvirt. :since:`Since 8.3.0 and QEMU 5.1`
**In general you should leave this option alone, unless you are very certain
you know what you are doing. Proper RSS configuration depends from vcpu,
tap, and vhost settings.**
@@ -5305,6 +5305,7 @@ following attributes are available for the ``"virtio"`` 
NIC driver:
to VM will contain a hash of the packet in the virt header. Usually enabled
alongside with ``rss``. Without ``rss`` option, the hash report doesn't 
affect
steering itself but provides vnet header with a calculated hash.
+   :since:`Since 8.3.0 and QEMU 5.1`
**In general you should leave this option alone, unless you are very certain
you know what you are doing. Proper RSS configuration depends from vcpu,
tap, and vhost settings.**
-- 
2.35.1



[PATCH 0/5] Some docs updates

2022-05-06 Thread Han Han


Han Han (5):
  docs: apps: Add desktop app gnome-boxes
  docs: formatdomain: Add the introduced versions of net rss attrs
  news: Add news for rss and rss_hash_report attributes
  docs: drivers: Mention KVM/HVF in the link of qemu driver
  docs: drvqemu: Fix the syntax typo of Hypervisor.framework link

 NEWS.rst  | 5 +
 docs/apps.rst | 3 +++
 docs/drivers.rst  | 2 +-
 docs/drvqemu.rst  | 2 +-
 docs/formatdomain.rst | 3 ++-
 5 files changed, 12 insertions(+), 3 deletions(-)

-- 
2.35.1



[PATCH 4/5] docs: drivers: Mention KVM/HVF in the link of qemu driver

2022-05-06 Thread Han Han
Signed-off-by: Han Han 
---
 docs/drivers.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/drivers.rst b/docs/drivers.rst
index b6a426be6a..b9dccdf5d2 100644
--- a/docs/drivers.rst
+++ b/docs/drivers.rst
@@ -19,7 +19,7 @@ The hypervisor drivers currently supported by libvirt are:
 
 -  `LXC `__ - Linux Containers
 -  `OpenVZ `__
--  `QEMU `__
+-  `QEMU/KVM/HVF `__
 -  `Test `__ - Used for testing
 -  `VirtualBox `__
 -  `VMware ESX `__
-- 
2.35.1



[PATCH 5/5] docs: drvqemu: Fix the syntax typo of Hypervisor.framework link

2022-05-06 Thread Han Han
Signed-off-by: Han Han 
---
 docs/drvqemu.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/drvqemu.rst b/docs/drvqemu.rst
index 6368a91fb9..a7c1975ed6 100644
--- a/docs/drvqemu.rst
+++ b/docs/drvqemu.rst
@@ -20,7 +20,7 @@ Project Links
 
 -  The `KVM <https://www.linux-kvm.org/>`__ Linux hypervisor
 -  The `QEMU <https://wiki.qemu.org/Index.html>`__ emulator
--  
`Hypervisor.framework`<https://developer.apple.com/documentation/hypervisor>__` 
reference
+-  `Hypervisor.framework 
<https://developer.apple.com/documentation/hypervisor>`__ reference
 
 Deployment pre-requisites
 -
-- 
2.35.1



[PATCH 3/5] news: Add news for rss and rss_hash_report attributes

2022-05-06 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 7903449f9b..941a264e41 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -46,6 +46,11 @@ v8.3.0 (2022-05-02)
 
 This IOMMU device can be used with both Q35 and ARM virt guests.
 
+  * qemu: Introduce attributes rss and rss_hash_report for net interface
+
+They can enable in-qemu/ebpf RSS and in-qemu RSS hash report for virtio 
NIC.
+Require QEMU >= 5.1.
+
 v8.2.0 (2022-04-01)
 ===
 
-- 
2.35.1



[PATCH 1/5] docs: apps: Add desktop app gnome-boxes

2022-05-06 Thread Han Han
Signed-off-by: Han Han 
---
 docs/apps.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/docs/apps.rst b/docs/apps.rst
index a21e2249ea..536e9436b2 100644
--- a/docs/apps.rst
+++ b/docs/apps.rst
@@ -144,6 +144,9 @@ Desktop applications
 `qt-remote-viewer 
<https://f1ash.github.io/qt-virt-manager/#virtual-machines-viewer>`__
The Qt VNC/SPICE viewer for access to remote desktops or VMs.
 
+`gnome-boxes <https://help.gnome.org/users/gnome-boxes/stable/>`__
+   A gnome application to access virtual machines.
+
 Infrastructure as a Service (IaaS)
 --
 
-- 
2.35.1



[PATCH] checkpoint: Fix a typo of comments

2022-03-31 Thread Han Han
Signed-off-by: Han Han 
---
 src/libvirt-domain-checkpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libvirt-domain-checkpoint.c b/src/libvirt-domain-checkpoint.c
index e6ad4f4f5d..58ee26857d 100644
--- a/src/libvirt-domain-checkpoint.c
+++ b/src/libvirt-domain-checkpoint.c
@@ -248,7 +248,7 @@ virDomainCheckpointGetXMLDesc(virDomainCheckpointPtr 
checkpoint,
  * @checkpoints: pointer to variable to store the array containing checkpoint
  *   object, or NULL if the list is not required (just returns
  *   number of checkpoints)
- * @flags: bitwise-OR of supported virDomainCheckpoinListFlags
+ * @flags: bitwise-OR of supported virDomainCheckpointListFlags
  *
  * Collect the list of domain checkpoints for the given domain and allocate
  * an array to store those objects.
-- 
2.35.1



[PATCH] kbase: Fix the syntax of the snapshot link in index.rst

2022-03-25 Thread Han Han
Signed-off-by: Han Han 
---
 docs/kbase/index.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/kbase/index.rst b/docs/kbase/index.rst
index 77b23e96a8..860bfde71f 100644
--- a/docs/kbase/index.rst
+++ b/docs/kbase/index.rst
@@ -55,7 +55,7 @@ Usage
 `Memory devices `__
Memory devices and their use
 
-`Snapshots `
+`Snapshots `__
 Details about snapshotting a VM
 
 
-- 
2.35.1



[PATCH 2/2] docs: Mention the types of params in event callbacks

2022-01-18 Thread Han Han
Signed-off-by: Han Han 
---
 include/libvirt/libvirt-domain.h  | 14 +++---
 include/libvirt/libvirt-secret.h  |  2 +-
 include/libvirt/libvirt-storage.h |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 0647361952..4da1a63a14 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -3281,7 +3281,7 @@ typedef enum {
  * @conn: virConnect connection
  * @dom: The domain on which the event occurred
  * @event: The specific virDomainEventType which occurred
- * @detail: event specific detail information
+ * @detail: event specific detail information (virDomainEvent*DetailType)
  * @opaque: opaque user data
  *
  * A callback function to be registered, and called when a domain event occurs
@@ -3783,7 +3783,7 @@ typedef enum {
  * virConnectDomainEventWatchdogCallback:
  * @conn: connection object
  * @dom: domain on which the event occurred
- * @action: action that is to be taken due to watchdog firing
+ * @action: action that is to be taken due to watchdog firing 
(virDomainEventWatchdogAction)
  * @opaque: application specified data
  *
  * The callback signature to use when registering for an event of type
@@ -3817,7 +3817,7 @@ typedef enum {
  * @dom: domain on which the event occurred
  * @srcPath: The host file on which the IO error occurred
  * @devAlias: The guest device alias associated with the path
- * @action: action that is to be taken due to the IO error
+ * @action: action that is to be taken due to the IO error 
(virDomainEventIOErrorAction)
  * @opaque: application specified data
  *
  * The callback signature to use when registering for an event of type
@@ -3836,7 +3836,7 @@ typedef void 
(*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
  * @dom: domain on which the event occurred
  * @srcPath: The host file on which the IO error occurred
  * @devAlias: The guest device alias associated with the path
- * @action: action that is to be taken due to the IO error
+ * @action: action that is to be taken due to the IO error 
(virDomainEventIOErrorAction)
  * @reason: the cause of the IO error
  * @opaque: application specified data
  *
@@ -3940,7 +3940,7 @@ typedef virDomainEventGraphicsSubject 
*virDomainEventGraphicsSubjectPtr;
  * virConnectDomainEventGraphicsCallback:
  * @conn: connection object
  * @dom: domain on which the event occurred
- * @phase: the phase of the connection
+ * @phase: the phase of the connection (virDomainEventGraphicsPhase)
  * @local: the local server address
  * @remote: the remote client address
  * @authScheme: the authentication scheme activated
@@ -4072,7 +4072,7 @@ typedef enum {
  * @conn: connection object
  * @dom: domain on which the event occurred
  * @devAlias: device alias
- * @reason: why the tray status was changed?
+ * @reason: why the tray status was changed? (virDomainEventTrayChangeReason)
  * @opaque: application specified data
  *
  * This callback occurs when the tray of a removable device is moved.
@@ -4653,7 +4653,7 @@ typedef void 
(*virConnectDomainEventBlockThresholdCallback)(virConnectPtr conn,
  * (virDomainMemoryFailureRecipientType)
  * @action: the action of hardware memory failure
  *  (virDomainMemoryFailureActionType)
- * @flags: the flags of hardware memory failure
+ * @flags: the flags of hardware memory failure (virDomainMemoryFailureFlags)
  * @opaque: application specified data
  *
  * The callback occurs when the hypervisor handles the hardware memory
diff --git a/include/libvirt/libvirt-secret.h b/include/libvirt/libvirt-secret.h
index bc1286883c..d24c5e96a2 100644
--- a/include/libvirt/libvirt-secret.h
+++ b/include/libvirt/libvirt-secret.h
@@ -191,7 +191,7 @@ typedef enum {
  * @conn: connection object
  * @secret: secret on which the event occurred
  * @event: The specific virSecretEventLifecycleType which occurred
- * @detail: contains some details on the reason of the event.
+ * @detail: contains some details on the reason of the event. It will be 0 for 
the while.
  * @opaque: application specified data
  *
  * This callback is called when a secret lifecycle action is performed,
diff --git a/include/libvirt/libvirt-storage.h 
b/include/libvirt/libvirt-storage.h
index f8c665a18f..3431cb35e0 100644
--- a/include/libvirt/libvirt-storage.h
+++ b/include/libvirt/libvirt-storage.h
@@ -489,7 +489,7 @@ typedef enum {
  * @conn: connection object
  * @pool: pool on which the event occurred
  * @event: The specific virStoragePoolEventLifecycleType which occurred
- * @detail: contains some details on the reason of the event.
+ * @detail: contains some details on the reason of the event. It will be 0 for 
the while.
  * @opaque: application specified data
  *
  * This callback is called when a pool lifecycle action is performed, like 
start
-- 
2.34.1



[PATCH 1/2] docs: Fix typos in the code comment

2022-01-18 Thread Han Han
1. s/LifeCycle/Lifecycle/,
2. s/virConnectDomainEventTrayChangeReason/virDomainEventTrayChangeReason/

Signed-off-by: Han Han 
---
 include/libvirt/libvirt-domain.h  | 2 +-
 include/libvirt/libvirt-network.h | 2 +-
 include/libvirt/libvirt-nodedev.h | 2 +-
 include/libvirt/libvirt-secret.h  | 2 +-
 include/libvirt/libvirt-storage.h | 2 +-
 src/conf/domain_conf.h| 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 5f0a9b7572..0647361952 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -4054,7 +4054,7 @@ typedef void 
(*virConnectDomainEventDiskChangeCallback)(virConnectPtr conn,
 void *opaque);
 
 /**
- * virConnectDomainEventTrayChangeReason:
+ * virDomainEventTrayChangeReason:
  *
  * The reason describing why the callback was called
  */
diff --git a/include/libvirt/libvirt-network.h 
b/include/libvirt/libvirt-network.h
index 398d8fccd4..80bd03878b 100644
--- a/include/libvirt/libvirt-network.h
+++ b/include/libvirt/libvirt-network.h
@@ -262,7 +262,7 @@ typedef enum {
  * virConnectNetworkEventLifecycleCallback:
  * @conn: connection object
  * @net: network on which the event occurred
- * @event: The specific virNetworkEventLifeCycleType which occurred
+ * @event: The specific virNetworkEventLifecycleType which occurred
  * @detail: contains some details on the reason of the event.
  *  It will be 0 for the while.
  * @opaque: application specified data
diff --git a/include/libvirt/libvirt-nodedev.h 
b/include/libvirt/libvirt-nodedev.h
index 245365b07f..0c01d51aab 100644
--- a/include/libvirt/libvirt-nodedev.h
+++ b/include/libvirt/libvirt-nodedev.h
@@ -229,7 +229,7 @@ typedef enum {
  * virConnectNodeDeviceEventLifecycleCallback:
  * @conn: connection object
  * @dev: node device on which the event occurred
- * @event: The specific virNodeDeviceEventLifeCycleType which occurred
+ * @event: The specific virNodeDeviceEventLifecycleType which occurred
  * @detail: contains some details on the reason of the event.
  * @opaque: application specified data
  *
diff --git a/include/libvirt/libvirt-secret.h b/include/libvirt/libvirt-secret.h
index b8e53674d8..bc1286883c 100644
--- a/include/libvirt/libvirt-secret.h
+++ b/include/libvirt/libvirt-secret.h
@@ -190,7 +190,7 @@ typedef enum {
  * virConnectSecretEventLifecycleCallback:
  * @conn: connection object
  * @secret: secret on which the event occurred
- * @event: The specific virSecretEventLifeCycleType which occurred
+ * @event: The specific virSecretEventLifecycleType which occurred
  * @detail: contains some details on the reason of the event.
  * @opaque: application specified data
  *
diff --git a/include/libvirt/libvirt-storage.h 
b/include/libvirt/libvirt-storage.h
index f89856b93e..f8c665a18f 100644
--- a/include/libvirt/libvirt-storage.h
+++ b/include/libvirt/libvirt-storage.h
@@ -488,7 +488,7 @@ typedef enum {
  * virConnectStoragePoolEventLifecycleCallback:
  * @conn: connection object
  * @pool: pool on which the event occurred
- * @event: The specific virStoragePoolEventLifeCycleType which occurred
+ * @event: The specific virStoragePoolEventLifecycleType which occurred
  * @detail: contains some details on the reason of the event.
  * @opaque: application specified data
  *
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index e2f35fe20b..6b25a91d80 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2823,7 +2823,7 @@ struct _virDomainDef {
 virDomainResourceDef *resource;
 virDomainIdMapDef idmap;
 
-/* These 3 are based on virDomainLifeCycleAction enum flags */
+/* These 3 are based on virDomainLifecycleAction enum flags */
 int onReboot;
 int onPoweroff;
 int onCrash;
-- 
2.34.1



Re: [PATCH] docs: Use 'live' or 'lively' to describe the device events

2021-11-18 Thread Han Han
On Thu, Nov 18, 2021 at 6:35 PM Daniel P. Berrangé 
wrote:

> On Thu, Nov 18, 2021 at 10:12:06AM +0800, Han Han wrote:
> > The event of device added or removed only happens at live attachment or
> > detachment. Make the comments more explicit.
> >
> > Signed-off-by: Han Han 
> > ---
> >  include/libvirt/libvirt-domain.h | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/include/libvirt/libvirt-domain.h
> b/include/libvirt/libvirt-domain.h
> > index 2f017c5b68..25ee06d0d6 100644
> > --- a/include/libvirt/libvirt-domain.h
> > +++ b/include/libvirt/libvirt-domain.h
> > @@ -4148,7 +4148,7 @@ typedef void
> (*virConnectDomainEventPMSuspendDiskCallback)(virConnectPtr conn,
> >   * @devAlias: device alias
> >   * @opaque: application specified data
> >   *
> > - * This callback occurs when a device is removed from the domain.
> > + * This callback occurs when a device is lively removed from the domain.
>
> Good idea to improve it, but "lively" feels a bit akward, how
> about we phase it as:
>
Here I aimed to use 'lively' to describe the action of detaching.
For the "running domain", I think it is not so accurate:
A device removal could also be done by `virsh detach-device VM XML
--config` with the running VM. However, that will not cause the
'device-removed' event.

>
>"...a device is removed from a running domain"
>
>
> >   *
> >   * The callback signature to use when registering for an event of type
> >   * VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED with
> virConnectDomainEventRegisterAny()
> > @@ -4165,7 +4165,7 @@ typedef void
> (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn,
> >   * @devAlias: device alias
> >   * @opaque: application specified data
> >   *
> > - * This callback occurs when a device is added to the domain.
> > + * This callback occurs when a device is lively added to the domain.
> >   *
> >   * The callback signature to use when registering for an event of type
> >   * VIR_DOMAIN_EVENT_ID_DEVICE_ADDED with
> virConnectDomainEventRegisterAny()
> > @@ -4183,7 +4183,7 @@ typedef void
> (*virConnectDomainEventDeviceAddedCallback)(virConnectPtr conn,
> >   * @devAlias: device alias
> >   * @opaque: application specified data
> >   *
> > - * This callback occurs when it's certain that removal of a device
> failed.
> > + * This callback occurs when it's certain that live removal of a device
> failed.
> >   *
> >   * The callback signature to use when registering for an event of type
> >   * VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED with
> > --
> > 2.33.1
> >
>
> Regards,
> Daniel
> --
> |: https://berrange.com  -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org-o-
> https://www.instagram.com/dberrange :|
>
>


[PATCH] docs: Use 'live' or 'lively' to describe the device events

2021-11-17 Thread Han Han
The event of device added or removed only happens at live attachment or
detachment. Make the comments more explicit.

Signed-off-by: Han Han 
---
 include/libvirt/libvirt-domain.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 2f017c5b68..25ee06d0d6 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -4148,7 +4148,7 @@ typedef void 
(*virConnectDomainEventPMSuspendDiskCallback)(virConnectPtr conn,
  * @devAlias: device alias
  * @opaque: application specified data
  *
- * This callback occurs when a device is removed from the domain.
+ * This callback occurs when a device is lively removed from the domain.
  *
  * The callback signature to use when registering for an event of type
  * VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED with virConnectDomainEventRegisterAny()
@@ -4165,7 +4165,7 @@ typedef void 
(*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn,
  * @devAlias: device alias
  * @opaque: application specified data
  *
- * This callback occurs when a device is added to the domain.
+ * This callback occurs when a device is lively added to the domain.
  *
  * The callback signature to use when registering for an event of type
  * VIR_DOMAIN_EVENT_ID_DEVICE_ADDED with virConnectDomainEventRegisterAny()
@@ -4183,7 +4183,7 @@ typedef void 
(*virConnectDomainEventDeviceAddedCallback)(virConnectPtr conn,
  * @devAlias: device alias
  * @opaque: application specified data
  *
- * This callback occurs when it's certain that removal of a device failed.
+ * This callback occurs when it's certain that live removal of a device failed.
  *
  * The callback signature to use when registering for an event of type
  * VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED with
-- 
2.33.1



Re: [PATCH] virt-xml-validate: Add support for cpu and domaincheckpoint

2021-11-12 Thread Han Han
On Fri, Nov 12, 2021 at 11:09 PM Ján Tomko  wrote:

> On a Friday in 2021, Han Han wrote:
> >Signed-off-by: Han Han 
> >---
> > tools/virt-xml-validate.in | 6 ++
> > 1 file changed, 6 insertions(+)
> >
>
> These are described in:
> docs/manpages/virt-xml-validate.rst
>
> And it looks like we have more RNG schemas that we forgot to add to
> virt-xml-validate:
>
> domainbackup
> domaincaps
> networkport
> storagepoolcaps
>
> Good advice. I'll update it in v2

> Jano
>


[PATCH] virt-xml-validate: Add support for cpu and domaincheckpoint

2021-11-12 Thread Han Han
Signed-off-by: Han Han 
---
 tools/virt-xml-validate.in | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in
index 249bcf7eef..a818e2c3a5 100644
--- a/tools/virt-xml-validate.in
+++ b/tools/virt-xml-validate.in
@@ -77,6 +77,9 @@ if [ -z "$TYPE" ]; then
  *domainsnapshot*) # Must come first, since *domain* is a substring
 TYPE="domainsnapshot"
 ;;
+ *domaincheckpoint*)
+TYPE="domaincheckpoint"
+;;
  *domain*)
 TYPE="domain"
 ;;
@@ -110,6 +113,9 @@ if [ -z "$TYPE" ]; then
  *interface*)
 TYPE="interface"
 ;;
+ *cpu*)
+TYPE="cpu"
+;;
  *)
echo "$0: cannot determine schema type for $XMLFILE" >&2
exit 3
-- 
2.33.1



[PATCH] news: Support vhostuser in virsh attach-interface since v7.7.0

2021-10-29 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 5f1cf19940..694c506cad 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -162,6 +162,8 @@ v7.7.0 (2021-09-01)
   forbidden for older qemus which don't support the update API as the guest
   could still reboot and execute some instructions until it was terminated.
 
+  * virsh: Support vhostuser in attach-interface
+
 * **Bug fixes**
 
   * qemu: Open chardev logfile on behalf of QEMU
-- 
2.33.1



[PATCH 3/3] news: Add validation flags for creating of net, nwfilter-binding, net port

2021-10-29 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 12 
 1 file changed, 12 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index cb1234e891..7815f1100f 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -96,6 +96,18 @@ v7.8.0 (2021-10-01)
 
 Implement the queue-size from QEMU to adjust the virtio disk queue size.
 
+* **Improvements**
+
+  * api: Add XML validation for creating of: networkport, nwfilter-binding,
+network
+
+* Add flag ``VIR_NETWORK_PORT_CREATE_VALIDATE`` to validate network port
+  input xml of network-port creating.
+* Add flag ``VIR_NETWORK_CREATE_VALIDATE`` to validate network input xml of
+  network creating.
+* Add flag ``VIR_NWFILTER_BINDING_CREATE_VALIDATE`` to validate
+  nwfilter-binding input xml of nwfilter-binding creating.
+
 v7.7.0 (2021-09-01)
 ===
 
-- 
2.33.1



[PATCH 2/3] news: Add queue_size option to virtio disk

2021-10-29 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 4 
 1 file changed, 4 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 5f1cf19940..cb1234e891 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -92,6 +92,10 @@ v7.8.0 (2021-10-01)
 active. This information can also be retrieved with the new virsh command
 ``nodedev-info``.
 
+  * qemu: Add attribute ``queue_size`` to set the queue size of virtio-blk
+
+Implement the queue-size from QEMU to adjust the virtio disk queue size.
+
 v7.7.0 (2021-09-01)
 ===
 
-- 
2.33.1



[PATCH 1/3] docs: Mention QEMU version requirement for queue-size

2021-10-29 Thread Han Han
Signed-off-by: Han Han 
---
 docs/formatdomain.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 58768f7e5e..dbda54dc93 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -3086,7 +3086,7 @@ paravirtualized driver is specified via the ``disk`` 
element.
-  The optional ``queues`` attribute specifies the number of virt queues for
   virtio-blk. ( :since:`Since 3.9.0` )
-  The optional ``queue_size`` attribute specifies the size of each virt
-  queue for virtio-blk. ( :since:`Since 7.8.0` )
+  queue for virtio-blk. ( :since:`Since 7.8.0, requires QEMU 2.12` )
-  For virtio disks, `Virtio-specific options <#elementsVirtio>`__ can also
   be set. ( :since:`Since 3.5.0` )
-  The optional ``metadata_cache`` subelement controls aspects related to 
the
-- 
2.33.1



[PATCH 0/3] Docs and news update for v7.8.0

2021-10-29 Thread Han Han


Han Han (3):
  docs: Mention QEMU version requirement for queue-size
  news: Add queue_size option to virtio disk
  news: Add validation flags for creating of net, nwfilter-binding, net
port

 NEWS.rst  | 16 
 docs/formatdomain.rst |  2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)

-- 
2.33.1



[PATCH 4/4] news: Add support for librbd encryption

2021-10-28 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 177e3dfd8f..6401713fa6 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -64,6 +64,11 @@ v7.9.0 (unreleased)
 notification capabilities exposed to the guest. It is recommended for the
 vDPA devices.
 
+  * qemu: Support librbd encryption
+
+Add an encryption engine ``librbd``. It will provides the image-level
+encryption of librbd. It requires QEMU >= 6.1.0 and librbd >= 16.1.0.
+
 * **Improvements**
 
   * Use of JSON syntax with ``-device`` with upcoming QEMU-6.2
-- 
2.33.1



[PATCH 3/4] docs: Make the version requirement more clear for rbd encryption

2021-10-28 Thread Han Han
Signed-off-by: Han Han 
---
 docs/formatstorageencryption.html.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/docs/formatstorageencryption.html.in 
b/docs/formatstorageencryption.html.in
index 86d884f93d..66bf95ab0b 100644
--- a/docs/formatstorageencryption.html.in
+++ b/docs/formatstorageencryption.html.in
@@ -30,8 +30,9 @@
   qemu and librbd.
   Both qemu and librbd require using the qemu
   driver.
-  The librbd engine requires qemu version >= 6.1.0,
-  and is only applicable for RBD network disks.
+  The librbd engine requires qemu version >= 6.1.0, both
+  ceph cluster and librbd1 >= 16.1.0, and is only applicable for RBD
+  network disks.
   If the engine tag is not specified, the qemu engine will be
   used by default (assuming the qemu driver is used).
   Note that librbd engine is currently only supported by the
-- 
2.33.1



[PATCH 2/4] news: News for the new virtio attribute page_per_vq

2021-10-28 Thread Han Han
Signed-off-by: Han Han 
---
 NEWS.rst | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/NEWS.rst b/NEWS.rst
index 5a7570d0db..177e3dfd8f 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -58,6 +58,12 @@ v7.9.0 (unreleased)
 called "vpd" is introduced holding string resources and keyword resources
 found in PCI VPD.
 
+  * qemu: Support page_per_vq for driver element
+
+This optional virtio attribute ``page_per_vq`` controls the layout of the
+notification capabilities exposed to the guest. It is recommended for the
+vDPA devices.
+
 * **Improvements**
 
   * Use of JSON syntax with ``-device`` with upcoming QEMU-6.2
-- 
2.33.1



[PATCH 0/4] Some news and docs update for v7.9.0

2021-10-28 Thread Han Han


Han Han (4):
  docs: Fix a typo of page_per_vq
  news: News for the new virtio attribute page_per_vq
  docs: Make the version requirement more clear for rbd encryption
  news: Add support for librbd encryption

 NEWS.rst | 11 +++
 docs/formatdomain.rst|  2 +-
 docs/formatstorageencryption.html.in |  5 +++--
 3 files changed, 15 insertions(+), 3 deletions(-)

-- 
2.33.1



[PATCH 1/4] docs: Fix a typo of page_per_vq

2021-10-28 Thread Han Han
The page_per_vq is added since v7.9.0 not v7.8.0.

Signed-off-by: Han Han 
---
 docs/formatdomain.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 58768f7e5e..b500d35f5b 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -3553,7 +3553,7 @@ capabilities exposed to the guest. When enabled, each 
virtio queue will have a
 dedicated page on the device BAR exposed to the guest. It is recommended to be
 used when vDPA is enabled on the hypervisor, as it enables mapping the
 notification area to the physical device, which is only supported in page
-granularity. The default is determined by QEMU. :since:`Since 7.8.0 (QEMU 2.8)`
+granularity. The default is determined by QEMU. :since:`Since 7.9.0 (QEMU 2.8)`
 Note: In general you should leave this option alone, unless you are very 
certain
 you know what you are doing.
 
-- 
2.33.1



Re: [PATCH v5 0/5] Add support for librbd encryption

2021-10-27 Thread Han Han
Hi Or,
I have a question about this feature. For rbd encryption in ceph, is it
introduced from ceph-v16.2.0?
Does it require the ceph cluster side >= this version?

On Sun, Oct 24, 2021 at 5:54 PM Or Ozeri  wrote:

> v5: rebased + nit fixes suggested by Peter
> v4:
>  - added disk post parse to image creation flow in qemublocktest (since
> more tests failed after adding engine validation)
>  - removed symlink changes
>  - added luks2 and engine documentation
>  - switched to using enum engine instead of int
>  - added validation for encryption engine and formats
> v3: rebased on master
> v2: addressed (hopefully) all of Peter's v1 comments (thanks Peter!)
>
> Feel free to make any other changes before pushing. Thanks!
>
> Or Ozeri (5):
>   qemu: add disk post parse to qemublocktest
>   qemu: capablities: Detect presence of 'rbd-encryption' as
> QEMU_CAPS_RBD_ENCRYPTION
>   conf: add encryption engine property
>   qemu: add librbd encryption engine
>   conf: add luks2 encryption format
>
>  docs/formatstorageencryption.html.in  | 29 ++-
>  docs/schemas/domainbackup.rng |  7 ++
>  docs/schemas/storagecommon.rng|  9 ++
>  src/conf/storage_encryption_conf.c| 28 ++-
>  src/conf/storage_encryption_conf.h| 11 +++
>  src/qemu/qemu_block.c | 41 +
>  src/qemu/qemu_capabilities.c  |  2 +
>  src/qemu/qemu_capabilities.h  |  1 +
>  src/qemu/qemu_domain.c| 69 ++-
>  src/qemu/qemu_domain.h|  3 +
>  tests/qemublocktest.c | 29 +++
>  .../caps_6.1.0.x86_64.xml |  1 +
>  .../caps_6.2.0.x86_64.xml |  1 +
>  tests/qemustatusxml2xmldata/upgrade-out.xml   |  6 +-
>  ...sk-network-rbd-encryption.x86_64-6.0.0.err |  1 +
>  ...-network-rbd-encryption.x86_64-latest.args | 49 +++
>  .../disk-network-rbd-encryption.xml   | 75 +
>  tests/qemuxml2argvdata/disk-nvme.xml  |  2 +-
>  .../qemuxml2argvdata/encrypted-disk-usage.xml |  2 +-
>  tests/qemuxml2argvdata/luks-disks.xml |  4 +-
>  tests/qemuxml2argvdata/user-aliases.xml   |  2 +-
>  tests/qemuxml2argvtest.c  |  2 +
>  ...k-network-rbd-encryption.x86_64-latest.xml | 83 +++
>  .../disk-slices.x86_64-latest.xml |  4 +-
>  tests/qemuxml2xmloutdata/encrypted-disk.xml   |  2 +-
>  .../luks-disks-source-qcow2.x86_64-latest.xml | 14 ++--
>  .../qemuxml2xmloutdata/luks-disks-source.xml  | 10 +--
>  tests/qemuxml2xmltest.c   |  1 +
>  28 files changed, 443 insertions(+), 45 deletions(-)
>  create mode 100644
> tests/qemuxml2argvdata/disk-network-rbd-encryption.x86_64-6.0.0.err
>  create mode 100644
> tests/qemuxml2argvdata/disk-network-rbd-encryption.x86_64-latest.args
>  create mode 100644 tests/qemuxml2argvdata/disk-network-rbd-encryption.xml
>  create mode 100644
> tests/qemuxml2xmloutdata/disk-network-rbd-encryption.x86_64-latest.xml
>
> --
> 2.25.1
>
>


[PATCH] virsh: Fix ambiguous output in metadata-change event

2021-10-27 Thread Han Han
When you set metadata with type element like the following:
dom.setMetadata(libvirt.VIR_DOMAIN_METADATA_ELEMENT, "", 'abc', "HAHAH", 
0)

Then for `virsh event --all`, then it will output this message:
event 'metadata-change' for domain 'rhel9': element HAHAH

The message is ambiguous since it looks like the params for
metadata-change event is the element HAHAH. Actually that means the type is
element while the url is HAHAH. Let's make it more clear.

Signed-off-by: Han Han 
---
 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 7f3356a536..d454075dfc 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -13317,7 +13317,7 @@ virshEventMetadataChangePrint(virConnectPtr conn 
G_GNUC_UNUSED,
 {
 g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
 
-virBufferAsprintf(, _("event 'metadata-change' for domain '%s': %s 
%s\n"),
+virBufferAsprintf(, _("event 'metadata-change' for domain '%s': type 
%s, uri %s\n"),
   virDomainGetName(dom),
   
UNKNOWNSTR(virshEventMetadataChangeTypeTypeToString(type)),
   NULLSTR(nsuri));
-- 
2.33.1



The exact meaning of DEVICE_REMOVED event

2021-10-26 Thread Han Han
Hi, developers
I has a question about the event VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED. When
will it occur? Detach device from an active VM? Or an inactive VM? Or both?
I get a code comment from the callback of this event
https://gitlab.com/libvirt/libvirt/-/blob/master/include/libvirt/libvirt-domain.h#L4151
"This callback occurs when a device is removed from the domain"

But it is not clear the domain could be active or inactive or both.


Re: [PATCH v2 1/3] qemu_capabilities: Add flag QEMU_CAPS_VIRTIO_PAGE_PER_VQ

2021-10-15 Thread Han Han
On Thu, Oct 14, 2021 at 5:53 PM Michal Prívozník 
wrote:

> On 10/11/21 2:54 AM, Han Han wrote:
> >
> >
> > On Mon, Oct 11, 2021 at 3:50 AM Peter Krempa  > <mailto:pkre...@redhat.com>> wrote:
> >
> >     On Sat, Oct 09, 2021 at 17:37:42 +0800, Han Han wrote:
> > > The qemu capability will be used for the page_per_vq option of
> virtio
> > > devices.
> > >
> > > Signed-off-by: Han Han mailto:h...@redhat.com>>
> > > ---
> > >  src/qemu/qemu_capabilities.c   | 6 ++
> > >  src/qemu/qemu_capabilities.h   | 1 +
> > >  tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   | 1 +
> > >  tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml  | 1 +
> >
> > NACK,
> >
> > OK. BTW, where to check the least version of qemu that libvirt supports?
>
> libvirt.git $ grep QEMU_MIN src/qemu/qemu_capabilities.c
> #define QEMU_MIN_MAJOR 2
> #define QEMU_MIN_MINOR 11
> #define QEMU_MIN_MICRO 0
>
>
> So can you please post v3 and fix also the signed-off we've talked about
> earlier? Thanks.
>
OK. v3:
https://listman.redhat.com/archives/libvir-list/2021-October/msg00666.html

>
> Michal
>
>


[PATCH v3 1/2] conf: Add page_per_vq for driver element

2021-10-15 Thread Han Han
Signed-off-by: Han Han 
Signed-off-by: Gavi Teitz 
---
 docs/formatdomain.rst |  9 +
 docs/schemas/domaincommon.rng |  5 +
 src/conf/domain_conf.c| 16 
 src/conf/domain_conf.h|  1 +
 src/conf/domain_validate.c|  6 ++
 5 files changed, 37 insertions(+)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 80aaf4b033..9bf59936e5 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -3577,6 +3577,15 @@ virtqueues are actually used depends on the feature 
negotiation between QEMU,
 vhost backends and guest drivers. Possible values are ``on`` or ``off``.
 :since:`Since 6.3.0 (QEMU and KVM only)`
 
+This optional attribute ``page_per_vq`` controls the layout of the notification
+capabilities exposed to the guest. When enabled, each virtio queue will have a
+dedicated page on the device BAR exposed to the guest. It is recommended to be
+used when vDPA is enabled on the hypervisor, as it enables mapping the
+notification area to the physical device, which is only supported in page
+granularity. The default is determined by QEMU. :since:`Since 7.8.0 (QEMU 2.8)`
+Note: In general you should leave this option alone, unless you are very 
certain
+you know what you are doing.
+
 :anchor:``
 
 Virtio transitional devices
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 6f33d1e774..26990c4d6d 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -6825,6 +6825,11 @@
 
   
 
+
+  
+
+  
+
   
 
   
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 818c177e72..6fcf86ba58 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1636,6 +1636,10 @@ virDomainVirtioOptionsParseXML(xmlNodePtr driver,
  &(*virtio)->packed) < 0)
 return -1;
 
+if (virXMLPropTristateSwitch(driver, "page_per_vq", VIR_XML_PROP_NONE,
+ &(*virtio)->page_per_vq) < 0)
+return -1;
+
 return 0;
 }
 
@@ -6321,6 +6325,10 @@ virDomainVirtioOptionsFormat(virBuffer *buf,
 virBufferAsprintf(buf, " packed='%s'",
   virTristateSwitchTypeToString(virtio->packed));
 }
+if (virtio->page_per_vq != VIR_TRISTATE_SWITCH_ABSENT) {
+virBufferAsprintf(buf, " page_per_vq='%s'",
+  virTristateSwitchTypeToString(virtio->page_per_vq));
+}
 }
 
 
@@ -20816,6 +20824,14 @@ 
virDomainVirtioOptionsCheckABIStability(virDomainVirtioOptions *src,
virTristateSwitchTypeToString(src->packed));
 return false;
 }
+if (src->page_per_vq != dst->page_per_vq) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+   _("Target device page_per_vq option '%s' does not "
+ "match source '%s'"),
+   virTristateSwitchTypeToString(dst->page_per_vq),
+   virTristateSwitchTypeToString(src->page_per_vq));
+return false;
+}
 return true;
 }
 
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index e9a9298d86..1ac802feca 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2740,6 +2740,7 @@ struct _virDomainVirtioOptions {
 virTristateSwitch iommu;
 virTristateSwitch ats;
 virTristateSwitch packed;
+virTristateSwitch page_per_vq;
 };
 
 
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index f023d22f23..80401cf8c7 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -135,6 +135,12 @@ 
virDomainCheckVirtioOptionsAreAbsent(virDomainVirtioOptions *virtio)
  "for virtio devices"));
 return -1;
 }
+
+if (virtio->page_per_vq != VIR_TRISTATE_SWITCH_ABSENT) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+   _("page_per_vq option is only supported for virtio 
devices"));
+return -1;
+}
 return 0;
 }
 
-- 
2.31.1



[PATCH v3 2/2] qemu: Add support for virtio device option page-per-vq

2021-10-15 Thread Han Han
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1925363

Signed-off-by: Han Han 
---
 src/qemu/qemu_command.c   |  1 +
 src/qemu/qemu_hotplug.c   |  3 ++-
 src/qemu/qemu_validate.c  |  1 +
 .../virtio-options.x86_64-latest.args | 24 -
 tests/qemuxml2argvdata/virtio-options.xml | 26 +--
 5 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3b2f88bcb9..dba877a740 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1122,6 +1122,7 @@ qemuBuildVirtioDevProps(virDomainDeviceType devtype,
   "T:iommu_platform", virtioOptions->iommu,
   "T:ats", virtioOptions->ats,
   "T:packed", virtioOptions->packed,
+  "T:page-per-vq", virtioOptions->page_per_vq,
   NULL) < 0)
 return NULL;
 }
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index af49e58f8e..a7b432b6f5 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3797,7 +3797,8 @@ qemuDomainChangeNet(virQEMUDriver *driver,
 (olddev->virtio && newdev->virtio &&
  (olddev->virtio->iommu != newdev->virtio->iommu ||
   olddev->virtio->ats != newdev->virtio->ats ||
-  olddev->virtio->packed != newdev->virtio->packed))) {
+  olddev->virtio->packed != newdev->virtio->packed ||
+  olddev->virtio->page_per_vq != newdev->virtio->page_per_vq))) {
 virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify virtio network device driver 
options"));
goto cleanup;
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 75dc9edb7d..4a82b512d1 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1592,6 +1592,7 @@ qemuValidateDomainVirtioOptions(const 
virDomainVirtioOptions *virtio,
  "QEMU binary"));
 return -1;
 }
+
 return 0;
 }
 
diff --git a/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args 
b/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args
index d6dcbdd90f..6a55134ee8 100644
--- a/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args
@@ -27,26 +27,26 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -no-acpi \
 -boot strict=on \
 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
--device 
virtio-scsi-pci,iommu_platform=on,ats=on,packed=on,id=scsi0,bus=pci.0,addr=0x8 \
--device 
virtio-serial-pci,iommu_platform=on,ats=on,packed=on,id=virtio-serial0,bus=pci.0,addr=0x9
 \
+-device 
virtio-scsi-pci,iommu_platform=on,ats=on,packed=on,page-per-vq=on,id=scsi0,bus=pci.0,addr=0x8
 \
+-device 
virtio-serial-pci,iommu_platform=on,ats=on,packed=on,page-per-vq=on,id=virtio-serial0,bus=pci.0,addr=0x9
 \
 -blockdev 
'{"driver":"file","filename":"/var/lib/libvirt/images/img1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
 \
 -blockdev 
'{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}'
 \
--device 
virtio-blk-pci,iommu_platform=on,ats=on,packed=on,bus=pci.0,addr=0xa,drive=libvirt-1-format,id=virtio-disk0,bootindex=1
 \
+-device 
virtio-blk-pci,iommu_platform=on,ats=on,packed=on,page-per-vq=on,bus=pci.0,addr=0xa,drive=libvirt-1-format,id=virtio-disk0,bootindex=1
 \
 -fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \
--device 
virtio-9p-pci,iommu_platform=on,ats=on,packed=on,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.0,addr=0x3
 \
+-device 
virtio-9p-pci,iommu_platform=on,ats=on,packed=on,page-per-vq=on,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.0,addr=0x3
 \
 -fsdev 
local,security_model=mapped,writeout=immediate,id=fsdev-fs1,path=/export/fs2 \
--device 
virtio-9p-pci,iommu_platform=on,ats=on,packed=on,id=fs1,fsdev=fsdev-fs1,mount_tag=fs2,bus=pci.0,addr=0x4
 \
+-device 
virtio-9p-pci,iommu_platform=on,ats=on,packed=on,page-per-vq=on,id=fs1,fsdev=fsdev-fs1,mount_tag=fs2,bus=pci.0,addr=0x4
 \
 -netdev user,id=hostnet0 \
--device 
virtio-net-pci,iommu_platform=on,ats=on,packed=on,netdev=hostnet0,id=net0,mac=52:54:56:58:5a:5c,bus=pci.0,addr=0x6
 \
--device 
virtio-mouse-pci,iommu_platform=on,ats=on,packed=on,id=input0,bus=pci.0,addr=0xe
 \
--device 
virtio-keyboard-pci,iommu_platform=on,ats=on,packed=on,id=input1,bus=pci.0,addr=0x10
 \
--device 
virtio-tablet-pci,iommu_platform=on,ats=on,packed=on,id

[PATCH v3 0/2] Implement paeg-per-vq to virtio devices

2021-10-15 Thread Han Han
Diff from v2:
- Remove the code of qemu capabilities since the least supported QEMU
  version is over the version introducing paeg-per-vq.
- Rebase to latest upstream

v2: https://listman.redhat.com/archives/libvir-list/2021-October/msg00489.html

Han Han (2):
  conf: Add page_per_vq for driver element
  qemu: Add support for virtio device option page-per-vq

 docs/formatdomain.rst |  9 +++
 docs/schemas/domaincommon.rng |  5 
 src/conf/domain_conf.c| 16 
 src/conf/domain_conf.h|  1 +
 src/conf/domain_validate.c|  6 +
 src/qemu/qemu_command.c   |  1 +
 src/qemu/qemu_hotplug.c   |  3 ++-
 src/qemu/qemu_validate.c  |  1 +
 .../virtio-options.x86_64-latest.args | 24 -
 tests/qemuxml2argvdata/virtio-options.xml | 26 +--
 10 files changed, 66 insertions(+), 26 deletions(-)

-- 
2.31.1



Re: [PATCH v2 1/3] qemu_capabilities: Add flag QEMU_CAPS_VIRTIO_PAGE_PER_VQ

2021-10-10 Thread Han Han
On Mon, Oct 11, 2021 at 3:50 AM Peter Krempa  wrote:

> On Sat, Oct 09, 2021 at 17:37:42 +0800, Han Han wrote:
> > The qemu capability will be used for the page_per_vq option of virtio
> > devices.
> >
> > Signed-off-by: Han Han 
> > ---
> >  src/qemu/qemu_capabilities.c   | 6 ++
> >  src/qemu/qemu_capabilities.h   | 1 +
> >  tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   | 1 +
> >  tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml  | 1 +
>
> NACK,
>
> OK. BTW, where to check the least version of qemu that libvirt supports?

> the capability is apparently supported with the oldest qemu libvirt
> supports so there's no point adding it.
>
>


Re: [PATCH 3/3] qemu: Add support for virtio device option paeg-per-vq

2021-10-09 Thread Han Han
On Thu, Sep 9, 2021 at 7:43 PM Michal Prívozník  wrote:

> On 9/6/21 4:06 PM, Han Han wrote:
> > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1925363
> >
> > Signed-off-by: Han Han 
> > ---
> >  src/qemu/qemu_command.c   |  4 ++
> >  src/qemu/qemu_hotplug.c   |  3 +-
> >  src/qemu/qemu_validate.c  |  8 
> >  .../virtio-options-controller-page_per_vq.err |  1 +
> >  ...-controller-page_per_vq.x86_64-latest.args | 37 ++
> >  .../virtio-options-controller-page_per_vq.xml | 38 ++
> >  .../virtio-options-disk-page_per_vq.err   |  1 +
> >  ...ptions-disk-page_per_vq.x86_64-latest.args | 39 +++
> >  .../virtio-options-disk-page_per_vq.xml   | 34 
> >  .../virtio-options-fs-page_per_vq.err |  1 +
> >  ...-options-fs-page_per_vq.x86_64-latest.args | 37 ++
> >  .../virtio-options-fs-page_per_vq.xml | 34 
> >  .../virtio-options-input-page_per_vq.err  |  1 +
> >  ...tions-input-page_per_vq.x86_64-latest.args | 35 +
> >  .../virtio-options-input-page_per_vq.xml  | 30 ++
> >  .../virtio-options-memballoon-page_per_vq.err |  1 +
> >  ...-memballoon-page_per_vq.x86_64-latest.args | 33 
> >  .../virtio-options-memballoon-page_per_vq.xml | 23 +++
> >  .../virtio-options-net-page_per_vq.err|  1 +
> >  ...options-net-page_per_vq.x86_64-latest.args | 37 ++
> >  .../virtio-options-net-page_per_vq.xml| 34 
> >  .../virtio-options-rng-page_per_vq.err|  1 +
> >  ...options-rng-page_per_vq.x86_64-latest.args | 37 ++
> >  .../virtio-options-rng-page_per_vq.xml| 32 +++
> >  .../virtio-options-video-page_per_vq.err  |  1 +
> >  ...tions-video-page_per_vq.x86_64-latest.args | 37 ++
> >  .../virtio-options-video-page_per_vq.xml  | 36 +
> >  .../virtio-options.x86_64-latest.args | 26 ++---
> >  tests/qemuxml2argvdata/virtio-options.xml | 26 ++---
> >  tests/qemuxml2argvtest.c  | 22 +++
> >  30 files changed, 623 insertions(+), 27 deletions(-)
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.err
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.x86_64-latest.args
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.xml
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.err
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.x86_64-latest.args
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.xml
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.err
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.x86_64-latest.args
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.xml
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-input-page_per_vq.err
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-input-page_per_vq.x86_64-latest.args
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-input-page_per_vq.xml
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.err
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.x86_64-latest.args
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.xml
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-net-page_per_vq.err
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-net-page_per_vq.x86_64-latest.args
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-net-page_per_vq.xml
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.err
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.x86_64-latest.args
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.xml
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-video-page_per_vq.err
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-video-page_per_vq.x86_64-latest.args
> >  create mode 100644
> tests/qemuxml2argvdata/virtio-options-video-page_per_vq.xml
>
> Wow, that's a lot of test cases. Do we need all of them?
>
> >
> >

  1   2   3   4   5   6   >