[libvirt] libvir and VDE

2010-04-24 Thread Erik de Castro Lopo
Hi all,

I am currently looking at looking at virsh to mamange my kvm and
qemu VMs, but find that libvir doesn't support VDE networking which
I prefer over other networking options.

An obvious first step to adding support for VDE networking would 
be to allow the domxml-from-native subcommand to parse -net vde
arguments like:

-net vde,vlan=0,group=vde2-net,mode=0770,sock=/var/run/qemu-vde-ctl

Apart from that, what else is required to support VDE networks in
libvir?

Cheers,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/

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


Re: [libvirt] [Qemu-devel] Re: Libvirt debug API

2010-04-24 Thread Avi Kivity

On 04/23/2010 09:29 PM, Anthony Liguori wrote:
Maybe.  We'll still have issues.  For example, sVirt: if a QMP 
command names a labeled resource, the non-libvirt user will have no 
way of knowing how to label it.



This is orthogonal to QMP and has to do strictly with how libvirt 
prepares a resource for qemu.



It's not orthogonal.  If you allow qmp access behind libvirt's back, 
it's a problem that you will have.




Much better to exact a commitment from libvirt to track all QMP (and 
command line) capabilities.  Instead of adding cleverness to QMP, add 
APIs to libvirt.




Let's step back for a minute because I think we're missing the forest 
through the trees.


We're trying to address a few distinct problems:

1) Allow libvirt users to access features of qemu that are not exposed 
through libvirt


That's an artificial problem.  If libvirt exposes all features, you 
don't need to solve it.




2) Provide a means for non-libvirt users to interact with qemu


We have qmp.  It doesn't do multiple guest management.  I think it's 
reasonable to have a qemud which does (and also does sVirt and the 
zillion other things libvirt does) provided we remove them from libvirt 
(long term).  The only problem is that it's a lot of effort.




3) Provide a unified and interoperable view of the world for 
non-libvirt and libvirt users


This problem can be solved by the non-libvirt users adopting libvirt, or 
the libvirt users dropping libvirt.  I don't understand why we need to 
add interoperability between users who choose an interoperability 
library and users who don't choose an interoperability library.




For (1), we all agree that the best case scenario would be for libvirt 
to support every qemu feature.  I think we can also all agree though 
that this is not really practical and certainly not practical for 
developers since there is a development cost associated with libvirt 
support (to model an API appropriately).


All except me, perhaps.

We already have two layers of feature modeling: first, we mostly emulate 
real life, not invent new features.  PCI hotplug existed long before 
qemu had support for it.  Second, we do give some thought into how we 
expose it through QMP.  libvirt doesn't have to invent it again, it only 
has to expose it through its lovely xml and C APIs.




The new API proposed addresses (1) by allowing a user to drill down to 
the QMP context.  It's a good solution IMHO and I think we all agree 
that there's an inherent risk to this that users will have to evaluate 
on a case-by-case basis.  It's a good stop-gap though.


Agree.



(2) is largely addressed by QMP and a config file.  I'd like to see a 
nice C library, but I think a lot of other folks are happy with JSON 
support in higher level languages.


I agree with them.  C is a pretty bad choice for managing qemu (or even, 
C is a pretty bad choice).




(3) is the place where there are still potential challenges.  I think 
at the very least, our goal should be to enable conversion from (2) 
and (1) to be as easy as possible.  That's why I have proposed 
implementing a C library for the JSON transport because we could plumb 
that through the new libvirt API.  This would allow a user to very 
quickly port an application from QMP to libvirt.  In order to do this, 
we need the libvirt API to expose a dedicated monitor because we'll 
need to be able to manipulate events and negotiate features.


Most likely any application that talks QMP will hide the protocol behind 
a function call interface anyway.


Beyond simple porting, there's a secondary question of having 
non-libvirt apps co-exist with libvirt apps.  I think it's a good long 
term goal, but I don't think we should worry too much about it now.


libvirt needs to either support all but the most esoteric use cases, or 
to get out of the way completely.


--
Do not meddle in the internals of kernels, for they are subtle and quick to 
panic.

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


[libvirt] Question on xm and virsh listing

2010-04-24 Thread Nandini Chandra
I'd like to understand the exact mechanism for retrieving the list of 
guests by xm/xend and virsh/libvirt.In what situations could the output 
of 'xm list' differ from 'virsh list'?Which of these two is more accurate?


I'd appreciate any pointers.

Thanks.

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


Re: [libvirt] Question on xm and virsh listing

2010-04-24 Thread Nikolai K. Bochev
AFAIK, virt list shows only running guests. Not sure how xm list behaves, but 
if it shows offline ( not running ) guests, that's where the difference can be. 
To achieve the same with virsh use virsh list --all. Also i'd guess that if a 
xen guest was not create with virsh/virt-manager/virt-install , virsh won't 
know about it and won't show it in virsh list.

- Original Message -
I'd like to understand the exact mechanism for retrieving the list of
guests by xm/xend and virsh/libvirt.In what situations could the output
of 'xm list' differ from 'virsh list'?Which of these two is more
accurate?

I'd appreciate any pointers.

Thanks.

-- 


Nikolai K. Bochev 
System Administrator 



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


Re: [libvirt] [Qemu-devel] Re: Libvirt debug API

2010-04-24 Thread Anthony Liguori

On 04/24/2010 04:46 AM, Avi Kivity wrote:

On 04/23/2010 09:29 PM, Anthony Liguori wrote:
Maybe.  We'll still have issues.  For example, sVirt: if a QMP 
command names a labeled resource, the non-libvirt user will have no 
way of knowing how to label it.



This is orthogonal to QMP and has to do strictly with how libvirt 
prepares a resource for qemu.



It's not orthogonal.  If you allow qmp access behind libvirt's back, 
it's a problem that you will have.


My point was, if libvirt is just exposing raw qemu features, then it 
should be possible for qemu to arbitrate concurrent access.  If libvirt 
implements features on top of qemu, then no other third party will be 
able to co-exist with those features without interacting with qemu.  
It's an impossible problem for qemu to solve (arbitrating access to 
state stored in a third party management app).


1) Allow libvirt users to access features of qemu that are not 
exposed through libvirt


That's an artificial problem.  If libvirt exposes all features, you 
don't need to solve it.


It won't.  Otherwise, we wouldn't be having this discussion.



2) Provide a means for non-libvirt users to interact with qemu


We have qmp.  It doesn't do multiple guest management.  I think it's 
reasonable to have a qemud which does (and also does sVirt and the 
zillion other things libvirt does) provided we remove them from 
libvirt (long term).  The only problem is that it's a lot of effort.


It depends on what things you think are important.  A lot of libvirt's 
complexity is based on the fact that it uses a daemon and needs to deal 
with the security implications of that.  You don't need explicit 
labelling if you don't use a daemon.  This is really the qemu model (as 
opposed to the xend model).  In theory, it does support this with the 
session urls but they are currently second-class citizens in libvirt.  
The remote dispatch also adds a fair bit of complexity and at least for 
the use-cases I'm interested in, it's not an important feature.




3) Provide a unified and interoperable view of the world for 
non-libvirt and libvirt users


This problem can be solved by the non-libvirt users adopting libvirt, 
or the libvirt users dropping libvirt.  I don't understand why we need 
to add interoperability between users who choose an interoperability 
library and users who don't choose an interoperability library.


What I'd like to avoid is user confusion.  Should a user use libvirt or 
libqemu?  If they make a decision to use libqemu and then down the road 
want to use libvirt, how hard is it to switch?  Fragmentation hurts the 
ecosystem and discourages good applications from existing.  I think it's 
our responsibility to ensure there's a good management API that exists 
for qemu that we can actively recommend to our users.  libvirt is very 
good at typical virtualization uses of qemu but qemu is much more than 
just that and has lots of advanced features.




For (1), we all agree that the best case scenario would be for 
libvirt to support every qemu feature.  I think we can also all agree 
though that this is not really practical and certainly not practical 
for developers since there is a development cost associated with 
libvirt support (to model an API appropriately).


All except me, perhaps.

We already have two layers of feature modeling: first, we mostly 
emulate real life, not invent new features.  PCI hotplug existed long 
before qemu had support for it.  Second, we do give some thought into 
how we expose it through QMP.  libvirt doesn't have to invent it 
again, it only has to expose it through its lovely xml and C APIs.


That's not what the libvirt community wants to do.  We're very bias.  
We've made decisions about how features should be exposed and what 
features should be included.  We want all of those features exposed 
exactly how we've implemented them because we think it's the right way.


I'm not sure there's an obvious way forward unless we decide that there 
is going to be two ways to interact with qemu.  One way is through the 
libvirt world-view and the other is through a more qemu centric view.  
The problem then becomes allowing those two models to co-exist happily 
together.


The alternative is to get libvirt to just act as a thin layer to expose 
qemu features directly.  But honestly, what's the point of libvirt if 
they did that?  For the most part, the pool management is not 
virtualization specific and you could have libvirt provide that 
functionality without it knowing a thing about qemu.




The new API proposed addresses (1) by allowing a user to drill down 
to the QMP context.  It's a good solution IMHO and I think we all 
agree that there's an inherent risk to this that users will have to 
evaluate on a case-by-case basis.  It's a good stop-gap though.


Agree.



(2) is largely addressed by QMP and a config file.  I'd like to see a 
nice C library, but I think a lot of other folks are happy with JSON 
support in higher