[libvirt] [PATCH v3 0/3] Update valid range of scsi unit

Fix spelling typo. Separate virtio serial port and ccid slot from driveUnit. v2: https://www.redhat.com/archives/libvir-list/2019-December/msg00004.html Han Han (3): conf: fix logic error for scsi units rng: Separate virtio serial port and ccid slot from driveUnit rng: Extend the range of driveUnit docs/schemas/domaincommon.rng | 16 +++++++++++++--- src/conf/domain_conf.c | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) -- 2.24.0.rc1

Introduced in c8007fdc5d2, it should use 'greater than max' instead of 'equal or greater than max' for the condition of checking invalid scsi unit. Signed-off-by: Han Han <hhan@redhat.com> --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9580884747..badc2da487 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4850,7 +4850,7 @@ virDomainSCSIDriveAddressIsUsed(const virDomainDef *def, break; } - if (max != -1 && addr->unit >= max) + if (max != -1 && addr->unit > max) return true; if (reserved != -1 && addr->unit == reserved) return true; -- 2.24.0.rc1

Signed-off-by: Han Han <hhan@redhat.com> --- docs/schemas/domaincommon.rng | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index a83c9ae7a5..d60d94e9ae 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4926,7 +4926,7 @@ </optional> <optional> <attribute name="port"> - <ref name="driveUnit"/> + <ref name="virtioserialPort"/> </attribute> </optional> </define> @@ -4936,7 +4936,7 @@ </attribute> <optional> <attribute name="slot"> - <ref name="driveUnit"/> + <ref name="ccidSlot"/> </attribute> </optional> </define> @@ -6488,6 +6488,16 @@ <param name="pattern">[a-zA-Z0-9_\-.]+</param> </data> </define> + <define name="virtioserialPort"> + <data type="string"> + <param name="pattern">[0-9]{1,2}</param> + </data> + </define> + <define name="ccidSlot"> + <data type="string"> + <param name="pattern">[0-9]{1,2}</param> + </data> + </define> <define name='alias'> <element name='alias'> <attribute name='name'> -- 2.24.0.rc1

Since the max unit of virtio scsi disk is 16383, update the range of driveUnit to it. Signed-off-by: Han Han <hhan@redhat.com> --- docs/schemas/domaincommon.rng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index d60d94e9ae..1e9a9f295b 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -6460,7 +6460,7 @@ </define> <define name="driveUnit"> <data type="string"> - <param name="pattern">[0-9]{1,2}</param> + <param name="pattern">[0-9]{1,5}</param> </data> </define> <define name="driveSCSIUnit"> -- 2.24.0.rc1

On 12/4/19 10:35 AM, Han Han wrote:
Fix spelling typo. Separate virtio serial port and ccid slot from driveUnit. v2: https://www.redhat.com/archives/libvir-list/2019-December/msg00004.html
Han Han (3): conf: fix logic error for scsi units rng: Separate virtio serial port and ccid slot from driveUnit rng: Extend the range of driveUnit
docs/schemas/domaincommon.rng | 16 +++++++++++++--- src/conf/domain_conf.c | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Thanks for taking care of this. I've pushed these. Micahl
participants (2)
-
Han Han
-
Michal Privoznik