[libvirt] [PATCH 07/12] qemu: command: Refactor creation of RNG device commandline
Peter Krempa
pkrempa at redhat.com
Tue Feb 10 12:08:54 UTC 2015
On Mon, Feb 09, 2015 at 16:54:00 +0100, Ján Tomko wrote:
> On Fri, Feb 06, 2015 at 04:32:21PM +0100, Peter Krempa wrote:
> > As the RNG device is using an -object as backend refactor the code to
> > use the JSON to commandline generator so that we can reuse the code
> > later in hotplug.
> > ---
> > src/qemu/qemu_command.c | 108 +++++++++++++++++++++++++++++++++++++-----------
> > 1 file changed, 84 insertions(+), 24 deletions(-)
> >
> > diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> > index 6380621..9179c1f 100644
> > --- a/src/qemu/qemu_command.c
> > +++ b/src/qemu/qemu_command.c
> > @@ -6154,15 +6154,33 @@ qemuBuildSclpDevStr(virDomainChrDefPtr dev)
> >
> >
> > static int
> > -qemuBuildRNGBackendArgs(virCommandPtr cmd,
> > - virDomainRNGDefPtr dev,
> > - virQEMUCapsPtr qemuCaps)
> > +qemuBuildRNGBackendChrdevStr(virDomainRNGDefPtr rng,
> > + virQEMUCapsPtr qemuCaps,
> > + char **chr)
> > {
> > - virBuffer buf = VIR_BUFFER_INITIALIZER;
> > - char *backend = NULL;
> > + *chr = NULL;
> > +
> > + if (rng->backend != VIR_DOMAIN_RNG_BACKEND_EGD)
> > + return 0;
>
> Making this a switch ((virDomainRNGBackend)) would check if all the
> enum values are handled.
Indeed. Having the complier to complain is useful when adding new stuff.
Consider it added.
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150210/89269c0c/attachment-0001.sig>
More information about the libvir-list
mailing list