[libvirt] [PATCH 4/6] qemu: command: Build -blockdev-s for backing of pflash

Daniel P. Berrangé berrange at redhat.com
Thu Nov 21 18:09:35 UTC 2019


On Fri, Nov 15, 2019 at 04:51:50PM +0100, Peter Krempa wrote:
> As a first step we will build the blockdevs which will be supposed to
> back the pflash drives when moving away from -drive.
> 
> This code is similar to the way we build the blockdevs for the disk, but
> skips the copy-on-read layer and doesn't implement any legacy approach.
> 
> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> ---
>  src/qemu/qemu_command.c | 46 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 46 insertions(+)


> +static int
> +qemuBuildPflashBlockdevCommandLine(virCommandPtr cmd,
> +                                   qemuDomainObjPrivatePtr priv)
> +{
> +    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV))
> +        return 0;
> +
> +    if (priv->pflash0) {
> +        if (qemuBuildPflashBlockdevOne(cmd, priv->pflash0, priv->qemuCaps) < 0)
> +            return -1;
> +    }
> +
> +    if (priv->pflash1) {
> +        if (qemuBuildPflashBlockdevOne(cmd, priv->pflash1, priv->qemuCaps) < 0)
> +            return -1;
> +    }

These could have been done as single if()s but that's nitpicking &
I don't strongly care, so regardless of whether you change it or not

Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>


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 :|




More information about the libvir-list mailing list