[libvirt] virConnectOpenReadOnly?
by Jun Koi
Hi,
According to the comment of virConnectOpenReadOnly, this function has
some restrictions on available methods to control domains. Could you
be more specific? What kind of restrictions we are having (compare to
virConnectOpen())?
And when should we use virConnectOpenReadOnly() instead of virConnectOpen() ?
Thanks,
Jun
16 years, 7 months
[libvirt] Error compiling libvirt 0.4.4
by Everton P. Alexandre
hi
I'm trying to compile the libvirt 0.4.4. I'm getting the error below:
gcc -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include -I../include -I../qemud -I/usr/local/include/libxml2 -DBINDIR=\"/usr/local/libexec\" -DSBINDIR=\"/usr/local/sbin\" -DSYSCONF_DIR=\"/usr/local/etc\" -DLOCALEBASEDIR=\"/usr/local/share/locale\" -DLOCAL_STATE_DIR=\"/usr/local/var\" -DGETTEXT_PACKAGE=\"libvirt\" -Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables -DWITH_QEMU -DWITH_TEST -DWITH_REMOTE -DWITH_LIBVIRTD -DWITH_XEN -DIN_LIBVIRT -g -O2 -MT libvirt_la-xen_unified.lo -MD -MP -MF .deps/libvirt_la-xen_unified.Tpo -c xen_unified.c -fPIC -DPIC -o .libs/libvirt_la-xen_unified.o
In file included from /usr/include/xen/dom0_ops.h:31,
from xen_unified.c:29:
/usr/include/xen/xen.h:578: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char'
/usr/include/xen/xen.h:579: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'short'
/usr/include/xen/xen.h:580: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
/usr/include/xen/xen.h:581: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'long'
make[2]: *** [libvirt_la-xen_unified.lo] Error 1
make[2]: Leaving directory `/home/everton/libvirt-0.4.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/everton/libvirt-0.4.4'
make: *** [all] Error 2
Thank you
Everton Alexandre
---------------------------------
Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
16 years, 7 months
[libvirt] LIBVIR_VERSION_NUMBER ?
by Jun Koi
Hi,
According to libvirt.h:
/**
* LIBVIR_VERSION_NUMBER:
*
* Macro providing the version of the library as
* version * 1,000,000 + minor * 1000 + micro
*/
#define LIBVIR_VERSION_NUMBER 4004
The comment is incorrect, as 4004 is not how it is supposed to be.
So we should fix either the comment (better?), or the version.
Thanks,
Jun
16 years, 7 months
RE: [libvirt] DISREGARD Problems starting XEN HVM with libvirt
by Matthew Donovan
It turns out everything was booting, they just weren't configured to give a
console or display a GUI window.
-matthew
> -----Original Message-----
> From: Matthew Donovan [mailto:matthew@atc-nycorp.com]
> Sent: Tuesday, August 26, 2008 9:25 AM
> To: libvir-list(a)redhat.com
> Subject: [libvirt] Problems starting XEN HVM with libvirt
>
> I've been having trouble getting a Xen HVM guest started
> using libvirt.
> I've tried Windows Vista, Fedora Core 8, and Fedora Core 6
> guests. Domain 0
> is FC 8. The only guest that starts correctly is the FC 6 guest. Has
> anyone else encountered something like this? Is there a
> master list of
> guest OS's that libvirt supports?
>
> Thanks
> -matthew
>
>
> CODE:
>
> #include <stdio.h>
> #include <libvirt/libvirt.h>
> #include <libvirt/virterror.h>
>
>
> const char* foo =
> "<domain type='xen'>"
> "<name>fc6</name>"
> "<os>"
> "<type>hvm</type>"
> "<loader>/usr/lib/xen/boot/hvmloader</loader>"
> "<boot dev='hd'/>"
> "</os>"
> "<memory>512000</memory>"
> "<vcpu>1</vcpu>"
> "<on_shutdown>shutdown</on_shutdown>"
> "<on_reboot>restart</on_reboot>"
> "<on_crash>restart</on_crash>"
> "<features>"
> "<pae/>"
> "<acpi/>"
> "<apic/>"
> "</features>"
> "<clock sync='localtime'/>"
> "<devices>"
> "<emulator>/usr/lib/xen/bin/qemu-dm</emulator>"
> "<disk type='block'>"
> "<source dev='/dev/vgvms/fc6_test'/>"
> "<target dev='hda'/>"
> "</disk>"
> "<interface type='ioemu'>"
> "<mac address='7A:AB:D0:01:82:98'/>"
> "</interface>"
> "<input type='tablet' bus='usb'/>"
> "<graphics type='sdl' password=''/>"
> "<serial type='pty'/>"
> "</devices>"
> "</domain>";
>
>
> int main (int argc, char** argv)
> {
> virConnectPtr con; /* connection to the Xen hypervisor */
> virDomainPtr domain;
>
> virInitialize();
>
> con = virConnectOpen ("xen:///");
> if (!con) {
> virErrorPtr err = virGetLastError ();
> printf ("virConnectOpen failed: %s\n",
> err->message);
> return -1;
> }
>
> domain = virDomainDefineXML (con, foo);
> if (!domain) {
> virErrorPtr err = virConnGetLastError (con);
> printf ("virDomainDefineXML failed: %s\n",
> err->message);
>
> } else {
>
> if (virDomainCreate (domain) < 0) {
> virErrorPtr err = virConnGetLastError (con);
> printf ("virDomainCreate failed: %s\n",
> err->message);
> } else {
> virDomainInfo info = {0};
> virDomainGetInfo (domain, &info);
> printf ("state = %d\n", info.state);
> getchar ();
> }
> }
>
> virConnectClose (con);
> return 0;
> }
>
> --
> Libvir-list mailing list
> Libvir-list(a)redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
>
16 years, 7 months
[libvirt] Problems starting XEN HVM with libvirt
by Matthew Donovan
I've been having trouble getting a Xen HVM guest started using libvirt.
I've tried Windows Vista, Fedora Core 8, and Fedora Core 6 guests. Domain 0
is FC 8. The only guest that starts correctly is the FC 6 guest. Has
anyone else encountered something like this? Is there a master list of
guest OS's that libvirt supports?
Thanks
-matthew
CODE:
#include <stdio.h>
#include <libvirt/libvirt.h>
#include <libvirt/virterror.h>
const char* foo =
"<domain type='xen'>"
"<name>fc6</name>"
"<os>"
"<type>hvm</type>"
"<loader>/usr/lib/xen/boot/hvmloader</loader>"
"<boot dev='hd'/>"
"</os>"
"<memory>512000</memory>"
"<vcpu>1</vcpu>"
"<on_shutdown>shutdown</on_shutdown>"
"<on_reboot>restart</on_reboot>"
"<on_crash>restart</on_crash>"
"<features>"
"<pae/>"
"<acpi/>"
"<apic/>"
"</features>"
"<clock sync='localtime'/>"
"<devices>"
"<emulator>/usr/lib/xen/bin/qemu-dm</emulator>"
"<disk type='block'>"
"<source dev='/dev/vgvms/fc6_test'/>"
"<target dev='hda'/>"
"</disk>"
"<interface type='ioemu'>"
"<mac address='7A:AB:D0:01:82:98'/>"
"</interface>"
"<input type='tablet' bus='usb'/>"
"<graphics type='sdl' password=''/>"
"<serial type='pty'/>"
"</devices>"
"</domain>";
int main (int argc, char** argv)
{
virConnectPtr con; /* connection to the Xen hypervisor */
virDomainPtr domain;
virInitialize();
con = virConnectOpen ("xen:///");
if (!con) {
virErrorPtr err = virGetLastError ();
printf ("virConnectOpen failed: %s\n",
err->message);
return -1;
}
domain = virDomainDefineXML (con, foo);
if (!domain) {
virErrorPtr err = virConnGetLastError (con);
printf ("virDomainDefineXML failed: %s\n",
err->message);
} else {
if (virDomainCreate (domain) < 0) {
virErrorPtr err = virConnGetLastError (con);
printf ("virDomainCreate failed: %s\n",
err->message);
} else {
virDomainInfo info = {0};
virDomainGetInfo (domain, &info);
printf ("state = %d\n", info.state);
getchar ();
}
}
virConnectClose (con);
return 0;
}
16 years, 7 months
[libvirt] "static" ip address
by Olivier Deckmyn
Hi,
I'm using KVM with the wonderful help of libvir (virsh), on a
to-be-production-ready server of mine.
I would like to be able to choose on a way or another the ip of each of my
VM. As far as I can understand, the only way to get an IP (from a vm point
of view) if the dhcp it. But I have no garantee vm1 will always get x.x.x.1
Ip adress...
Is there a solution please ? (googling this list did'nt answer :()
Thanx
16 years, 7 months
[libvirt] libvir: Xen error
by mantra UNIX
Hello everyone,
I get the following error when i try to redtart a domain;
# virsh list
libvir: Xen error : Domain not found: xenUnifiedDomainLookupByID
I am using RHEL5.2 on i386, I have searched for the error on web
and on RedHat but could not find any.
--
Regards,
mantra - Instrument of Thought
16 years, 7 months
[libvirt] <bootloader /> BUG
by Stefan de Konink
With the tip of DanB I am currently using the inactive XML storage quite
satisfied with the concept of first undefining than starting. But there
is still a bug.
The inactive XML adds a <bootloader /> tag. Now that is (in my
perspective) not a bug, but it it is that libvirt expects a config. In
my personal believes the tag shouldn't be there if there is no config;
or libvirt should not
libvir: Xen Daemon error : POST operation failed: xend_post: error from
xen daemon: (xend.err 'Error creating domain: Had a bootloader
specified, but no disks are bootable')
error: Failed to create domain from /mnt/netapp/users/klant2/mono/index.xml
I just checked with the last git version and the bug still exists... I
hope someone can look into this asap. It is a blocker for development.
Stefan
16 years, 7 months
[libvirt] inactive domain list in virsh
by Jun Koi
Hi,
I am wondering if there is a way to list all the inactive domain
inside virsh? That would be useful to have such a command, so we can
see which domain can be started.
Thanks,
J
16 years, 7 months