Re: [libvirt] [PATCH]: virAsprintf cleanup v2

2009-01-06 Thread Daniel Veillard
On Mon, Dec 22, 2008 at 10:02:17PM +0100, Guido Günther wrote:
 Hi,
 new version attached. It adds your suggestions and also uses virAsprintf
 in the new src/logging.c.

  Oops, my fault ! Thanks for fixing this :-)

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] [PATCH] Make mntent.h specific to the FS storage backend

2009-01-06 Thread Daniel Veillard
On Sat, Dec 20, 2008 at 08:48:04AM -0800, john.le...@sun.com wrote:
 # HG changeset patch
 # User john.le...@sun.com
 # Date 1229789393 28800
 # Node ID c433c57ef39b2c343653910df84130c8849a7c11
 # Parent  100de621beed6e146b239df3691bd426090955b4
 Make mntent.h specific to the FS storage backend
 
 It's Linux specific, so for now, put it behind a WITH_STORAGE_FS guard.

  Makes sense, applied and commited,

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


[libvirt] [PATCH] avoid syntax-check (po-check) failure due to FP match on gettext.m4

2009-01-06 Thread Jim Meyering
spotted by Dan Berrange
and the autobuilder
  http://builder.virt-manager.org/logs/modules/libvirt--devel-build-output.log

From ee91ab81dbd458078df39ef52e22e9a489d5cc72 Mon Sep 17 00:00:00 2001
From: Jim Meyering meyer...@redhat.com
Date: Tue, 6 Jan 2009 10:42:29 +0100
Subject: [PATCH] avoid syntax-check (po-check) failure due to FP match on 
gettext.m4

* Makefile.maint (po-check): Exclude .m4 files.
---
 Makefile.maint |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile.maint b/Makefile.maint
index 4e2d347..cfbdf56 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -558,6 +558,7 @@ po-check:
  files=;   \
  for file in $$($(VC_LIST_EXCEPT)); do \
case $$file in  \
+ *.m4) continue;;  \
  *.?|*.??) ;;  \
  *) continue;; \
esac;   \
--
1.6.1.rc3.350.g541da

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


Re: [libvirt] [PATCH] Fix !SASL qemud compile

2009-01-06 Thread Daniel Veillard
On Mon, Dec 22, 2008 at 01:07:33PM -0800, john.le...@sun.com wrote:
 # HG changeset patch
 # User john.le...@sun.com
 # Date 1229980020 28800
 # Node ID 4fbf7139ca42757d771f03578e91038bf28a5e0e
 # Parent  fd97ec8e5799120ebf5ea9ed73d681c6d1386970
 Fix !SASL qemud compile
 
 Replace qemudLog() with ERROR0()

  Side effect of the revamp of the logging APIs, good catch, applied and
commited, 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] [PATCH] avoid syntax-check (po-check) failure due to FP match on gettext.m4

2009-01-06 Thread Daniel P. Berrange
On Tue, Jan 06, 2009 at 10:44:41AM +0100, Jim Meyering wrote:
 spotted by Dan Berrange
 and the autobuilder
   http://builder.virt-manager.org/logs/modules/libvirt--devel-build-output.log
 
 From ee91ab81dbd458078df39ef52e22e9a489d5cc72 Mon Sep 17 00:00:00 2001
 From: Jim Meyering meyer...@redhat.com
 Date: Tue, 6 Jan 2009 10:42:29 +0100
 Subject: [PATCH] avoid syntax-check (po-check) failure due to FP match on 
 gettext.m4

ACK

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.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] Libvirt - Xen Enterprise - Koan

2009-01-06 Thread Tom Brown



I've not tried it, but the likely problem is that you'll need to turn
on XenD's  UNIX server config option in /etc/xen/xend-config.sxp

  http://libvirt.org/drvxen.html

  


Thanks for this - this sounds like the most likely issue. The problem is 
that Citrix seems to move things around somewhat as that config file 
does not exist. There is a xensource directory that contains the 
following but other than that i am a bit stuck.


# ll /etc/xensource
total 72
-rw-r--r-- 1 root root 1956 Dec 31 11:22 boot_time_cpus
-rw--- 1 root root   11 Dec 31 11:22 boot_time_memory
-rwxr-xr-x 1 root root   71 Sep  4 13:46 db.conf
-rwxr-xr-x 1 root root   74 Sep  4 13:46 db.conf.rio
-rw-r--r-- 1 root root  655 Sep  4 13:46 db-default-fields
-rw-r--r-- 1 root root 8660 Sep  4 13:46 db_schema.sql
-rw--- 1 root root  653 Dec 31 11:18 license
-rwxr-xr-x 1 root root  776 Sep  4 13:46 log.conf
drwxr-xr-x 2 root root 4096 Aug 29 20:11 master.d
-rwxr-xr-x 1 root root6 Sep  4 13:46 pool.conf
-rw--- 1 root root  110 Dec 30 17:52 ptoken
drwxr-xr-x 2 root root 4096 Sep  4 13:46 scripts
-rwxr-xr-x 1 root root  199 Sep  4 13:46 xapi.conf
-rwxr-xr-x 1 root root  172 Sep  4 13:46 xapi-ssl.conf
-r 1 root root 1286 Dec 30 17:52 xapi-ssl.pem
-rwxr-xr-x 1 root root9 Sep  4 13:46 xsdata_allowed_prefix

thanks





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


Re: [libvirt] [PATCH] avoid syntax-check (po-check) failure due to FP match on gettext.m4

2009-01-06 Thread Daniel Veillard
On Tue, Jan 06, 2009 at 09:46:03AM +, Daniel P. Berrange wrote:
 On Tue, Jan 06, 2009 at 10:44:41AM +0100, Jim Meyering wrote:
  spotted by Dan Berrange
  and the autobuilder

  http://builder.virt-manager.org/logs/modules/libvirt--devel-build-output.log
  
  From ee91ab81dbd458078df39ef52e22e9a489d5cc72 Mon Sep 17 00:00:00 2001
  From: Jim Meyering meyer...@redhat.com
  Date: Tue, 6 Jan 2009 10:42:29 +0100
  Subject: [PATCH] avoid syntax-check (po-check) failure due to FP match on 
  gettext.m4
 
 ACK

 +1

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] Libvirt - Xen Enterprise - Koan

2009-01-06 Thread Daniel P. Berrange
On Tue, Jan 06, 2009 at 10:41:40AM +, Tom Brown wrote:
 
 I've not tried it, but the likely problem is that you'll need to turn
 on XenD's  UNIX server config option in /etc/xen/xend-config.sxp
 
   http://libvirt.org/drvxen.html
 
   
 
 Thanks for this - this sounds like the most likely issue. The problem is 
 that Citrix seems to move things around somewhat as that config file 
 does not exist. There is a xensource directory that contains the 
 following but other than that i am a bit stuck.

They might have overriden the config file to point somewhere else.
Try and find the file  XendOptions.py and see where it loads the
config from. Or see if anything sets $XEND_CONFIG env variable at
startup. In regular upstream xen code, it XendOptions.py has:

  class XendOptionsFile(XendOptions):

  Default path to the config file.
  config_default = /etc/xen/xend-config.sxp


Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.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


[libvirt] [PATCH] dist: distribute all libvirt_*.syms files, ...

2009-01-06 Thread Jim Meyering
Some of the new libvirt_*.syms files were
included in EXTRA_DIST only conditionally.
Here's the fix:

From 272938681646e3aeefe5d9b13fab312a47e5d862 Mon Sep 17 00:00:00 2001
From: Jim Meyering meyer...@redhat.com
Date: Tue, 6 Jan 2009 12:09:40 +0100
Subject: [PATCH] dist: distribute all libvirt_*.syms files, ...

* src/Makefile.am (EXTRA_DIST): Distribute all libvirt_*.syms files,
not just those that happen to be selected at configure time.
---
 src/Makefile.am |   22 ++
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 1f707e2..b3020cc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -192,7 +192,7 @@ libvirt_driver_la_SOURCES = 
\
 libvirt_driver_la_CFLAGS = $(XEN_CFLAGS) $(NUMACTL_CFLAGS)
 libvirt_driver_la_LDFLAGS = $(XEN_LIBS) $(NUMACTL_LIBS)

-PRIVSYMFILES = libvirt_private.syms
+USED_SYM_FILES = libvirt_private.syms

 if WITH_TEST
 if WITH_DRIVER_MODULES
@@ -412,31 +412,37 @@ EXTRA_DIST += 
\
 #

 if ENABLE_DEBUG
-PRIVSYMFILES += libvirt_debug.syms
+USED_SYM_FILES += libvirt_debug.syms
 endif

 if WITH_DRIVER_MODULES
-PRIVSYMFILES += libvirt_driver_modules.syms
+USED_SYM_FILES += libvirt_driver_modules.syms
 endif

 if WITH_BRIDGE
-PRIVSYMFILES += libvirt_bridge.syms
+USED_SYM_FILES += libvirt_bridge.syms
 endif

 if WITH_LINUX
-PRIVSYMFILES += libvirt_linux.syms
+USED_SYM_FILES += libvirt_linux.syms
 endif

-EXTRA_DIST += libvirt_public.syms $(PRIVSYMFILES)
+EXTRA_DIST += \
+  libvirt_public.syms  \
+  libvirt_private.syms \
+  libvirt_debug.syms   \
+  libvirt_driver_modules.syms  \
+  libvirt_bridge.syms  \
+  libvirt_linux.syms

-libvirt.syms: libvirt_public.syms $(PRIVSYMFILES)
+libvirt.syms: libvirt_public.syms $(USED_SYM_FILES)
rm -f $...@-tmp $@
printf '# WARNING: generated from the following:\n# $^\n\n' $...@-tmp
cat $(srcdir)/libvirt_public.syms $...@-tmp
printf '\n\n# Private symbols\n\n' $...@-tmp
printf 'LIBVIRT_PRIVATE_$(VERSION) {\n\n'  $...@-tmp
printf 'global:\n\n' $...@-tmp
-   for file in $(PRIVSYMFILES); do \
+   for file in $(USED_SYM_FILES); do \
cat $(srcdir)/$$file $...@-tmp; \
done
printf '\n\nlocal:\n*;\n\n};' $...@-tmp
--
1.6.1.rc3.350.g541da

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


[libvirt] Libvirt - Xen Enterprise - Koan

2009-01-06 Thread Gerhardus.Geldenhuis
Hi
I hope me replying this way does not break anyone's mail sorting, I
only now subscribed to the list.


 Thanks for this - this sounds like the most likely issue. The problem
is 
 that Citrix seems to move things around somewhat as that config file 
 does not exist. There is a xensource directory that contains the 
 following but other than that i am a bit stuck.

They might have overriden the config file to point somewhere else.
Try and find the file  XendOptions.py and see where it loads the
config from. Or see if anything sets $XEND_CONFIG env variable at
startup. In regular upstream xen code, it XendOptions.py has:

  class XendOptionsFile(XendOptions):

  Default path to the config file.
  config_default = /etc/xen/xend-config.sxp


I did a find . -name *.py  temp.gg

and then

  141  cat temp.gg | xargs grep -i xendoptions
  142  cat temp.gg | xargs grep -i xend
  144  cat temp.gg | xargs grep -i XEND_CONFIG
  148  cat temp.gg | xargs grep -i config_default

All of these searches gave me absolutely no results.

I am sure that the config files are in :
/etc/xensource/
xapi.conf
xapi-ssl.conf

the contents of xapi.conf is:
schema_filename = /etc/xensource/db_schema.sql
license_filename = /etc/xensource/license
http-port = 80
use-ssl = true
ssl-cert = /etc/ssl/certs/xensource-rio.pem
ssl-port = 443
# dom0-mem = 128

and of xapi-ssl.conf is:
pid = /var/run/xapi.ssl.pid
socket = r:TCP_NODELAY=1
socket = a:TCP_NODELAY=1
socket = l:TCP_NODELAY=1

[xapi]
accept = 443
connect = 80
cert = /etc/xensource/xapi-ssl.pem

I am thinking that maybe only ssl connections are allowed ... which is
why virsh can't connect?


we are running XenServer release 4.1.0-7843p (xenenterprise) and I am
trying to get spacewalk to get the necessary domain details when
registering a xen host. 


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

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


[libvirt] RE: Libvirt - Xen Enterprise - Koan

2009-01-06 Thread Gerhardus.Geldenhuis
No it does not use xend.

 -Original Message-
 From: David Edmondson [mailto:d...@dme.org] On Behalf Of David
Edmondson
 Sent: 06 January 2009 11:53
 To: Gerhardus Geldenhuis (GTA-LON)
 Cc: libvir-list@redhat.com
 Subject: Re: Libvirt - Xen Enterprise - Koan
 
 There's an assumption that XenEnterprise actually uses xend. Is that
 the case? ('ps' might tell you)
 
 dme.
 --
 David Edmondson, Sun Microsystems, http://dme.org

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

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


Re: [libvirt] RE: Libvirt - Xen Enterprise - Koan

2009-01-06 Thread Daniel P. Berrange
On Tue, Jan 06, 2009 at 11:57:34AM -, gerhardus.geldenh...@gta-travel.com 
wrote:
 No it does not use xend.

That's pretty much game over then. Someone will have to write a new
libvirt driver specifically for XenEnterprise to get it to work.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.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] RE: Libvirt - Xen Enterprise - Koan

2009-01-06 Thread Tom Brown

Daniel P. Berrange wrote:

On Tue, Jan 06, 2009 at 11:57:34AM -, gerhardus.geldenh...@gta-travel.com 
wrote:
  

No it does not use xend.



  


# ps auxwww | grep xen
root21  0.0  0.0  0 0 ?S2008   0:00 [xenwatch]
root22  0.0  0.0  0 0 ?S2008   0:00 [xenbus]
root  5240  0.0  0.1   2076   908 ?S 2008   0:00 
/usr/sbin/xenstored
root  5243  0.0  0.0  12232   532 ?Sl2008   0:00 
/usr/sbin/xenconsoled
root  5254  0.0  0.0   2608   444 ?S 2008   0:00 
/opt/xensource/libexec/cdrommon /dev/xapi/cd/hda
root  5269  0.0  0.4  19156  3800 ?S2008   0:00 
/opt/xensource/bin/xapi -daemon -writereadyfile 
/var/run/xapi_startup.cookie -writeinitcomplete 
/var/run/xapi_init_complete.cookie -onsystemboot
root  5271  0.0  1.3 178612 10056 ?Sl   2008   1:00 
/opt/xensource/bin/xapi -daemon -writereadyfile 
/var/run/xapi_startup.cookie -writeinitcomplete 
/var/run/xapi_init_complete.cookie -onsystemboot
root  5561  0.0  0.4  21580  3720 ?Sl2008   0:00 python 
/opt/xensource/sm/snapwatchd/snapwatchd -d /var/log/SMlog
root  6181  0.0  0.7  12380  5592 ?Ss2008   1:19 python 
/opt/xensource/bin/perfmon --daemon
root  6405  0.0  0.1   4756  1524 ?Ss2008   0:00 
/usr/lib/xen/bin/vncterm -v 127.0.0.1 -r -x /local/domain/0/serial/0 -c 
/usr/lib/xen/bin/dom0term.sh
root 10301  0.0  0.1   2424  1024 pts/0Ss+  Jan05   0:00 
/bin/bash /usr/lib/xen/bin/dom0term.sh



That's pretty much game over then. Someone will have to write a new
libvirt driver specifically for XenEnterprise to get it to work.


  


damn - that really scuppers me trying to forge ahead with the cobbler 
route as XenEnterprise will be around here for a while much to my annoyance.


Is that really it ?


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


[libvirt] Re: Libvirt - Xen Enterprise - Koan

2009-01-06 Thread David Edmondson
There's an assumption that XenEnterprise actually uses xend. Is that
the case? ('ps' might tell you)

dme.
-- 
David Edmondson, Sun Microsystems, http://dme.org

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


RE: [libvirt] RE: Libvirt - Xen Enterprise - Koan

2009-01-06 Thread Gerhardus.Geldenhuis
Damm, 
Well at least a conclusive answer. I am assuming it would be relatively
big undertaking to write a new driver?

Regards

 -Original Message-
 From: libvir-list-boun...@redhat.com [mailto:libvir-list-
 boun...@redhat.com] On Behalf Of Daniel P. Berrange
 Sent: 06 January 2009 12:00
 To: Gerhardus Geldenhuis (GTA-LON)
 Cc: libvir-list@redhat.com
 Subject: Re: [libvirt] RE: Libvirt - Xen Enterprise - Koan
 
 On Tue, Jan 06, 2009 at 11:57:34AM -, gerhardus.geldenh...@gta-
 travel.com wrote:
  No it does not use xend.
 
 That's pretty much game over then. Someone will have to write a new
 libvirt driver specifically for XenEnterprise to get it to work.
 
 Daniel
 --
 |: Red Hat, Engineering, London   -o-
 http://people.redhat.com/berrange/ :|
 |: http://libvirt.org  -o-  http://virt-manager.org  -o-
 http://ovirt.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

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

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


Re: [libvirt] [PATCH] save state as string

2009-01-06 Thread Daniel Veillard
On Mon, Dec 29, 2008 at 03:44:54PM +0100, Guido Günther wrote:
 Hi,
 current domstatus code saves the domain as number, attached patch safes
 it as string which looks a bit nicer.
[...]
 @@ -1414,7 +1416,9 @@ qemudDomainStatusFormat(virConnectPtr conn,
  char *config_xml = NULL, *xml = NULL;
  virBuffer buf = VIR_BUFFER_INITIALIZER;
  
 -virBufferVSprintf(buf, domstatus state='%d' pid='%d'\n, vm-state, 
 vm-pid);
 +virBufferVSprintf(buf, domstatus state='%s' pid='%d'\n,
 +  virDomainStateTypeToString(vm-state),
 +  vm-pid);
  virBufferEscapeString(buf,   monitor path='%s'/\n, vm-monitorpath);
  
  if (!(config_xml = virDomainDefFormat(conn,

  Hum, I have 2 objections to this patch:
- seems we keep a string value internally in the structure, I don't
  see the benefit, or maybe I misunderstood.
- second more important is that we change the XML interface, that we
  can't do, maybe we can extend it to provide a stateinfo=%s
  along the state='%d', but we can't just break code which may rely
  on the existing format.

 maybe I missed something though,

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] [PATCH] split out logfile opening

2009-01-06 Thread Daniel Veillard
On Mon, Jan 05, 2009 at 07:52:26AM +0100, Jim Meyering wrote:
 Guido Günther a...@sigxcpu.org wrote:
  attached patch splits out the qemu logfile opening into a separate
  function which makes the code a bit more readable and I'll need this for
  the libvirtd restart code.
 ...
  +static int
  +qemudLogFD(virConnectPtr conn, const char* logDir, const char* name)
  +{
  +char logfile[PATH_MAX];
  +mode_t logmode;
  +uid_t uid = geteuid();
  +int fd = -1;
  +
  +if ((strlen(logDir) + /* path */
  + 1 + /* Separator */
  + strlen(name) + /* basename */
  + 4 + /* suffix .log */
  + 1 /* NULL */)  PATH_MAX) {
  +qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
  + _(config file path too long: %s/%s.log),
  + logDir, name);
  +return -1;
  +}
  +
  +strcpy(logfile, logDir);
  +strcat(logfile, /);
  +strcat(logfile, name);
  +strcat(logfile, .log);
 
 Since this is just moving code, ok.
 Otherwise, I'd ask that the strlen check and strcpy/strcat
 calls be replaced by a single checked snprintf call, using
 sizeof logfile as the length, rather than duplicating PATH_MAX.

  I agree with Jim,

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] [PATCH] dist: distribute all libvirt_*.syms files, ...

2009-01-06 Thread Daniel Veillard
On Tue, Jan 06, 2009 at 12:11:42PM +0100, Jim Meyering wrote:
 Some of the new libvirt_*.syms files were
 included in EXTRA_DIST only conditionally.

  Yes we need all the remaining sym files to be embedded in the
distribution, +1

  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] RE: Libvirt - Xen Enterprise - Koan

2009-01-06 Thread Daniel Veillard
On Tue, Jan 06, 2009 at 12:08:14PM -, gerhardus.geldenh...@gta-travel.com 
wrote:
 Damm, 
 Well at least a conclusive answer. I am assuming it would be relatively
 big undertaking to write a new driver?

  No idea, look at other drivers, some are simple enough, others are
more complex. But basically since it's not open-source the amount
of interested people will shink, there is also the problem of connecting
libvirt and the XenE management depending on the Licencing terms of
their own stack. It's not game over, but it sounds like restarting from
scratch...

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] PATCH: Fix Windows / mingw32 build

2009-01-06 Thread Daniel Veillard
On Tue, Jan 06, 2009 at 12:48:00PM +, Daniel P. Berrange wrote:
 There are a number of problems breaking the windows / mingw
 build currently.
 
  - Use of 'close' without importing unistd.h
  - Use of non-existant localtime_r

  oops :-)

  - ERROR macro from logging.h clashes with a symbol imported
from windows.h

  oh, crap, okay we need a namespaced one

 So this patch does
 
  - Adds the missing unistd.h include
  - Uses localtime() if localtime_r() is missing (as checked from
configure)
  - Adds a VIR_ prefix onto all logging macros, keeping
DEBUG() around because its just used in so many
places
 
 The use of localtime() on Windows is OK, because the MicroSoft
 implementation of this uses thread-local storage:
 
   http://msdn.microsoft.com/en-us/library/a442x3ye.aspx
 
 And all other OS we care about have localtime_r
 
 Finally I fix a few compile warnings, so that Mingw can now be
 built  with --enable-compile-warnings=error to detect these 
 problems more quickly in future.

  Patch looks fine. But I spotted we still use strerror, I though
this had to be discarded because it wasn't thread-safe ?

  +1

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] PATCH: Fix Windows / mingw32 build

2009-01-06 Thread Daniel P. Berrange
On Tue, Jan 06, 2009 at 03:41:49PM +0100, Daniel Veillard wrote:
 On Tue, Jan 06, 2009 at 12:48:00PM +, Daniel P. Berrange wrote:
  There are a number of problems breaking the windows / mingw
  build currently.
  
   - Use of 'close' without importing unistd.h
   - Use of non-existant localtime_r
 
   oops :-)
 
   - ERROR macro from logging.h clashes with a symbol imported
 from windows.h
 
   oh, crap, okay we need a namespaced one
 
  So this patch does
  
   - Adds the missing unistd.h include
   - Uses localtime() if localtime_r() is missing (as checked from
 configure)
   - Adds a VIR_ prefix onto all logging macros, keeping
 DEBUG() around because its just used in so many
 places
  
  The use of localtime() on Windows is OK, because the MicroSoft
  implementation of this uses thread-local storage:
  
http://msdn.microsoft.com/en-us/library/a442x3ye.aspx
  
  And all other OS we care about have localtime_r
  
  Finally I fix a few compile warnings, so that Mingw can now be
  built  with --enable-compile-warnings=error to detect these 
  problems more quickly in future.
 
   Patch looks fine. But I spotted we still use strerror, I though
 this had to be discarded because it wasn't thread-safe ?

I've got a large patch to remove most of those uses coming soon...

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.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] dist: distribute all libvirt_*.syms files, ...

2009-01-06 Thread Jim Meyering
Daniel Veillard veill...@redhat.com wrote:
 On Tue, Jan 06, 2009 at 12:11:42PM +0100, Jim Meyering wrote:
 Some of the new libvirt_*.syms files were
 included in EXTRA_DIST only conditionally.

   Yes we need all the remaining sym files to be embedded in the
 distribution, +1

Thanks. committed.

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


[libvirt] [PATCH] fix make dist (from scratch) failure

2009-01-06 Thread Jim Meyering
Daniel Veillard noticed that make dist would fail
when run from a clean source directory, due to our
attempt to distribute a no-longer-generated file.

I've committed this:

From 97e99d702dbb15176177bfd2055632ee6fdb6491 Mon Sep 17 00:00:00 2001
From: Jim Meyering meyer...@redhat.com
Date: Tue, 6 Jan 2009 16:21:24 +0100
Subject: [PATCH] fix make dist (from scratch) failure

* src/Makefile.am (EXTRA_DIST): Don't distribute libvirt_sym.version,
now that it's been removed.  Spotted by Daniel Veillard.
---
 src/Makefile.am |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index b3020cc..dd7dea8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,7 +28,7 @@ ICON_FILES = \
libvirt_win_icon_64x64.ico \
virsh_win_icon.rc

-EXTRA_DIST = libvirt_sym.version $(conf_DATA) $(ICON_FILES)
+EXTRA_DIST = $(conf_DATA) $(ICON_FILES)


 lib_LTLIBRARIES = libvirt.la
--
1.6.1.121.g866a4a

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


Re: [libvirt] PATCH: Fix Windows / mingw32 build

2009-01-06 Thread Jim Meyering
Daniel P. Berrange berra...@redhat.com wrote:
 There are a number of problems breaking the windows / mingw
 build currently.

  - Use of 'close' without importing unistd.h
  - Use of non-existant localtime_r
  - ERROR macro from logging.h clashes with a symbol imported
from windows.h

 So this patch does

  - Adds the missing unistd.h include
  - Uses localtime() if localtime_r() is missing (as checked from
configure)

That all looks fine.
However, since there's an LGPLv2+ gnulib module that provides
localtime_r (called time_r) you may want to skip that part.
Or just go ahead with what you have and I'll undo
things when I've confirmed pulling in the new module works
as expected.

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


Re: [libvirt] [PATCH] save state as string

2009-01-06 Thread Guido Günther
On Tue, Jan 06, 2009 at 03:27:52PM +0100, Daniel Veillard wrote:
 On Mon, Dec 29, 2008 at 03:44:54PM +0100, Guido Günther wrote:
  Hi,
  current domstatus code saves the domain as number, attached patch safes
  it as string which looks a bit nicer.
 [...]
  @@ -1414,7 +1416,9 @@ qemudDomainStatusFormat(virConnectPtr conn,
   char *config_xml = NULL, *xml = NULL;
   virBuffer buf = VIR_BUFFER_INITIALIZER;
   
  -virBufferVSprintf(buf, domstatus state='%d' pid='%d'\n, 
  vm-state, vm-pid);
  +virBufferVSprintf(buf, domstatus state='%s' pid='%d'\n,
  +  virDomainStateTypeToString(vm-state),
  +  vm-pid);
   virBufferEscapeString(buf,   monitor path='%s'/\n, 
  vm-monitorpath);
   
   if (!(config_xml = virDomainDefFormat(conn,
 
   Hum, I have 2 objections to this patch:
 - seems we keep a string value internally in the structure, I don't
   see the benefit, or maybe I misunderstood.
Currently we have state='1' for running, with this patch this reads
state='running' which is better readable.

 - second more important is that we change the XML interface, that we
   can't do, maybe we can extend it to provide a stateinfo=%s
   along the state='%d', but we can't just break code which may rely
   on the existing format.
The file we write is /var/run/libvirt/qemu/*.xml where we keep the
internal state of a running vm. We can change this at at any time.
Cheers,
 -- Guido

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


Re: [libvirt] [PATCH] split out logfile opening

2009-01-06 Thread Guido Günther
On Tue, Jan 06, 2009 at 03:28:59PM +0100, Daniel Veillard wrote:
 On Mon, Jan 05, 2009 at 07:52:26AM +0100, Jim Meyering wrote:
  Guido Günther a...@sigxcpu.org wrote:
   attached patch splits out the qemu logfile opening into a separate
   function which makes the code a bit more readable and I'll need this for
   the libvirtd restart code.
  ...
   +static int
   +qemudLogFD(virConnectPtr conn, const char* logDir, const char* name)
   +{
   +char logfile[PATH_MAX];
   +mode_t logmode;
   +uid_t uid = geteuid();
   +int fd = -1;
   +
   +if ((strlen(logDir) + /* path */
   + 1 + /* Separator */
   + strlen(name) + /* basename */
   + 4 + /* suffix .log */
   + 1 /* NULL */)  PATH_MAX) {
   +qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
   + _(config file path too long: %s/%s.log),
   + logDir, name);
   +return -1;
   +}
   +
   +strcpy(logfile, logDir);
   +strcat(logfile, /);
   +strcat(logfile, name);
   +strcat(logfile, .log);
  
  Since this is just moving code, ok.
  Otherwise, I'd ask that the strlen check and strcpy/strcat
  calls be replaced by a single checked snprintf call, using
  sizeof logfile as the length, rather than duplicating PATH_MAX.
 
   I agree with Jim,
I only copied the code into a separate function but I can fix this up
too while at it.
 -- Guido

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


Re: [libvirt] [PATCH] split out logfile opening

2009-01-06 Thread Jim Meyering
Guido Günther a...@sigxcpu.org wrote:
 On Tue, Jan 06, 2009 at 03:28:59PM +0100, Daniel Veillard wrote:
 On Mon, Jan 05, 2009 at 07:52:26AM +0100, Jim Meyering wrote:
  Guido Günther a...@sigxcpu.org wrote:
   attached patch splits out the qemu logfile opening into a separate
   function which makes the code a bit more readable and I'll need this for
   the libvirtd restart code.
  ...
   +static int
   +qemudLogFD(virConnectPtr conn, const char* logDir, const char* name)
   +{
   +char logfile[PATH_MAX];
   +mode_t logmode;
   +uid_t uid = geteuid();
   +int fd = -1;
   +
   +if ((strlen(logDir) + /* path */
   + 1 + /* Separator */
   + strlen(name) + /* basename */
   + 4 + /* suffix .log */
   + 1 /* NULL */)  PATH_MAX) {
   +qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
   + _(config file path too long: %s/%s.log),
   + logDir, name);
   +return -1;
   +}
   +
   +strcpy(logfile, logDir);
   +strcat(logfile, /);
   +strcat(logfile, name);
   +strcat(logfile, .log);
 
  Since this is just moving code, ok.
  Otherwise, I'd ask that the strlen check and strcpy/strcat
  calls be replaced by a single checked snprintf call, using
  sizeof logfile as the length, rather than duplicating PATH_MAX.

   I agree with Jim,
 I only copied the code into a separate function but I can fix this up
 too while at it.

Thanks!
IMHO, committing your patch as-is, and then making the
suggested change in a separate change set would be fine.
Maybe even a little better, since it's easier to see
what's happening when one doesn't mix code-movement
changes with real changes.

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


Re: [libvirt] 5 minor cleanups

2009-01-06 Thread Guido Günther
On Mon, Jan 05, 2009 at 08:00:56AM +0100, Jim Meyering wrote:
 Guido Günther a...@sigxcpu.org wrote:
  these accumulated over time. O.k. to apply?
 
 Those all look fine.
 
 From 35569e95febc37818998cd1834099090a3cf852d Mon Sep 17 00:00:00 2001
  From: =?utf-8?q?Guido=20G=C3=BCnther?= a...@sigxcpu.org
  Date: Mon, 22 Dec 2008 22:26:03 +0100
  Subject: [PATCH] fix name
 
  changes AUTHORS file to utf8
  ---
   AUTHORS |2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)
 
  diff --git a/AUTHORS b/AUTHORS
  index a8ec325..6cc3a69 100644
  --- a/AUTHORS
  +++ b/AUTHORS
  @@ -20,7 +20,7 @@ The primary maintainers and people with commit access 
  rights:
 Dave Leskovecdle...@linux.vnet.ibm.com
 Cole Robinsoncrobi...@redhat.com
 Dan Smithda...@us.ibm.com
  -  Guido Guenther   a...@sigxcpu.org
  +  Guido Günthera...@sigxcpu.org
 
 
 You might want to add this at the end,
 to help ensure we use a consistent encoding.
 
 ;; Local Variables:
 ;; coding: utf-8
 ;; End:
Applied with your suggestion.
 -- Guido

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


Re: [PATCH] virKillProcess [was Re: [libvirt] [PATCH 2/5] daemonize qemu processes]

2009-01-06 Thread Guido Günther
On Mon, Jan 05, 2009 at 09:58:06AM +, Daniel P. Berrange wrote:
 On Mon, Dec 29, 2008 at 03:36:15PM +0100, Guido G?nther wrote:
  On Mon, Dec 15, 2008 at 02:22:42PM +0100, Daniel Veillard wrote:
   On Mon, Dec 15, 2008 at 11:21:20AM +, Daniel P. Berrange wrote:
On Fri, Dec 12, 2008 at 07:26:32PM +0100, Guido G?nther wrote:
 +if (kill(vm-pid, SIGTERM)  0)
 +qemudLog(QEMUD_ERROR, _(Failed to send SIGTERM to %s (%d): 
 %s\n),
 + vm-def-name, vm-pid, strerror(errno));

We should add a guard around all the kill() statements for

  if (vm-pid  1)
 kill..

One of the bugs I found when doing the LXC/UML drivers is that when 
relying 
on an external PID file, some things can go wrong in unexpected ways 
that
just don't happen when getting the PID straight back from fork. This 
often
ended up with vm-pid being -1, 0 with horrific results - 

   If  pid equals -1, then sig is sent to every process for which the 
calling
process has permission to send signals, except for process 1 (init)

Yes, I killed every single process on my dev machine several times 
before
discovering this isues :-)
   
 This call for an utility function
   int virKillProcess(pid_t pid, int sig)
   call checking for this, could also help on debugging/logging
  O.k. to apply the attached version of virKillProcess? I'm already using
  this in the libvirtd restart patches.
 
 ACK
Applied. 
 -- Guido

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


Re: [libvirt] [PATCH] save state as string

2009-01-06 Thread Daniel P. Berrange
On Tue, Jan 06, 2009 at 04:38:50PM +0100, Guido G?nther wrote:
 On Tue, Jan 06, 2009 at 03:27:52PM +0100, Daniel Veillard wrote:
  On Mon, Dec 29, 2008 at 03:44:54PM +0100, Guido Günther wrote:
   Hi,
   current domstatus code saves the domain as number, attached patch safes
   it as string which looks a bit nicer.
  [...]
   @@ -1414,7 +1416,9 @@ qemudDomainStatusFormat(virConnectPtr conn,
char *config_xml = NULL, *xml = NULL;
virBuffer buf = VIR_BUFFER_INITIALIZER;

   -virBufferVSprintf(buf, domstatus state='%d' pid='%d'\n, 
   vm-state, vm-pid);
   +virBufferVSprintf(buf, domstatus state='%s' pid='%d'\n,
   +  virDomainStateTypeToString(vm-state),
   +  vm-pid);
virBufferEscapeString(buf,   monitor path='%s'/\n, 
   vm-monitorpath);

if (!(config_xml = virDomainDefFormat(conn,
  
Hum, I have 2 objections to this patch:
  - seems we keep a string value internally in the structure, I don't
see the benefit, or maybe I misunderstood.
 Currently we have state='1' for running, with this patch this reads
 state='running' which is better readable.
 
  - second more important is that we change the XML interface, that we
can't do, maybe we can extend it to provide a stateinfo=%s
along the state='%d', but we can't just break code which may rely
on the existing format.
 The file we write is /var/run/libvirt/qemu/*.xml where we keep the
 internal state of a running vm. We can change this at at any time.

Yes  no, but mostly no.

These persistent state files will need to be stable across releases of
libvirt, to allow sensible live upgrade path for hosts. eg, you're
running libvirtd with several VMs, upgrade to latest RPM which does
a 'service libvirtd restart' in the %post install section. The new 
libvirtd needs to cope with the state file created by the old libvirtd.

In this particular case though, its not problem changing state=1 to
state=running, since we've not released this code yet and the named
attribute is nicer to read.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.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] fix make dist (from scratch) failure

2009-01-06 Thread John Levon
On Tue, Jan 06, 2009 at 04:25:32PM +0100, Jim Meyering wrote:

 I've committed this:

Thanks, and sorry for getting this wrong.

regards
john

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


Re: [libvirt] PATCH: Fix Windows / mingw32 build

2009-01-06 Thread Daniel P. Berrange
On Tue, Jan 06, 2009 at 04:38:12PM +0100, Jim Meyering wrote:
 Daniel P. Berrange berra...@redhat.com wrote:
  There are a number of problems breaking the windows / mingw
  build currently.
 
   - Use of 'close' without importing unistd.h
   - Use of non-existant localtime_r
   - ERROR macro from logging.h clashes with a symbol imported
 from windows.h
 
  So this patch does
 
   - Adds the missing unistd.h include
   - Uses localtime() if localtime_r() is missing (as checked from
 configure)
 
 That all looks fine.
 However, since there's an LGPLv2+ gnulib module that provides
 localtime_r (called time_r) you may want to skip that part.
 Or just go ahead with what you have and I'll undo
 things when I've confirmed pulling in the new module works
 as expected.

I committed everything except the localtime_r() change...

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.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: Fix Windows / mingw32 build

2009-01-06 Thread Jim Meyering
Jim Meyering j...@meyering.net wrote:
 Daniel P. Berrange berra...@redhat.com wrote:
 On Tue, Jan 06, 2009 at 04:38:12PM +0100, Jim Meyering wrote:
 Daniel P. Berrange berra...@redhat.com wrote:
  There are a number of problems breaking the windows / mingw
  build currently.
 
   - Use of 'close' without importing unistd.h
   - Use of non-existant localtime_r
   - ERROR macro from logging.h clashes with a symbol imported
 from windows.h
 
  So this patch does
 
   - Adds the missing unistd.h include
   - Uses localtime() if localtime_r() is missing (as checked from
 configure)

 That all looks fine.
 However, since there's an LGPLv2+ gnulib module that provides
 localtime_r (called time_r) you may want to skip that part.
 Or just go ahead with what you have and I'll undo
 things when I've confirmed pulling in the new module works
 as expected.

 I committed everything except the localtime_r() change...

 Thanks.
 Here's the change to pull in the time_r module
 and to update gnulib to the latest.

 I tested by applying the patch to a clean directory
 and ensuring that autobuild.sh's mingw build succeeds.
 It also passed make distcheck on a rawhide x86_64 system.

Daniel Berrange ACK'd this privately, so I've just committed it.

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


[libvirt] PATCH: Implement virKill for Windows

2009-01-06 Thread Daniel P. Berrange
The addition of virKill to src/util.c breaks Windows build which lacks the
kill() function. Now we technically don't have any code which runs virKill
when built on Windows, but after the 2 weeks holiday I'm very motivated so
wrote a basic implement of virKill() which is a starting point for Win32
in case we need it based on the recommendations in this thread

  http://www.nabble.com/kill-signal-td149789.html

Seems Perl does much the same for its kill() implement on Win32 (and is
even more thorough/complete), though we can't just use the Perl code 
directly since its  GPL licensed. So I've done a minimal stub

Daniel


Index: src/util.c
===
RCS file: /data/cvs/libvirt/src/util.c,v
retrieving revision 1.78
diff -u -p -u -p -r1.78 util.c
--- src/util.c  6 Jan 2009 17:46:46 -   1.78
+++ src/util.c  6 Jan 2009 20:47:09 -
@@ -1346,5 +1346,50 @@ int virKillProcess(pid_t pid, int sig)
 return -1;
 }
 
+#ifdef WIN32
+/* Mingw / Windows don't have many signals (AFAIK) */
+switch (sig) {
+case SIGINT:
+/* This does a Ctrl+C equiv */
+if (!GenerateConsoleCtrlEvent(CTRL_C_EVENT, pid)) {
+errno = ESRCH;
+return -1;
+}
+break;
+
+case SIGTERM:
+/* Since TerminateProcess is closer to SIG_KILL, we do
+ * a Ctrl+Break equiv which is more pleasant like the
+ * good old unix SIGTERM/HUP
+ */
+if (!GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, pid)) {
+errno = ESRCH;
+return -1;
+}
+break;
+
+default:
+{
+HANDLE proc;
+proc = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
+if (!proc) {
+errno = ESRCH; /* Not entirely accurate, but close enough */
+return -1;
+}
+
+/*
+ * TerminateProcess is more or less equiv to SIG_KILL, in that
+ * a process can't trap / block it
+ */
+if (!TerminateProcess(proc, sig)) {
+errno = ESRCH;
+return -1;
+}
+CloseHandle(proc);
+}
+}
+return 0;
+#else
 return kill(pid, sig);
+#endif
 }

-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.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] RE: Libvirt - Xen Enterprise - Koan

2009-01-06 Thread Michael DeHaan

Daniel Veillard wrote:

On Tue, Jan 06, 2009 at 12:08:14PM -, gerhardus.geldenh...@gta-travel.com 
wrote:
  
Damm, 
Well at least a conclusive answer. I am assuming it would be relatively

big undertaking to write a new driver?



  No idea, look at other drivers, some are simple enough, others are
more complex. But basically since it's not open-source the amount
of interested people will shink, there is also the problem of connecting
libvirt and the XenE management depending on the Licencing terms of
their own stack. It's not game over, but it sounds like restarting from
scratch...

Daniel

  


Ouch, no xend?

Another option is for someone to add another additional virt-type to 
koan and install it some other way (wrap xm create?), but I agree, if 
it's not open source it's not that interesting for many of us to work 
on, so it runs the risk of going unmaintained unless you'd want to own 
it. (We do some of that for VMware already -- see koan's source tree for 
details)


--Michael

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


Re: [libvirt] RE: Libvirt - Xen Enterprise - Koan

2009-01-06 Thread Atsushi SAKAI
Hello,

  Just one question.
  How about using XenAPI for XenEnterprise?
I am not familiar with XenEnterprise.
But It should have some API for a developer.

Thanks
Atsushi SAKAI


Daniel Veillard veill...@redhat.com wrote:

 On Tue, Jan 06, 2009 at 12:08:14PM -, gerhardus.geldenh...@gta-travel.com 
 wrote:
  Damm, 
  Well at least a conclusive answer. I am assuming it would be relatively
  big undertaking to write a new driver?
 
   No idea, look at other drivers, some are simple enough, others are
 more complex. But basically since it's not open-source the amount
 of interested people will shink, there is also the problem of connecting
 libvirt and the XenE management depending on the Licencing terms of
 their own stack. It's not game over, but it sounds like restarting from
 scratch...
 
 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


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