Re: [PATCH v2 05/11] qemu: Introduce virQEMUDriverGetEmbedRoot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 30, 2020 at 06:20:28PM +0200, Michal Prívozník wrote:
> On 30. 3. 2020 13:16, Daniel P. Berrangé wrote:
> > On Thu, Mar 26, 2020 at 04:15:09PM +0100, Michal Privoznik wrote:
> >> This function returns embeddedRoot member of the driver
> >> structure.
> >>
> >> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> >> Reviewed-by: Andrea Bolognani <abologna@xxxxxxxxxx>
> >> Reviewed-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
> >> ---
> >>  src/qemu/qemu_conf.c | 12 ++++++++++++
> >>  src/qemu/qemu_conf.h |  1 +
> >>  2 files changed, 13 insertions(+)
> >>
> >> diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
> >> index 9786e19f8f..fdc6f53ad3 100644
> >> --- a/src/qemu/qemu_conf.c
> >> +++ b/src/qemu/qemu_conf.c
> >> @@ -1230,6 +1230,18 @@ virQEMUDriverIsPrivileged(virQEMUDriverPtr driver)
> >>      return driver->privileged;
> >>  }
> >>  
> >> +/* virQEMUDriverGetEmbedRoot:
> >> + * @driver: the QEMU driver
> >> + *
> >> + * Returns root directory specified in connection URI for embed
> >> + * mode, NULL otherwise.
> >> + */
> >> +const char *
> >> +virQEMUDriverGetEmbedRoot(virQEMUDriverPtr driver)
> >> +{
> >> +    return driver->embeddedRoot;
> >> +}
> > 
> > I don't really see the benefit in this method. The embeddedRoot
> > field is immutable so we can just be accessing it directly with
> > no need for APIs wrappers, as we often do when accesing the
> > privileged field.
> 
> I just wanted to follow what virQEMUDriverIsPrivileged() is doing. I
> don't care honestly.

Hmm, I had forgotten  virQEMUDriverIsPrivileged() exists - we don't
seem to be using that consistently either.

My preference is to have neither of those methods.

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





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux