[libvirt] [PATCH] Use global directory as UML's monitorDir for privileged connections
Daniel P. Berrange
berrange at redhat.com
Wed Aug 25 16:07:56 UTC 2010
On Wed, Aug 25, 2010 at 05:52:23PM +0200, Soren Hansen wrote:
> For privileged UML connections (uml:///system), we shouldn't use root's
> home dir, but rather somewhre in /var/run/libvirt/uml.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=499536
>
> Signed-off-by: Soren Hansen <soren at linux2go.dk>
> ---
> src/uml/uml_driver.c | 12 ++++++++----
> 1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
> index 8b129b7..c8b9997 100644
> --- a/src/uml/uml_driver.c
> +++ b/src/uml/uml_driver.c
> @@ -373,6 +373,10 @@ umlStartup(int privileged) {
>
> if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
> goto out_of_memory;
> +
> + if (virAsprintf(¨_driver->monitorDir,
> + "%s/run/libvirt/uml", LOCAL_STATE_DIR) == -1)
> + goto out_of_memory;
Can we make this '%s/lib/libvirt/uml'
> } else {
>
> if (virAsprintf(¨_driver->logDir,
> @@ -381,11 +385,11 @@ umlStartup(int privileged) {
>
> if (virAsprintf(&base, "%s/.libvirt", userdir) == -1)
> goto out_of_memory;
> - }
>
> - if (virAsprintf(¨_driver->monitorDir,
> - "%s/.uml", userdir) == -1)
> - goto out_of_memory;
> + if (virAsprintf(¨_driver->monitorDir,
> + "%s/.uml", userdir) == -1)
> + goto out_of_memory;
> + }
And '%s/.libvirt/uml/lib'
So that we match the QEMU driver layout. We aim to keep a strict
separate for 'lib' to be the place where the guest can write/create
files (control sockets), and 'run' to be the place where libvirtd
can write/create files (eg pid files, xml state).
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the libvir-list
mailing list