Re: [libvirt] [RFC] Memory controller exploitation in libvirt

2010-08-31 Thread Nikunj A. Dadhania
On Mon, 30 Aug 2010 18:40:34 +0530, Balbir Singh bal...@linux.vnet.ibm.com 
wrote:
 On Mon, Aug 30, 2010 at 11:56 AM, Nikunj A. Dadhania
 nik...@linux.vnet.ibm.com wrote:
snip

  4) KVM  LXC
  
  memory.limit_in_bytes: Memory hard limit
  memory.soft_limit_in_bytes: Memory limit held during contention
 
 held might not be the right word for soft limit.
How about - Memory limit ensured during contention 
 
  memory.memsw_limit_in_bytes: Memory+Swap hard limit
  memory.swapiness: Controls the tendency of moving the VM processes to the
                   swap. Value range is 0-100, where 0 means, avoid swapping 
  as
                   long as possible and 100 means aggressively swap processes.
 
  Statistics:
  memory.usage_in_bytes: Current memory usage
  memory.memsw_usage_in_bytes: Current memory+swap usage
  memory.max_usage_in_bytes: Maximum memory usage recorded
  memory.memsw_max_usage_in_bytes: Maximum memory+swap usage
 
 We also have memory.stat, memory.hierarchy - The question is do we
 care about hierarchical control? We also have controls to decide
 whether to move memory on moving from one cgroup to another, that
 might not apply to the LXC/QEMU case. There is also memory.failcnt
 which I am not sure makes sense to export.
memory.hierarchy is being used in libvirt, there is an internal API
(virCgroupSetMemoryUseHierarchy) for enabling. I am not sure if this should be
exported.

memory.stat will be good one for getting the stats. I will add this to the
statistics section.

Nikunj

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

Re: [libvirt] [RFC] Memory controller exploitation in libvirt

2010-08-31 Thread Balbir Singh
 held might not be the right word for soft limit.
 How about - Memory limit ensured during contention

I'd recommend limit to enforce on memory contention

Balbir

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


Re: [libvirt] Best place to put links to the libvirt App Dev Guide?

2010-08-31 Thread Daniel P. Berrange
On Tue, Aug 31, 2010 at 12:51:54PM +1000, Justin Clift wrote:
 Hi guys,
 
 Where's the best place in the libvirt.org menu structure, to point 
 people to the (developing) libvirt App Dev Guide?
 
 My initial thinking is:
 
  a) Have a link to the .pdf in the Downloads section
 
 +
 
  b) Maybe a new top title section like:
 
 Documentation - Dev Guide
 
 With links to the html, html (one big page), and pdf files.
 
 Sound reasonable?

A combination of both of those sounds fine. PDF download in the main Downloads
section, and HTML under the Docs section

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] Explicitly pass uml_dir argument to user-mode-linux

2010-08-31 Thread Soren Hansen
On 25-08-2010 11:03, Soren Hansen wrote:
 uml_dir overrides user-mode-linux's default of ~/.uml. This is needed
 for a couple of different reasons:

Any comments on this patch? It seems perfectly reasonable to me to get
this in regardless of the outcome of this discussion:

  https://www.redhat.com/archives/libvir-list/2010-August/msg00672.html

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

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


Re: [libvirt] [PATCH] Explicitly pass uml_dir argument to user-mode-linux

2010-08-31 Thread Daniel P. Berrange
On Wed, Aug 25, 2010 at 11:03:42AM +0200, Soren Hansen wrote:
 uml_dir overrides user-mode-linux's default of ~/.uml. This is needed
 for a couple of different reasons:
 
 libvirt expects this to default to virGetUserDirectory(geteuid()) +
 '/.uml'. However, user-mode-linux actually uses the HOME environment
 variable to determine where to look for the uml sockets, but if running
 libvirtd under sudo (which I routinely do during development), $HOME is
 pointing at my user's homedir, while my euid is 0, so libvirt looks in
 /root.
 
 Also (and this was my actual motivation for this patch), if HOME isn't
 set at all, user-mode-linux utterly fails. Looking at the code, it seems
 it's meant to emit a warning, but alas, it doesn't for some reason.
 If running libvirtd from upstart, HOME is not set, so any system using
 upstart will need this change.
 
 Signed-off-by: Soren Hansen so...@linux2go.dk
 ---
  src/uml/uml_conf.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
 index 65b06c5..4906192 100644
 --- a/src/uml/uml_conf.c
 +++ b/src/uml/uml_conf.c
 @@ -409,7 +409,7 @@ static char *umlNextArg(char *args)
   * for a given virtual machine.
   */
  int umlBuildCommandLine(virConnectPtr conn,
 -struct uml_driver *driver ATTRIBUTE_UNUSED,
 +struct uml_driver *driver,
  virDomainObjPtr vm,
  fd_set *keepfd,
  const char ***retargv,
 @@ -499,7 +499,6 @@ int umlBuildCommandLine(virConnectPtr conn,
  ADD_ENV_COPY(LD_PRELOAD);
  ADD_ENV_COPY(LD_LIBRARY_PATH);
  ADD_ENV_COPY(PATH);
 -ADD_ENV_COPY(HOME);
  ADD_ENV_COPY(USER);
  ADD_ENV_COPY(LOGNAME);
  ADD_ENV_COPY(TMPDIR);
 @@ -508,6 +507,7 @@ int umlBuildCommandLine(virConnectPtr conn,
  //ADD_ARG_PAIR(con0, fd:0,fd:1);
  ADD_ARG_PAIR(mem, memory);
  ADD_ARG_PAIR(umid, vm-def-name);
 +ADD_ARG_PAIR(uml_dir, driver-monitorDir);
  
  if (vm-def-os.root)
  ADD_ARG_PAIR(root, vm-def-os.root);

ACK

Regards,
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] virsh create and virsh dumpxml certain code location

2010-08-31 Thread Daniel P. Berrange
On Tue, Aug 24, 2010 at 11:31:14AM -0600, Jim Fehlig wrote:

 From 6320c63d7c5077cf27050a567ca9d7ab7c17b189 Mon Sep 17 00:00:00 2001
 From: Jim Fehlig jfeh...@novell.com
 Date: Tue, 24 Aug 2010 11:26:15 -0600
 Subject: [PATCH] Add blktap2 support to xend driver
 
 Xen4.0 includes a new blktap2 implementation, which is specified
 with 'tap2' prefix.  AFAICT it's configuration syntax is identical
 to blktap, with exception of 'tap2' vs 'tap' prefix.  This patch
 takes the simple approach of accepting and generating sexp
 containing 'tap2' prefix.
 
 V2: Also generate sexp containing tap2 device type

ACK this looks good in combination with the test case posted
separately.

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 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] [libvirt-users] Decent How-To now on the wiki for setting up Transport Layer Security

2010-08-31 Thread Daniel Veillard
On Mon, Aug 30, 2010 at 08:46:43PM +1000, Justin Clift wrote:
 Hi all,
 
 For anyone that's interested in setting up TLS with libvirt, but
 hasn't gotten around to it yet, there's a decent guide on the wiki
 now:
 
   http://wiki.libvirt.org/page/TLSSetup
 
 It's user focused (ie SysAdmin's), and has lots of pics explaining
 concepts, plus shows what needs to be done, and shows how to do it.
 
 Please note, it doesn't cover SASL, it's just plain host based TLS.
 
 Very much open to feedback on it, if people have suggestions for
 improvement.
 
 Hope that helps. :)

  Very nice :-) Thanks !

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


Re: [libvirt] Best place to put links to the libvirt App Dev Guide?

2010-08-31 Thread Daniel Veillard
On Tue, Aug 31, 2010 at 10:30:46AM +0100, Daniel P. Berrange wrote:
 On Tue, Aug 31, 2010 at 12:51:54PM +1000, Justin Clift wrote:
  Hi guys,
  
  Where's the best place in the libvirt.org menu structure, to point 
  people to the (developing) libvirt App Dev Guide?
  
  My initial thinking is:
  
   a) Have a link to the .pdf in the Downloads section
  
  +
  
   b) Maybe a new top title section like:
  
  Documentation - Dev Guide
  
  With links to the html, html (one big page), and pdf files.
  
  Sound reasonable?
 
 A combination of both of those sounds fine. PDF download in the main Downloads
 section, and HTML under the Docs section

Agreed,

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


Re: [libvirt] Need help, how can I access to qemu-monitor with libvirt 0.8.1

2010-08-31 Thread Eric Blake

On 08/31/2010 03:41 AM, Lai Jiangshan wrote:


Hi, all

I encounter this problem when I try to send NMI to guest.
I don't know how. I think if I can access to the qemu-monitor, I can
just do this command in the qemu-monitor: nmicpu#.
But I don't know how to access to qemu-monitor, I think I can
get help here.


The only way to do this with libvirt 0.8.1 is to write a wrapper script 
which adds arguments and invokes the real qemu, then point libvirt to 
the location of the wrapper instead of the real qemu.  Not the most 
trivial task.



I noticed that libvirt 0.8.3 supports remote protocol and arbitrary qemu 
commands,
but I did not found any document, how can I use it?


That's different than the 0.8.1 of your subject line.  Yes, 0.8.3 makes 
it easier to add additional arbitrary arguments to the qemu command line 
via your XML file.  The list archives has several examples of this; most 
recently:


https://www.redhat.com/archives/libvir-list/2010-August/msg00589.html

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


Re: [libvirt] Best place to put links to the libvirt App Dev Guide?

2010-08-31 Thread Saravanan S
Hi all

How do I discover the MAC address of machines  that are available just with
only BIOS installed (no Operating System present).

And I need to find the mac address of such machines that are up with just
BIOS.
How do i do image installations on * bare-metal *?

Please Guide me.

Thanks.

Saravanan Sundaramoorthy
Red Hat Certified Engineer
http://www.google.com/profiles/dearsaravanan#about
+91 99404 32545
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] How to discover the baremetal resources install a VM image on the same

2010-08-31 Thread Saravanan S
Hi all

How do I discover the MAC address of machines  that are available just with
only BIOS installed (no Operating System present).

And I need to find the mac address of such machines that are up with just
BIOS.
How do i do image installations on * bare-metal *?

Please Guide me.

Thanks.

Saravanan Sundaramoorthy
Red Hat Certified Engineer
http://www.google.com/profiles/dearsaravanan#about
+91 99404 32545
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] virsh create and virsh dumpxml certain code location

2010-08-31 Thread Eric Blake

On 08/31/2010 04:45 AM, Daniel P. Berrange wrote:

On Tue, Aug 24, 2010 at 11:31:14AM -0600, Jim Fehlig wrote:


 From 6320c63d7c5077cf27050a567ca9d7ab7c17b189 Mon Sep 17 00:00:00 2001
From: Jim Fehligjfeh...@novell.com
Date: Tue, 24 Aug 2010 11:26:15 -0600
Subject: [PATCH] Add blktap2 support to xend driver

Xen4.0 includes a new blktap2 implementation, which is specified
with 'tap2' prefix.  AFAICT it's configuration syntax is identical
to blktap, with exception of 'tap2' vs 'tap' prefix.  This patch
takes the simple approach of accepting and generating sexp
containing 'tap2' prefix.

V2: Also generate sexp containing tap2 device type


ACK this looks good in combination with the test case posted
separately.


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


Re: [libvirt] [PATCH] Tests for Xen 4.0 blktap2

2010-08-31 Thread Eric Blake

On 08/24/2010 03:49 PM, Jim Fehlig wrote:

Tests for blktap2, pending ACK of blktap2 patch for xend driver
discussed here

https://www.redhat.com/archives/libvir-list/2010-August/msg00636.html


Pushed, per the ACK here:
https://www.redhat.com/archives/libvir-list/2010-August/msg00717.html

--
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] maint: track moved file

2010-08-31 Thread Eric Blake
* daemon/.gitignore: Move libvirt-guests.init...
* tools/.gitignore: ...to its new location.
---

Pushing under the obvious rule, as fallout from 2c090a555.

 daemon/.gitignore |1 -
 tools/.gitignore  |1 +
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/daemon/.gitignore b/daemon/.gitignore
index 4475b6d..8ed7784 100644
--- a/daemon/.gitignore
+++ b/daemon/.gitignore
@@ -7,7 +7,6 @@ Makefile.in
 libvirt_qemud
 libvirtd
 libvirtd.init
-libvirt-guests.init
 libvirtd*.logrotate
 libvirtd.pod
 libvirtd.8
diff --git a/tools/.gitignore b/tools/.gitignore
index 51f1f66..3e34ea8 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -1,3 +1,4 @@
+libvirt-guests.init
 virt-xml-validate
 virt-pki-validate
 *.1
-- 
1.7.2.2

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


Re: [libvirt] [PATCH] Explicitly pass uml_dir argument to user-mode-linux

2010-08-31 Thread Eric Blake

On 08/31/2010 04:37 AM, Daniel P. Berrange wrote:

On Wed, Aug 25, 2010 at 11:03:42AM +0200, Soren Hansen wrote:

uml_dir overrides user-mode-linux's default of ~/.uml. This is needed
for a couple of different reasons:

@@ -508,6 +507,7 @@ int umlBuildCommandLine(virConnectPtr conn,
  //ADD_ARG_PAIR(con0, fd:0,fd:1);
  ADD_ARG_PAIR(mem, memory);
  ADD_ARG_PAIR(umid, vm-def-name);
+ADD_ARG_PAIR(uml_dir, driver-monitorDir);

  if (vm-def-os.root)
  ADD_ARG_PAIR(root, vm-def-os.root);


ACK


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


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


Re: [libvirt] [PATCH] virsh: remove driver check from attach-disk command

2010-08-31 Thread Eric Blake

On 08/24/2010 10:09 AM, Ryan Harper wrote:

Virsh shouldn't check for driver support but rather let the backend handled 
this.
After removing the check, I can successfully attach file-based images to a qemu
VM with attach-disk.


  if (driver) {
-if (STREQ(driver, file) || STREQ(driver, tap)) {
+if (STREQ(driver, file) || STREQ(driver, tap))
  isFile = 1;
-} else if (STRNEQ(driver, phy)) {
-vshError(ctl, _(No support for %s in command 'attach-disk'),
- driver);
-goto cleanup;
-}
  }


ACK; 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