Re: [Libvir] Libvirt on windows
by Richard W.M. Jones
Gabriel Kaufmann wrote:
> I want to be able to connect to the Xen server using libvirt [...]
And yes, connecting to a remote Xen server from Windows should work. At
least, it does for me. The server must be running libvirtd, and you
will need to specify a remote connection URI such as xen+tcp://server/
(see http://libvirt.org/remote.html).
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
16 years, 11 months
Re: [Libvir] Libvirt on windows
by Richard W.M. Jones
Gabriel Kaufmann wrote:
> Hi,
>
> I'm still unable to build (see output files attached). This is from the sources I downloaded from ftp://libvirt.org/libvirt/libvirt-cvs-snapshot.tar.gz
>
> When running configure I get a popup error message that libconf-2.dll is missing. Looking at MinGW site, I found version 1.11 of libconv. Do I have to use a later version? If yes where can I find it.
>
> I'm having problem understanding which libraries and versions I should use for the compilation.
> Do you have a more detailed list of packages to install in MinGW.
> If you can send me this lis, I'll start from the beginning using a new (clean) XP installation.
>
> Can I just use the binaries compiled in https://www.redhat.com/archives/libvir-list/2008-January/msg00072.html ?
> I want to be able to connect to the Xen server using libvirt from Microsoft Visual Studio using c/C++.
Sorry for late reply, I was on holiday yesterday.
For the build error, looks like a regression because of some recently
added / updated code. I'll have to boot up my Windows machine and take
a look.
Versions of the packages used:
MinGW & MSYS "candidate" versions (specifically, gcc 4 is required)
GnuTLS 1.6.3 (binary for Windows on their site)
Make sure you install it in a location _without_ a space in the path
(ie. not the default).
You have to hack the *.la files to correct the hard-coded paths.
libxml2 2.6.30
(I compiled from source, but there are also binaries available)
My PortableXDR library.
You should be able to use the binaries from that location. Within the
installer you'll find a 'libvirt.dll' + all the *.dll that it requires.
Supposedly this DLL will work on MS VC++, but obviously I haven't
tested this. The thing to do is to try it.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
16 years, 11 months
[Libvir] Re; virDomainBlockStats
by Gareth Bult
Hi,
I've a number of servers running XEN and am trying to write some code to monitor them through libvirt.
(Xeon/Dual Core/Ubuntu Gutsy/Xen 3.1)
All was going well until I got to virDomainBlockStats and it simply refused to accept my coding ..
My solution (the code now works) is to change the following;
src/stats_linux.c:
#ifndef XENVBD_MAJOR
#define XENVBD_MAJOR 3 // <--- I changed this!
/*#define XENVBD_MAJOR 202*/
#endif
device = XENVBD_MAJOR * 256 + 1 + minor /* * 16 */; <-- this too!
It now seems to give me some meaningful numbers without feeding my any error messages.
Can anyone tell me "why" I needed to do this?
I'm using "xvda" as the device path .. tried every other device name I could think of with out any good results ...
?????
tia
Gareth.
16 years, 11 months
Re: [Libvir] Re; virDomainBlockStats
by Gareth Bult
Mmm, Ok ..
I've pretty much spent the last week getting Xen 3.2 to function "properly" built entirely from raw XEN sources using Xen's documentation. AIO is still a flakey as hell, one time through the loop and the instance seems to work, second time around it won't start and neither will anything else.
I have file: based instances running just fine .. my guess is the unload problem is still there, but the kernel logging is
gone and they've created a critical system lock-up in it's place.
Is there any documentation to the effect that "file" is bad??
The official XEN documentation lists "file" as the standard and makes no mention of "aio".
Currently I'm mounting my image on gluster filesystems and I'm getting 70Mb/sec so I'm not unhappy with the performance, and I've had no issues recently with crashes. ... more information would be useful if you have it.
Whereas I'm happy to accept that aio is better in principle, as far as I can see although it may work for you, I've now tried it in a number of different configurations on a number of machines and it's simply unusable.
tia
Gareth.
----- Original Message -----
step 3.: "Daniel P. Berrange" <berrange(a)redhat.com>
To: "Gareth Bult" <gareth(a)encryptec.net>
Sent: 19 January 2008 17:50:01 o'clock (GMT) Europe/London
Subject: Re: [Libvir] Re; virDomainBlockStats
On Sat, Jan 19, 2008 at 05:18:58PM +0000, Gareth Bult wrote:
> Mmm,
>
> Interesting ..
>
> First off, xentop doesn't display block device stats for tap:aio based systems and it does for file.
> Second, tap:aio generated kernel Ooops's when you shutdown a DomU.
>
> Not exactly what I'd call mainstream (!)
That must be a flaw in Ubuntu's kernels. tap:aio works flawlessly
in Fedora / RHEL and is the only supported option, because file:
has catastrophic data loss issues during host crashes.
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
16 years, 11 months
FW: [Libvir] Libvirt on windows
by Gabriel Kaufmann
Hi,
I'm still unable to build (see output files attached). This is from the sources I downloaded from ftp://libvirt.org/libvirt/libvirt-cvs-snapshot.tar.gz
When running configure I get a popup error message that libconf-2.dll is missing. Looking at MinGW site, I found version 1.11 of libconv. Do I have to use a later version? If yes where can I find it.
I'm having problem understanding which libraries and versions I should use for the compilation.
Do you have a more detailed list of packages to install in MinGW.
If you can send me this lis, I'll start from the beginning using a new (clean) XP installation.
Can I just use the binaries compiled in https://www.redhat.com/archives/libvir-list/2008-January/msg00072.html ?
I want to be able to connect to the Xen server using libvirt from Microsoft Visual Studio using c/C++.
Gaby
-----Original Message-----
From: Richard W.M. Jones [mailto:rjones@redhat.com]
Sent: Thursday, January 24, 2008 3:33 PM
To: Gabriel Kaufmann; libvir-list
Subject: Re: [Libvir] Libvirt on windows
Of course the other thing to note is that we do have some very experimental libvirt.dll binaries available. The posting below has all the details:
https://www.redhat.com/archives/libvir-list/2008-January/msg00072.html
Don't let that stop you from trying to build it yourself ...
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
16 years, 11 months
[Libvir] A sample program to create a Linux Container
by Dave Leskovec
Attached is a simple program that uses the clone() function to create a
container. This is not intended as a patch - just an example of what
creating a Linux Container looks like. Something along these lines will
be used by the Linux Container driver to start the domain. The code run
within this container is really simple. It just mounts the /proc file
system and then dumps the ps output to a file showing that the container
is in separate process space.
To run this you will need to have PID namespaces support enabled. Turn
on CONFIG_PID_NS when compiling the kernel. You must run the program as
root or the clone() call will fail.
Any questions or comments are welcome. Thanks!
--
Best Regards,
Dave Leskovec
IBM Linux Technology Center
Open Virtualization
/*
* Copyright IBM Corp. 2008
*
* lxc_exec.c: example on creating a linux container
*
* Authors:
* David L. Leskovec <dlesko at linux.vnet.ibm.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/* System includes */
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <unistd.h>
/* Supporting includes */
/* Component includes */
/* Defines */
/* These will eventually be defined in clone.h */
#define CLONE_NEWPID 0x20000000
#define CLONE_NEWNS 0x00020000
/* Global Variables */
/* Types and structs */
/* Functions */
static void
exec_child()
{
FILE *cdfp;
int rc;
cdfp = fopen("/tmp/child.log", "w");
if (cdfp == NULL)
{
/* Log to syslog */
exit(1);
}
/* mount /proc */
rc = mount("lxcproc", "/proc", "proc", 0, NULL);
if(0 != rc)
{
fprintf(cdfp, "mount failed with rc = %d and errno = %d\n", rc, errno); fflush(cdfp);
exit(1);
}
else
{
fprintf(cdfp, "mount successful\n"); fflush(cdfp);
}
system("ps -aef > /tmp/container_ps.out");
/* sleep a bit just so we don't exit right away */
sleep(10);
fclose(cdfp);
}
int main(int argc, char *argv[])
{
FILE *dfp;
int cpid;
void *childstack, *stack;
int flags;
int stacksize = getpagesize() * 4;
dfp = fopen("/tmp/parent.log", "w");
if(dfp == NULL)
{
perror("parent.log");
exit(1);
}
/* allocate a stack for the container */
stack = malloc(stacksize);
if(!stack)
{
fprintf(dfp, "malloc() failed, %s\n", strerror(errno));
fflush(dfp);
exit(1);
}
/* point to "top" of stack */
childstack = stack + stacksize;
/* call clone to create the container */
flags = CLONE_NEWPID|CLONE_NEWNS;
fprintf(dfp, "Parent: Clone() flags %lx, pagesize %d...\n",
flags, getpagesize());
fflush(dfp);
cpid = clone(exec_child, childstack, flags, (void *)argv);
printf("cpid: %d\n", cpid);
if(cpid < 0)
{
fprintf(dfp, "Parent: clone() failed, %s\n",
strerror(errno));
fflush(dfp);
exit(1);
}
fprintf(dfp, "Parent sleeping, 20 seconds\n"); fflush(dfp);
sleep(20);
return 0;
}
16 years, 11 months
[Libvir] [PATCH] Clarify virsh setvcpus and setmem commands
by Richard W.M. Jones
This adds a small section to the documentation for these virsh commands
to clarify that you can't use them on running, fullvirt domains under Xen.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
16 years, 11 months
Re: [Libvir] Libvirt on windows
by Richard W.M. Jones
There's a couple of odd things about this.
Firstly:
In file included from ../gnulib/lib/sys/stat.h:28,
from remote_internal.c:36:
../gnulib/lib/sys/stat.h: In function 'rpl_mkdir':
../gnulib/lib/sys/stat.h:272: warning: unused parameter 'mode'
In file included from remote_internal.c:61:
getaddrinfo.h:38:19: error: netdb.h: No such file or directory
In file included from remote_internal.c:61:
getaddrinfo.h: At top level:
getaddrinfo.h:199: error: redefinition of 'struct addrinfo'
getaddrinfo.h:214: error: conflicting types for 'gai_strerrorA'
c:\mingw\bin\../lib/gcc/mingw32/4.2.1-sjlj/../../../../include/ws2tcpip.h:309:
error: previous definition of 'gai_strerrorA' was here
According to ./configure, <netdb.h> header file wasn't found, as
expected, but the Gnulib implementation of getaddrinfo shouldn't be
trying to include it in this case. In Gnulib's getaddrinfo.h we have:
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
But I think you're including some other <getaddrinfo.h> from somewhere else.
My version of MinGW doesn't have any file called getaddrinfo.h (which is
why we're using the one from Gnulib in the first place), so I suspect
either you're using some later version of MinGW or else you've got MinGW
& Cygwin files mixed up, or you've got some other implementation of
getaddrinfo installed.
Secondly:
../qemud/remote_protocol.h:509: error: expected specifier-qualifier-list
before 'u_int64_t'
In this file from CVS, line 509 is:
typedef struct remote_domain_get_max_vcpus_args
remote_domain_get_max_vcpus_args;
and I don't see how this line can provoke the error. You'll need to use
the versions of qemud/remote_protocol.[ch] from CVS, along with
PortableXDR (see yesterday's posting) or my hacked up xdr-4.0-mingw5
library.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
16 years, 11 months