Re: [libvirt] [PATCH] fix diagnostic when execute openvz commands

2008-07-09 Thread Evgeniy Sokolov
This really needs to be changed to pass through gettext, eg error(dom-conn, VIR_ERR_INTERNAL_ERROR, _(Could not exec %s), VZCTL); NB, we have to use a %s format string when going via gettext rather than just allowing the preprocessor to do string concatenation for us. Ok, it need.

Re: [libvirt] [PATCH] SetAutostart and GetAutostart in openvz driver

2008-07-09 Thread Evgeniy Sokolov
I realize you are just following the existing pattern used in OpenVZ driver, but this piece of code is horrible. sprintf'ing into a string, then parsing that string and turning it back into a list of argv[] strings, with no escaping of special characters, or quoting. eg if the vm name had a

[libvirt] [PATCH] renaming error - openvzError

2008-07-10 Thread Evgeniy Sokolov
function error() was renamed to openvzError() to don't conflict with other functions with the same name. other - openvzError() is added to msg_gen_function - fixed to pass make syntax-check Thanks to Jim Meyering for review. Index: src/openvz_conf.c

[libvirt] bug in libvirt.c?

2008-07-10 Thread Evgeniy Sokolov
for (i = 0; i virNetworkDriverTabCount; i++) { if ((virDriverTab[i]-probe != NULL) ((latest = virDriverTab[i]-probe()) != NULL)) { probes++; . } } We use array virDriverTab, but cicle is to

[libvirt] [PATCH] using one function to locate OpenVZ config files

2008-07-10 Thread Evgeniy Sokolov
There were 3 places with the same code. I moved it to separate function. other: use O_RDONLY to read config file Index: src/openvz_conf.c === RCS file: /data/cvs/libvirt/src/openvz_conf.c,v retrieving revision 1.28 diff -u -a -r1.28

[libvirt] [PATCH] default URI in probe

2008-07-11 Thread Evgeniy Sokolov
I specified default URI in probe(). To use libvirt with OpenVZ: # ./configure --with-openvz # make # ./src/virsh list Id Name State -- 33 33 running 105 105 running 108 108 running Index:

[libvirt] [PATCH] cleanup functions which exec OpenVZ tools

2008-07-11 Thread Evgeniy Sokolov
Patch improve code which execute external OpenVZ tools. ? src/test.xml Index: src/openvz_driver.c === RCS file: /data/cvs/libvirt/src/openvz_driver.c,v retrieving revision 1.28 diff -u -p -r1.28 openvz_driver.c ---

Re: [libvirt] [PATCH] cleanup functions which exec OpenVZ tools

2008-07-14 Thread Evgeniy Sokolov
Patch improve code which execute external OpenVZ tools. +/* generate arguments to create OpenVZ container + return -1 - error + 0 - OK +*/ +static int openvzDomainDefineCmd(const char *args[], int maxarg, struct openvz_vm_def *vmdef) Rather than passing in the pre-allocated

[libvirt] [PATCH] repeat lookup by name in LookupByID

2008-07-16 Thread Evgeniy Sokolov
There was error every time when I undefine stoped container no domain with matching id. Bug arrise due to stoped container has ID = -1. In such case container will be searched by name. other: use VIR_ERR_NO_DOMAIN when domain is not found Index: src/openvz_driver.c

Re: [libvirt] [PATCH] repeat lookup by name in LookupByID

2008-07-17 Thread Evgeniy Sokolov
Daniel Veillard пишет: On Wed, Jul 16, 2008 at 08:10:21PM +0100, Daniel P. Berrange wrote: Yes, the documentation is wrong - all inactive VMs have an ID of -1, and thus lookup-by-ID is nonsensical for inactive VMs. If any application did make use of this change which falls back to

[libvirt] [PATCH] cpu usage in OpenVZ

2008-07-17 Thread Evgeniy Sokolov
OpenVZ calculate statistics and allow to get them . Added function for getting cpu usage of container. Index: src/openvz_driver.c === RCS file: /data/cvs/libvirt/src/openvz_driver.c,v retrieving revision 1.31 diff -u -p -r1.31

Re: [libvirt] [PATCH] cpu usage in OpenVZ

2008-07-18 Thread Evgeniy Sokolov
On Thu, Jul 17, 2008 at 03:04:46PM +0400, Evgeniy Sokolov wrote: OpenVZ calculate statistics and allow to get them . Added function for getting cpu usage of container. Modular some minor comments, ACK for this patch. +if (!openvzIsActiveVM(vm)) { +info-cpuTime = 0; +} else

[libvirt] [PATCH] parse container id in separate function

2008-07-18 Thread Evgeniy Sokolov
There were several places with parsing container id from code. Separate function is used now. Index: src/openvz_conf.c === RCS file: /data/cvs/libvirt/src/openvz_conf.c,v retrieving revision 1.29 diff -u -p -r1.29 openvz_conf.c ---

[libvirt] [PATCH] fix lookup

2008-07-18 Thread Evgeniy Sokolov
I am often catching error related with that stoped VM has ID = -1. 1. If I create/define VM with existing ID of stoped VM. Creation failed, but error message is wrong. Detection is fixed. 2. Dominfo command may show info about some another VM. And report error that can't get autostart state.

Re: [libvirt] [PATCH] parse container id in separate function

2008-07-21 Thread Evgeniy Sokolov
On Fri, Jul 18, 2008 at 07:16:25PM +0100, Daniel P. Berrange wrote: On Fri, Jul 18, 2008 at 06:02:00PM +0400, Evgeniy Sokolov wrote: There were several places with parsing container id from code. Separate function is used now. Index: src/openvz_conf.c

Re: [libvirt] [PATCH] parse container id in separate function

2008-07-21 Thread Evgeniy Sokolov
On Mon, Jul 21, 2008 at 01:41:27PM +0400, Evgeniy Sokolov wrote: On Fri, Jul 18, 2008 at 07:16:25PM +0100, Daniel P. Berrange wrote: Right, let's reuse it, but I notice we are using strtol() in a lot of places ...openvz driver is not the worse here especially since it has already

[libvirt] xml format for openvz driver

2008-07-22 Thread Evgeniy Sokolov
Hello! I made review of domain XML format for driver in libvirt. And I have several questions and additions. For tag domain: need to add vmid or id - currenly tag name is used for ID. OpenVZ has mandatory parameter ID, but it also support optional parameter name, which is not implemented for

Re: [libvirt] xml format for openvz driver

2008-07-22 Thread Evgeniy Sokolov
On Tue, Jul 22, 2008 at 05:21:41PM +0400, Evgeniy Sokolov wrote: Hello! Hi Evgeniy I made review of domain XML format for driver in libvirt. And I have several questions and additions. For tag domain: need to add vmid or id - currenly tag name is used for ID. OpenVZ has mandatory

Re: [libvirt] xml format for openvz driver

2008-07-23 Thread Evgeniy Sokolov
On Tue, Jul 22, 2008 at 08:41:36PM +0400, Evgeniy Sokolov wrote: For tag domain/os: need to add ostemplate desirable config Can you explain exactly what the semantics of the two desired attributes are used for ? config is name of sample config for container. It contains many parameters

[libvirt] [PATCH] OpenVZ xml refactoring

2008-07-25 Thread Evgeniy Sokolov
Patch switch OpenVZ XML format to generic. main changes: - I used generic virDomainNetDef to define network in container. And wrote function to apply virDomainNetDef for container. Method virDomainNetDefParseXML is public now. - tag container is changed to devices - changed format of tag

Re: [libvirt] [PATCH] OpenVZ xml refactoring

2008-07-28 Thread Evgeniy Sokolov
On Fri, Jul 25, 2008 at 04:44:09PM +0400, Evgeniy Sokolov wrote: Patch switch OpenVZ XML format to generic. main changes: - I used generic virDomainNetDef to define network in container. And wrote function to apply virDomainNetDef for container. Method virDomainNetDefParseXML is public now

Re: [libvirt] PATCH: Support container XML enhancements

2008-07-29 Thread Evgeniy Sokolov
Daniel P. Berrange пишет: eg to use a template called 'fedora9web' as the root filesystem for a container filesystem type='template' source name='fedora9web'/ target dir='/'/ /filesystem Daniel, OpenVZ also require quota tags quota type=size

[libvirt] [PATCH] Save uuid when define/create domain

2008-08-05 Thread Evgeniy Sokolov
Hi, There was bug. UUID defined in XML or generated during define/create was not saved to config. Then it was regenerated in virDrvStateInitialize. Attached patch fix bug. Index: src/openvz_conf.c === RCS file:

Re: [libvirt] PATCH: 0/7: Re-factor LXC driver

2008-08-05 Thread Evgeniy Sokolov
On Tue, Aug 05, 2008 at 09:04:34PM +0400, Evgeniy V. Sokolov wrote: This is a long overdue followup to my previous set of patches to make the LXC driver use the new domain XML apis. Getting this merged is a blocker for the new libvirt release, now we've turned on LXC by default. Likewise we

[libvirt] [PATCH] get memory in openvz driver

2008-08-13 Thread Evgeniy Sokolov
OpenVZ has several parameters for memory management. All of them can be configured independetly. Patch allow to get configuration of memory from container config and then calculate total usage of memory. It is open question how to manage memory? Index: src/openvz_conf.c

[libvirt] [PATCH] manage number of virtual CPUs

2008-08-13 Thread Evgeniy Sokolov
OpenVZ containers use all CPUs available in system by default. Limitations may be caused only by Linux kernel limitation. There is way to artificially limit number of CPUs. patch add cpu management functionality to OpenVZ driver. Index: openvz_conf.c

Re: [libvirt] [PATCH] get memory in openvz driver

2008-08-14 Thread Evgeniy Sokolov
On Thu, Aug 14, 2008 at 06:08:31PM +0400, Evgeniy Sokolov wrote: On Wed, Aug 13, 2008 at 12:50:33PM +0400, Evgeniy Sokolov wrote: OpenVZ has several parameters for memory management. All of them can be configured independetly. Summing all the different memory limits together is wrong

Re: [libvirt] PATCH: Fix NULL checks in openvz driver

2008-09-08 Thread Evgeniy Sokolov
On Fri, Sep 05, 2008 at 05:40:16PM +0200, Jim Meyering wrote: Daniel P. Berrange [EMAIL PROTECTED] wrote: Jim pointed out some places where the openvz driver could deference some NULs, so this patch fixes them ... Index: src/openvz_driver.c

Re: [libvirt] [PATCH] read network config in OpenVZ driver

2008-09-09 Thread Evgeniy Sokolov
On Mon, Sep 08, 2008 at 03:59:55PM +0400, Evgeniy Sokolov wrote: This patch add possibility to load network configuration for container in OpenVZ driver. It support routing network and bridge devices. This types is currently supported in create/define command. Also, patch contain fix

Re: [libvirt] [PATCH] segfailt in openvz driver

2008-09-17 Thread Evgeniy Sokolov
On Thu, Sep 11, 2008 at 04:50:53PM +0400, Evgeniy Sokolov wrote: There was segmentation failt in openvz driver during 'create' command if domain with same id exist. Segfault was because of using structure (print warning with name of container) which is free. Hi Evgeniy, I notice

Re: [libvirt] [PATCH] read network config in OpenVZ driver

2008-09-17 Thread Evgeniy Sokolov
On Mon, Sep 08, 2008 at 03:59:55PM +0400, Evgeniy Sokolov wrote: This patch add possibility to load network configuration for container in OpenVZ driver. It support routing network and bridge devices. This types is currently supported in create/define command. Also, patch contain fix

Re: [libvirt] [PATCH] read network config in OpenVZ driver

2008-09-18 Thread Evgeniy Sokolov
On Wed, Sep 17, 2008 at 08:28:56PM +0400, Evgeniy Sokolov wrote: I attached patch without hunk which was commited by Daniel. Please commit if you are agree with it. A few comments inline.. So you're not artifically restricting the max length of the network name. It is limit

Re: [libvirt] openvz support in libvirt

2008-09-19 Thread Evgeniy Sokolov
2008/9/19 Evgeniy Sokolov [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Hello. To start with, I have the following questions: Does libvirt support the xml format for openvz driver described in the next thread? http://www.redhat.com/archives/libvir-list

Re: [libvirt] openvz support in libvirt

2008-09-26 Thread Evgeniy Sokolov
Hi, Evgeniy interface type='bridge' source bridge='eth10'/ /interface interface type='ethernet' mac address='00:16:3e:34:21:9e'/ ip

Re: [libvirt] [PATCH] openvz: swap source bridge=... with target dev=...

2008-09-29 Thread Evgeniy Sokolov
2008/9/29 Evgeniy V. Sokolov [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] This behaviour contradicts with description found in docs (in which source tag specify interface in host, not in container). I think, the previous bridge must be

Re: [libvirt] [PATCH] openvz: swap source bridge=... with target dev=...

2008-10-03 Thread Evgeniy Sokolov
Hi. I rewrite functions taken from vzctl in the new patch, so this: Here is the patch, that implements the following behaviour * interface name inside container is automatically generated and equals ethN, where N is the number of that interface within

Re: [libvirt] [PATCH] openvz: swap source bridge=... with target dev=...

2008-10-03 Thread Evgeniy Sokolov
P.S. Now I am working on that: P.S. Are someone going to implement interface type='bridge' ... source bridge=... ... /interface part of openvz driver? :) I plan to implement it in a month. It

Re: [libvirt] [PATCH] openvz: swap source bridge=... with target dev=...

2008-10-08 Thread Evgeniy Sokolov
I done the following: - Add function openvzAppendConfigParam(veid, param, value) This function simply appends a string `param=value` to config file. - Rewrite functions openvz{Get,Set}DefinedBridge to use that function Patch looks good now. I think, we need to rewrite {Get,Set}UUID

Re: [libvirt] PATCH 3/4: SUpport bridge config for openvz

2008-10-16 Thread Evgeniy Sokolov
This implements support for bridge configs in openvz following the rules set out in http://wiki.openvz.org/Virtual_Ethernet_device#Making_a_bridged_veth-device_persistent This simply requires that the admin has created /etc/vz/vznetctl.conf containing #!/bin/bash

Re: [libvirt] PATCH: OpenVZ bridge support

2008-11-14 Thread Evgeniy Sokolov
Sorry for delay. Big thanks for docs! This is an update of the patch http://www.redhat.com/archives/libvir-list/2008-October/msg00326.html To enable bridge support in the OpenVZ driver. As well as the fixes suggested last time, it includes an initial bit of HTML doc for the openvz driver,

[libvirt] PATCH: allow to set nvcpus = 0

2008-11-17 Thread Evgeniy Sokolov
OpenVZ uses all CPUs available in system - by default (number of CPUs did not set) - number of CPUs = 0 Currenty, libvirt don't allow to set nvcpus = 0. Attached patch removes limitation in libvirt set nvcpu = 0, but add it to each driver which allow to set number of virtual CPU. For OpenVZ

Re: [libvirt] PATCH: allow to set nvcpus = 0

2008-11-19 Thread Evgeniy Sokolov
On Mon, Nov 17, 2008 at 06:44:07PM +0300, Evgeniy Sokolov wrote: OpenVZ uses all CPUs available in system - by default (number of CPUs did not set) - number of CPUs = 0 Currenty, libvirt don't allow to set nvcpus = 0 Attached patch removes limitation in libvirt set nvcpu = 0, but add

Re: [libvirt] [OpenVZ]

2008-12-18 Thread Evgeniy Sokolov
Hi, attached patch fix problem. Guys, is it really an issue to fix also mac generation for OpenVZ? Vzctl generates different macs for host's and domain's eth devices. Libvirt creates them with equal macs. In this case there is a bridge support for OpenVZ in libvirt but it

Re: [libvirt] [PATCH] Adding filesystem mount support for openVZ

2009-03-12 Thread Evgeniy Sokolov
Hi Florian, Hi everyone, This patch is to allow using the mount type in the filesystem tag for OpenVZ domains. Example: ... filesystem type='mount' source dir='/path/to/filesystem/directory/' / target dir='/path/to/pivot/root/' / /filesystem ... This is my first patch

Re: [libvirt] [PATCH] Adding filesystem mount support for openVZ

2009-03-13 Thread Evgeniy Sokolov
Hi Evgeniy, really, default config is specified in /etc/sysconfig/vz # grep -R CONFIGFILE /etc/sysconfig/vz CONFIGFILE=vps.basic config file is calculating by snprintf(path, sizeof(path), VPS_CONF_DIR ve-%s.conf-sample, config); Actually, vz.conf is in /etc/vz/ on my machine

Re: [libvirt] [PATCH] Openvz: how to use a nondefault config

2009-04-02 Thread Evgeniy Sokolov
Hi Anton, I'm sorry for delay. I was on vacation. Hi all. When libvirt creates an OpenVZ machine, it does smth like # vzctl create $ctid --ostemplate `ostemplate` And we can't specify an --config `config` argument. In this case vzctl chooses a default config file (a value of CONFIG

Re: [libvirt] [PATCH] Openvz: how to use a nondefault config

2009-04-06 Thread Evgeniy Sokolov
2009/4/2 Daniel P. Berrange berra...@redhat.com mailto:berra...@redhat.com On Thu, Apr 02, 2009 at 06:36:15PM +0400, Evgeniy Sokolov wrote: Config /etc/vz/conf/ve-XXX.conf-sample define there are many parameters like memory, CPU etc. This parameters