[PATCH] conf: fix block type CDROM cannot support startupPolicy

Han Han hhan at redhat.com
Thu Sep 30 01:58:46 UTC 2021


On Tue, Sep 28, 2021 at 10:43 AM Jie Wang <wangjie88 at huawei.com> wrote:

> block type CDROM also support startupPolicy in the past, so
>
s/block/Block/

"in the past" could be more detailed. It's better if you tell from which
version to which version the
startupPolicy of block type cdrom is supported

> let us fix it.
>
> Signed-off-by: Jie Wang <wangjie88 at huawei.com>
> ---
>  src/conf/domain_conf.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index f7025bffe4..dd374e8ab3 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -30853,9 +30853,10 @@ virDomainDiskTranslateSourcePool(virDomainDiskDef
> *def)
>      }
>
>      if (def->startupPolicy != 0 &&
> -        virStorageSourceGetActualType(def->src) != VIR_STORAGE_TYPE_FILE)
> {
> +        (virStorageSourceGetActualType(def->src) != VIR_STORAGE_TYPE_FILE
> &&
> +         virStorageSourceGetActualType(def->src) !=
> VIR_STORAGE_TYPE_BLOCK)) {
>          virReportError(VIR_ERR_XML_ERROR, "%s",
> -                       _("'startupPolicy' is only valid for 'file' type
> volume"));
> +                       _("'startupPolicy' is only valid for 'file' or
> 'block' type volume"));
>          return -1;
>      }
>
> --
> 2.24.0.windows.2
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210930/a6ed726e/attachment-0001.htm>


More information about the libvir-list mailing list