Re: [libvirt] [PATCH] Use global directory as UML's monitorDir for privileged connections

2010-08-31 Thread Daniel P. Berrange
On Wed, Aug 25, 2010 at 06:39:11PM +0200, Soren Hansen wrote:
 On 25-08-2010 18:07, Daniel P. Berrange wrote:
  --- 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(uml_driver-monitorDir,
  +%s/run/libvirt/uml, LOCAL_STATE_DIR) == -1)
  +goto out_of_memory;
  
  Can we make this  '%s/lib/libvirt/uml'
 
 You want transient stuff like UNIX sockets in /var/lib? That seems odd
 to me.

Not hugely, but I don't want it to overlap with the directories
used by libvirtd for transient stuff. If we make it '%/run/libvirt/uml-guest'
instead that would be OK


  -}
   
  -if (virAsprintf(uml_driver-monitorDir,
  -%s/.uml, userdir) == -1)
  -goto out_of_memory;
  +if (virAsprintf(uml_driver-monitorDir,
  +%s/.uml, userdir) == -1)
  +goto out_of_memory;
  +}
  And   '%s/.libvirt/uml/lib' 
 
 I understand your desire to be consistent, but I really think
 integrating well with existing management tools for the hypervisor (in
 this case uml-utilities) is more important.

Agreed, I hadn't seen your reply about uml-utilities when writing
this.

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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] Use global directory as UML's monitorDir for privileged connections

2010-08-31 Thread Soren Hansen
On 31-08-2010 12:39, Daniel P. Berrange wrote:
 Can we make this  '%s/lib/libvirt/uml'
 You want transient stuff like UNIX sockets in /var/lib? That seems odd
 to me.
 Not hugely, but I don't want it to overlap with the directories
 used by libvirtd for transient stuff. If we make it '%/run/libvirt/uml-guest'
 instead that would be OK

Excellent.

 I understand your desire to be consistent, but I really think
 integrating well with existing management tools for the hypervisor (in
 this case uml-utilities) is more important.
 Agreed, I hadn't seen your reply about uml-utilities when writing
 this.

Excellent again. I'll make these adjustments.

-- 
Soren Hansen
Ubuntu Developer
http://www.ubuntu.com/

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] Use global directory as UML's monitorDir for privileged connections

2010-08-31 Thread Soren Hansen
For privileged UML connections (uml:///system), we shouldn't use root's
home dir, but rather somewhere in /var/run/libvirt/uml-guest.

https://bugzilla.redhat.com/show_bug.cgi?id=499536

Signed-off-by: Soren Hansen so...@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..0a5c829 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(uml_driver-monitorDir,
+%s/run/libvirt/uml-guest, LOCAL_STATE_DIR) == -1)
+goto out_of_memory;
 } else {
 
 if (virAsprintf(uml_driver-logDir,
@@ -381,11 +385,11 @@ umlStartup(int privileged) {
 
 if (virAsprintf(base, %s/.libvirt, userdir) == -1)
 goto out_of_memory;
-}
 
-if (virAsprintf(uml_driver-monitorDir,
-%s/.uml, userdir) == -1)
-goto out_of_memory;
+if (virAsprintf(uml_driver-monitorDir,
+%s/.uml, userdir) == -1)
+goto out_of_memory;
+}
 
 /* Configuration paths are either ~/.libvirt/uml/... (session) or
  * /etc/libvirt/uml/... (system).
-- 
1.7.0.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] Use global directory as UML's monitorDir for privileged connections

2010-08-31 Thread Eric Blake

On 08/31/2010 05:44 AM, Soren Hansen wrote:

For privileged UML connections (uml:///system), we shouldn't use root's
home dir, but rather somewhere in /var/run/libvirt/uml-guest.

https://bugzilla.redhat.com/show_bug.cgi?id=499536

Signed-off-by: Soren Hansenso...@linux2go.dk
---
  src/uml/uml_driver.c |   12 
  1 files changed, 8 insertions(+), 4 deletions(-)



I think this version captures all the discussion on the ideal locations 
for privileged vs. regular users elsewhere in the thread.


ACK, and pushed.

--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] Use global directory as UML's monitorDir for privileged connections

2010-08-25 Thread Soren Hansen
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 so...@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(uml_driver-monitorDir,
+%s/run/libvirt/uml, LOCAL_STATE_DIR) == -1)
+goto out_of_memory;
 } else {
 
 if (virAsprintf(uml_driver-logDir,
@@ -381,11 +385,11 @@ umlStartup(int privileged) {
 
 if (virAsprintf(base, %s/.libvirt, userdir) == -1)
 goto out_of_memory;
-}
 
-if (virAsprintf(uml_driver-monitorDir,
-%s/.uml, userdir) == -1)
-goto out_of_memory;
+if (virAsprintf(uml_driver-monitorDir,
+%s/.uml, userdir) == -1)
+goto out_of_memory;
+}
 
 /* Configuration paths are either ~/.libvirt/uml/... (session) or
  * /etc/libvirt/uml/... (system).
-- 
1.7.0.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] Use global directory as UML's monitorDir for privileged connections

2010-08-25 Thread Daniel P. Berrange
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 so...@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(uml_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(uml_driver-logDir,
 @@ -381,11 +385,11 @@ umlStartup(int privileged) {
  
  if (virAsprintf(base, %s/.libvirt, userdir) == -1)
  goto out_of_memory;
 -}
  
 -if (virAsprintf(uml_driver-monitorDir,
 -%s/.uml, userdir) == -1)
 -goto out_of_memory;
 +if (virAsprintf(uml_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 :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] Use global directory as UML's monitorDir for privileged connections

2010-08-25 Thread Soren Hansen
On 25-08-2010 18:07, Daniel P. Berrange wrote:
 --- 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(uml_driver-monitorDir,
 +%s/run/libvirt/uml, LOCAL_STATE_DIR) == -1)
 +goto out_of_memory;
 
 Can we make this  '%s/lib/libvirt/uml'

You want transient stuff like UNIX sockets in /var/lib? That seems odd
to me.

The FHS even explicitly says: System programs that maintain transient
UNIX-domain sockets must place them in this directory. where this
directory is /var/run.

  } else {
  
  if (virAsprintf(uml_driver-logDir,
 @@ -381,11 +385,11 @@ umlStartup(int privileged) {
  
  if (virAsprintf(base, %s/.libvirt, userdir) == -1)
  goto out_of_memory;
 -}
  
 -if (virAsprintf(uml_driver-monitorDir,
 -%s/.uml, userdir) == -1)
 -goto out_of_memory;
 +if (virAsprintf(uml_driver-monitorDir,
 +%s/.uml, userdir) == -1)
 +goto out_of_memory;
 +}
 And   '%s/.libvirt/uml/lib' 

I understand your desire to be consistent, but I really think
integrating well with existing management tools for the hypervisor (in
this case uml-utilities) is more important.

-- 
Soren Hansen
Ubuntu Developer
http://www.ubuntu.com/

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list