[libvirt] [PATCH 1/2] domain_conf: move DomainParseBlkioDeviceStr out of QEMU and LXC drivers

Peter Krempa pkrempa at redhat.com
Thu Jul 11 08:01:08 UTC 2019


On Thu, Jul 11, 2019 at 09:50:06 +0200, Pavel Hrdina wrote:
> On Thu, Jul 11, 2019 at 08:52:09AM +0200, Peter Krempa wrote:
> > On Wed, Jul 10, 2019 at 17:44:31 +0200, Ilias Stamatis wrote:
> > > The qemuDomainParseBlkioDeviceStr and lxcDomainParseBlkioDeviceSts
> > > functions residing in the QEMU and LXC drivers respectively are
> > > completely identical.
> > > 
> > > By moving the code to src/conf we avoid code duplication and we make the
> > > function available to other drivers that might need to call it such as
> > > the test driver.
> > > 
> > > Signed-off-by: Ilias Stamatis <stamatis.iliass at gmail.com>
> > > ---
> > >  src/conf/domain_conf.c   | 115 +++++++++++++++++++++++++++++++++++
> > >  src/conf/domain_conf.h   |   6 ++
> > >  src/libvirt_private.syms |   1 +
> > >  src/lxc/lxc_driver.c     | 112 +---------------------------------
> > >  src/qemu/qemu_driver.c   | 126 +++------------------------------------
> > >  5 files changed, 132 insertions(+), 228 deletions(-)
> > > 
> > > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> > > index 3323c9a5b1..e10390189c 100644
> > > --- a/src/conf/domain_conf.c
> > > +++ b/src/conf/domain_conf.c
> > > @@ -30219,6 +30219,121 @@ virDomainDefGetShortName(const virDomainDef *def)
> > > 
> > >  #undef VIR_DOMAIN_SHORT_NAME_MAX
> > > 
> > > +
> > > +/* blkioDeviceStr in the form of /device/path,weight,/device/path,weight
> > > + * for example, /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0,800
> > > + */
> > > +int
> > > +virDomainParseBlkioDeviceStr(char *blkioDeviceStr,
> > 
> > The domain_conf.c module is meant to collect stuff regarding the XML
> > parser and configuration-related methods.
> > 
> > This is a worker method which does not have to do anything with config.
> > 
> > Please find a proper place in src/util/ for it.
> 
> In order to add it into src/util we need to remove dependency on
> virBlkioDevicePtr from the code as in util we should not include
> anything from other parts of libvirt.

Hmpf right. Okay then. I retract my comment then. In the end
domain_conf.c is already a dumping pile of random code anyways.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190711/394054ba/attachment-0001.sig>


More information about the libvir-list mailing list