[Libvir] RFC: replace "no support for hypervisor" error
by Richard W.M. Jones
The "no support for hypervisor" error is both very common and pretty
annoying because it gives you nowhere to go to find out what you did wrong.
$ virsh -c xen://localhost/
libvir: Xen Daemon error : no support for hypervisor
virsh: error: failed to connect to the hypervisor
(The actual problem is that my URI is wrong, which is a separate bug in
the Xen driver. But the error message gives me no particular indication
of what is wrong or how to correct the situation).
I think there are several possible solutions to this - discuss, or
suggest your own.
(1) Document the URI formats fully.
-- This is a feature which has been requested a few times and I will
do it anyway if Daniel Veillard will do the magic to set up a
"http://libvirt.org/uri.html" page.
(2) Add a method to query available drivers and URI syntax.
-- Something along the lines of char *virQueryDrivers (void); Note
that it doesn't need an open connection.
-- The remote case would have to be handled specially because you
want to find out what's available locally and what's available remotely,
and in the remote case you do need some sort of a connection.
(3) Split VIR_ERR_NO_SUPPORT into two categories. Currently this
category mixes up cases where we fail to open a connection, and cases
where there is no driver support for a particular operation (even with
an open connection). In the first case, go through all the places which
return this error and add proper diagnostic information to the error
messages.
-- Again, I am prepared to do this if people think it's a good idea.
(4) Add diagnostics to higher layers such as virsh and virt-manager.
-- I would be less happy with this because it ends up repeating code,
and the diagnostics could get out of date w.r.t. what libvirt can do.
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
17 years, 6 months
[Libvir] Re: URI documentation and xen:/// patch
by Richard W.M. Jones
Daniel Veillard wrote:
> On Tue, Jun 19, 2007 at 05:15:40PM +0100, Richard W.M. Jones wrote:
>> Daniel Veillard wrote:
>> $ virsh -c ///var/lib/xend/xend-socket list
>> libvir: error : no support for hypervisor
>> virsh: error: failed to connect to the hypervisor
>
> Hum, I not sure I ever tried to get that working. Maybe
> file:///var/lib/xend/xend-socket
> would work better, though libxml2 URI parsing should be able to
> parse ///var/lib/xend/xend-socket and make it more or less equivalent
> to the file:/// one. I would strace both to check.
Yeah, I tried all the obvious ones like that. I'll run it under gdb
later & find out what's really going on. I was just pointing out that
it didn't seem to work right now ...
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
17 years, 6 months
[Libvir] [PATCH] hypervisor version
by Mark Johnson
This is another patch which may not be popular? Xen's
extra version does not fit in libvirt's release field (since it's
part of an int).
Instead of printing out the wrong value, just display
major.minor in virsh.
Mark
17 years, 6 months
[Libvir] [PATCH] Fix the check of <cpumap> in virsh vcpupin
by Masayuki Sunou
Hi
Because virsh vcpupin does not check a form of <cpumap>,
when non-numerical letters are set, it does not become an error.
This patch fixes it so that it become an error when non-numerical
letters are set.
Signed-off-by: Masayuki Sunou <fj1826dm(a)aa.jp.fujitsu.com>
Thanks,
Masayuki Sunou.
----------------------------------------------------------------------
Index: src/virsh.c
===================================================================
RCS file: /data/cvs/libvirt/src/virsh.c,v
retrieving revision 1.84
diff -u -p -r1.84 virsh.c
--- src/virsh.c 15 Jun 2007 15:24:20 -0000 1.84
+++ src/virsh.c 18 Jun 2007 07:02:31 -0000
@@ -1530,6 +1530,7 @@ cmdVcpupin(vshControl * ctl, vshCmd * cm
int vcpufound = 0;
unsigned char *cpumap;
int cpumaplen;
+ int i;
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
return FALSE;
@@ -1563,6 +1564,22 @@ cmdVcpupin(vshControl * ctl, vshCmd * cm
return FALSE;
}
+ for(i = 0; cpulist[i]; i++) {
+ if ((i == 0) || (i == strlen(cpulist)-1)) {
+ if (!isdigit(cpulist[i])) {
+ vshError(ctl, FALSE, _("Invalid format '%s'."), cpulist);
+ virDomainFree(dom);
+ return FALSE;
+ }
+ } else {
+ if(!isdigit(cpulist[i]) && cpulist[i] != ',') {
+ vshError(ctl, FALSE, _("Invalid format '%s'."), cpulist);
+ virDomainFree(dom);
+ return FALSE;
+ }
+ }
+ }
+
cpumaplen = VIR_CPU_MAPLEN(VIR_NODEINFO_MAXCPUS(nodeinfo));
cpumap = vshCalloc(ctl, 1, cpumaplen);
----------------------------------------------------------------------
17 years, 6 months
[Libvir] [RFC] Device attach/detach on virsh
by Masayuki Sunou
I want to add I/F to do attach/detatch of VIF and VBD to virsh with
virDomainAttachDevice()/virDomainDetachDevice().
And, I have two proposals about I/F for virsh to do attach/detach of VIF and VBD.
proposal 1:
Virsh catches MAC, bridge name, device name (physical,virtual), and another
by the command option.
ex)
------------------------------------------------------------------
# virsh help attach(detach)-vif(vbd)
NAME
attach(detach)-vif(vbd) - attach(detach) vif(vbd)
SYNOPSIS
* VIF
attach(detach)-vif <domain> <MAC> <bridge> ...
or
* VBD
attach(detach)-vbd <domain> <virt-dev> ...
DESCRIPTION
Attach(Detach) vif(vbd) device
OPTIONS
<domain> domain name, id or uuid
* VIF
<MAC> MAC address of vif
<bridge> bridge name of vif
...
* VBD
<virt-dev> virtual device name of vbd
<phy-dev> physical device name of vbd
...
------------------------------------------------------------------
<advantage>
- I/F is easy to use than proposal 1. (Because the user does not have to
make XML)
<disadvantage>
- I/F increases because I/F of VIF and VBD becomes separate. (So, the
addition of I/F is necessary at any time for supporting devices other
than VIF and VBD. )
- Handling of optional analysis, handling of XML making are necessary
in virsh.c, and processing becomes complicated.
proposal 2:
virsh catches a definition of a device by XML
ex)
------------------------------------------------------------------
# virsh help attach(detach)-device
NAME
attach(detach)-device - attach(detach) device from an XML file
SYNOPSIS
attach(detach)-device <domain> <file>
DESCRIPTION
Attach(Detach) device from an XML <file>
OPTIONS
<domain> domain name, id or uuid
<file> XML file of device description
------------------------------------------------------------------
<advantage>
- I/F is unified without affecting a device type. (I/F is simple)
- Handling of virsh.c is simple. (Optional analysis is not necessary)
<disadvantage>
- The user has to describe XML.(It is troublesome)
I think that specifications that a user is easy to use (proposal 1)
are better.
Please, give me an opinion which proposal is better.
Thanks,
Masayuki Sunou
17 years, 6 months
[Libvir] PATCH: Fix marshalling of ID on wire with remote
by Daniel P. Berrange
THe code which marshalls virDomainptr objects onto the wire in the remote
driver forgets to include the 'id' value. We get away with this for Xen
and QEMU because they do most things based off name or UUID. The test
driver however wants the ID number. The attached patch fixes this
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 -=|
17 years, 6 months
[Libvir] [PATCH] setmem checks
by Mark Johnson
This one may be a little contentious...
This patch does a couple of things... It won't let you
set memory if the value is greater that maxmem.
It also will lower memory if max memory is set
to less than memory.
I think it's a good argument that this checking
should be in the hypervisor control daemon.
IMO, it should be both here and in the daemon.
I have no idea why the patch diff is so big,
Below is the diff after it is applied. A little easier
to read.
Mark
[root@fedora libvirt]# diff src/virsh.orig src/virsh.c
1664a1665
> virDomainInfo info;
1673a1675,1677
> if (virDomainGetInfo(dom, &info) != 0) {
> info.maxMem = 0;
> }
1675c1679
< if (kilobytes <= 0) {
---
> if ((kilobytes <= 0) || (kilobytes > info.maxMem)) {
1708a1713
> virDomainInfo info;
1723a1729,1737
> if (virDomainGetInfo(dom, &info) != 0) {
> info.memory = 0x7fffffff;
> }
>
> if (kilobytes < info.memory) {
> if (virDomainSetMemory(dom, kilobytes) != 0) {
> return FALSE;
> }
> }
[root@fedora libvirt]#
17 years, 6 months
[Libvir] [PATCH] header file changes for Solaris
by Mark Johnson
This patch has the includes need to build on Solaris.
I've been using ifdef linux & ifndef linux to distinguish
between solaris and linux at this point.
I'm not sure what the preference is...
MRJ
17 years, 6 months