Re: [libvirt] RFC: Migration with NPIV

2012-11-19 Thread Zou, Yi
> On 2012年11月19日 17:30, Osier Yang wrote: > > Hi, > > > > This proposal is trying to figure out a solution for migration > > of domain which uses LUN behind vHBA as disk device (QEMU > > emulated disk only at this stage). And other related NPIV > > improvements which are not related with migration.

[libvirt] [RFC PATCHv2 2/n] snapshot: prepare to parse new XML

2012-11-19 Thread Eric Blake
No semantic change, but prepare for a new mode of parsing where a new _BRANCH flag requests that the parse look up the existing snapshot to branch from. * src/conf/snapshot_conf.h (VIR_DOMAIN_SNAPSHOT_PARSE_BRANCH): New flag, unused for now. (virDomainSnapshotDefParseString): Add parameter. * src/

[libvirt] [RFC PATCHv2 4/n] snapshot: actually compute branch definition from XML

2012-11-19 Thread Eric Blake
When asked to parse a branch snapshot XML definition, we have to piece together the definition of the new snapshot from parts of the branch point, as well as run some sanity checks that the branches are compatible. This patch is rather restrictive in what it allows; depending on effort and future

[libvirt] [RFC PATCHv2 3/n] snapshot: make cloning of domain definition easier

2012-11-19 Thread Eric Blake
Upcoming patches for revert-and-clone branching of snapshots need to be able to copy a domain definition; make this step reusable. * src/conf/domain_conf.h (virDomainDefCopy): New prototype. * src/conf/domain_conf.c (virDomainObjCopyPersistentDef): Split... (virDomainDefCopy): ...into new function

[libvirt] [RFC PATCHv2 1/n] snapshot: add revert-and-create branching of external snapshots

2012-11-19 Thread Eric Blake
Right now, libvirt refuses to revert to the state at the time of an external snapshot, because doing so would reset things so that the next time the domain boots, we are using the backing file; but modifying the backing file invalidates all qcow2 files that are based on top of it. There are three

[libvirt] [RFC PATCHv2 0/n] snapshot: add revert-and-create branching

2012-11-19 Thread Eric Blake
v1 was here: https://www.redhat.com/archives/libvir-list/2012-November/msg00484.html Since then, I've folded in review comments on 1; 2-4 are new. Documentation is still pending (split out of 1 based on the v1 review). Also, I'm still writing and testing the actual qemu use of the new snapshot_co

Re: [libvirt] [PATCHv4 4/4] snapshot: qemu: Implement reverting of external snapshots

2012-11-19 Thread Eric Blake
On 11/19/2012 09:06 AM, Peter Krempa wrote: > This patch adds support for reverting of external snapshots. The support > is somewhat limited yet (you can only revert to a snapshot that has no > children or delete the children that would have their image chains > invalidated). > > While reverting a

Re: [libvirt] [PATCHv4 3/4] snapshot: Add flag to allow hypervisor restart when reverting snapshots

2012-11-19 Thread Eric Blake
On 11/19/2012 09:06 AM, Peter Krempa wrote: > Some hypervisors require a respawn of the hypervisor to allow reverting > to some snapshot states. This patch adds flag to remove the default > safe approach to not allow this. When this flag is specified the > hypervisor driver should re-emit events to

Re: [libvirt] [PATCHv4 2/4] snapshot: Add flag VIR_DOMAIN_SNAPSHOT_REVERT_STOPPED

2012-11-19 Thread Eric Blake
On 11/19/2012 09:06 AM, Peter Krempa wrote: > The current snapshot reverting api supported changing the state of the > machine after the snapshot was reverted to either started or paused. > > This patch adds the ability to revert the state but to stopped state. > --- > Fixed comment regarding use

Re: [libvirt] [PATCHv4 0/4] Add initial support for reverting snapshots

2012-11-19 Thread Eric Blake
On 11/19/2012 09:06 AM, Peter Krempa wrote: > I'm reposting another version of the series. This version fixes small mistakes > in patches 1-3 and reposts patch 4 as it got missing due to a sending error. > > > Peter Krempa (4): > qemu: Split out guts of qemuDomainSaveImageStartVM() to allow reu

Re: [libvirt] [PATCHv2 4/4] snapshot: expose location through virsh snapshot-info

2012-11-19 Thread Eric Blake
On 11/19/2012 06:48 AM, Peter Krempa wrote: > On 11/15/12 00:36, Eric Blake wrote: >> Now that we can filter on this information, we should also make >> it easy to get at. >> >> * tools/virsh-snapshot.c (cmdSnapshotInfo): Add another output >> row, and switch to XPath queries rather than strstr. >

Re: [libvirt] Plan A or Plan B?

2012-11-19 Thread Gene Czarcinski
On 11/19/2012 03:51 PM, Laine Stump wrote: On 11/19/2012 03:27 PM, Gene Czarcinski wrote: On 11/19/2012 01:06 PM, Laine Stump wrote: Here is an open BZ that mentions the idea of adding similar functionality for dnsmasq (see comment 8, in particular): https://bugzilla.redhat.com/show_bug.cg

Re: [libvirt] [PATCHv2 2/4] snapshot: add virsh back-compat support for new filters

2012-11-19 Thread Eric Blake
On 11/19/2012 04:26 AM, Peter Krempa wrote: > On 11/15/12 00:36, Eric Blake wrote: >> Snapshot filtering based on types is useful enough to add >> back-compat support into virsh. It is also rather easy - all >> versions of libvirt that don't understand the new filter flags >> already gave us suffi

Re: [libvirt] Plan A or Plan B?

2012-11-19 Thread Gene Czarcinski
On 11/19/2012 02:24 PM, Laine Stump wrote: 1. In a manner similar to what is done for IPV6, add ip6tables rules >>>to permit virtual systems to communicate via a defined virtual >>>interface which has no gateway addresses defined. This does mean that >>>virtual systems will not be able to commu

Re: [libvirt] Plan A or Plan B?

2012-11-19 Thread Laine Stump
On 11/19/2012 03:27 PM, Gene Czarcinski wrote: > On 11/19/2012 01:06 PM, Laine Stump wrote: >> Here is an open BZ that mentions the idea of adding similar >> functionality for dnsmasq (see comment 8, in particular): >> >>https://bugzilla.redhat.com/show_bug.cgi?id=824573 > I also found Comment

Re: [libvirt] Plan A or Plan B?

2012-11-19 Thread Gene Czarcinski
On 11/19/2012 01:06 PM, Laine Stump wrote: Here is an open BZ that mentions the idea of adding similar functionality for dnsmasq (see comment 8, in particular): https://bugzilla.redhat.com/show_bug.cgi?id=824573 I also found Comment 2 where Dave Allan says "The intent is that people who want

Re: [libvirt] Plan A or Plan B?

2012-11-19 Thread Laine Stump
On 11/19/2012 01:50 PM, Gene Czarcinski wrote: > SInce I wrote this, I have "Plan B" about a half to two-thirds > complete as far as the coding goes. I have this "feeling" that > postponing the conf-file changes might be better. > > On 11/19/2012 01:06 PM, Laine Stump wrote: >> On 11/19/2012 08:31

Re: [libvirt] Plan A or Plan B?

2012-11-19 Thread Gene Czarcinski
SInce I wrote this, I have "Plan B" about a half to two-thirds complete as far as the coding goes. I have this "feeling" that postponing the conf-file changes might be better. On 11/19/2012 01:06 PM, Laine Stump wrote: On 11/19/2012 08:31 AM, Gene Czarcinski wrote: Plan A: This consists of

Re: [libvirt] Plan A or Plan B?

2012-11-19 Thread Laine Stump
On 11/19/2012 08:31 AM, Gene Czarcinski wrote: > Plan A: > > This consists of the set of patches I have submitted for conf-file, > DHCPv6, etc. The response has been a resounding SILENCE. Thus, I am > assuming that there is some reluctance to adopting these changes in > their current form. This

Re: [libvirt] [PATCHv4 0/4] Add initial support for reverting snapshots

2012-11-19 Thread Peter Krempa
On 11/19/12 18:19, Michal Privoznik wrote: On 19.11.2012 17:06, Peter Krempa wrote: I'm reposting another version of the series. This version fixes small mistakes in patches 1-3 and reposts patch 4 as it got missing due to a sending error. Peter Krempa (4): qemu: Split out guts of qemuDomai

Re: [libvirt] [PATCHv4 0/4] Add initial support for reverting snapshots

2012-11-19 Thread Michal Privoznik
On 19.11.2012 17:06, Peter Krempa wrote: > I'm reposting another version of the series. This version fixes small mistakes > in patches 1-3 and reposts patch 4 as it got missing due to a sending error. > > > Peter Krempa (4): > qemu: Split out guts of qemuDomainSaveImageStartVM() to allow reuse

[libvirt] [PATCH v1 11/11] bandwidth: Add documentation

2012-11-19 Thread Michal Privoznik
This approach implemented in previous patches is not trivial and deserves small description. --- src/util/virnetdevbandwidth.c | 68 +--- 1 files changed, 62 insertions(+), 6 deletions(-) diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidt

[libvirt] [PATCH v1 08/11] network: Update status file on (un)plug

2012-11-19 Thread Michal Privoznik
Status file keeps track of class_id and floor_sum. It's better to keep it updated in case libvirtd is killed. --- src/network/bridge_driver.c | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 8dc9d

[libvirt] [PATCH v1 06/11] network: Create real network status files

2012-11-19 Thread Michal Privoznik
Currently, we are only keeping a inactive XML configuration in status dir. This is no longer enough as we need to keep this class_id attribute so we don't overwrite old entries when the daemon restarts. However, since there has already been a libvirt release which has just as root element, and we

[libvirt] [PATCH v1 10/11] bandwidth: Attach sfq to leaf node

2012-11-19 Thread Michal Privoznik
SFQ is qdisc which doesn't really shape any traffic but 'just' re-arrange packets in sending buffer so no stream starve. The goal is to ensure fairness. There is basically only one configuration parameter (perturb) which is set to advised value of 10. --- src/util/virnetdevbandwidth.c | 10

[libvirt] [PATCH v1 09/11] network: Allow class ID to be reused

2012-11-19 Thread Michal Privoznik
With current implementation, class ID is just incremented. This can lead to its exhaustion as tc accepts only 16 bits long identifiers. Hence, it's better if we allow class ID to be reused. To keep track which IDs are free and which are taken virBitmap is used. This requires network status file to

[libvirt] [PATCH v1 04/11] bandwidth: Create rate update function

2012-11-19 Thread Michal Privoznik
This will be used whenever a NIC with guaranteed throughput is to be plugged into a bridge. It will adjust the average throughput of non guaranteed NICs (classid 1:2) to meet new requirements. --- src/util/virnetdevbandwidth.c | 49 + src/util/virnetdevban

[libvirt] [PATCH v1 07/11] domain: Keep assigned class_id in domstatus XML

2012-11-19 Thread Michal Privoznik
Interfaces keeps a class_id, which is an ID from which bridge part of QoS settings is derived. We need to store class_id in domain status file, so we can later pass it to virNetDevBandwidthUnplug. --- src/conf/domain_conf.c |4 +- src/qemu/qemu_domain.c | 66 +

[libvirt] [PATCH v1 05/11] bandwidth: Create network (un)plug functions

2012-11-19 Thread Michal Privoznik
Network should be notified if we plug in or unplug an interface, so it can perform some action, e.g. set/unset network part of QoS. --- src/Makefile.am |7 ++- src/conf/domain_conf.h |1 + src/conf/network_conf.c |1 + src/conf/network_conf.h |3 + src/libv

[libvirt] [PATCH v1 01/11] bandwidth: add new 'floor' attribute

2012-11-19 Thread Michal Privoznik
This is however supported only on domain interfaces with type='network'. Moreover, target network needs to have at least inbound QoS set. This is required by hierarchical traffic shaping. >From now on, the required attribute for is either 'average' (old) or 'floor' (new). This new attribute can b

[libvirt] [PATCH v1 02/11] bandwidth: Create hierarchical shaping classes

2012-11-19 Thread Michal Privoznik
These classes can borrow unused bandwidth. Basically, only egress qdsics can have classes, therefore we can do this kind of traffic shaping only on host's outgoing, that is domain's incoming traffic. --- src/lxc/lxc_process.c |3 ++- src/network/bridge_driver.c |3 ++- src/qemu/q

[libvirt] [PATCH v1 03/11] bandwidth: Create (un)plug functions

2012-11-19 Thread Michal Privoznik
These set bridge part of QoS when bringing domain's interface up. Long story short, if there's a 'floor' set, a new QoS class is created. ClassID MUST be unique within the bridge and should be kept for unplug phase. --- po/POTFILES.in|1 + src/util/virnetdevbandwidth.c | 178 +

[libvirt] [PATCH v1 00/11] Allow minimal bandwidth guarantee

2012-11-19 Thread Michal Privoznik
This is a rework of my one year old patchset [1]. If you are brave enough and start reviewing it, you may want to read the last patch first. The whole magic hidden behind the scene is documented there. For now, the only supported combination where this works is virtual interface connected to virtu

[libvirt] [PATCHv4 4/4] snapshot: qemu: Implement reverting of external snapshots

2012-11-19 Thread Peter Krempa
This patch adds support for reverting of external snapshots. The support is somewhat limited yet (you can only revert to a snapshot that has no children or delete the children that would have their image chains invalidated). While reverting an external snapshot, the domain has to be taken offline

[libvirt] [PATCHv4 2/4] snapshot: Add flag VIR_DOMAIN_SNAPSHOT_REVERT_STOPPED

2012-11-19 Thread Peter Krempa
The current snapshot reverting api supported changing the state of the machine after the snapshot was reverted to either started or paused. This patch adds the ability to revert the state but to stopped state. --- Fixed comment regarding use of this flag on transient domains. --- include/libvirt/

[libvirt] [PATCHv4 1/4] qemu: Split out guts of qemuDomainSaveImageStartVM() to allow reuse

2012-11-19 Thread Peter Krempa
The workhorse part of qemuDomainSaveImageStartVM can be reused while loading external snapshots. This patch splits the code out into a new function qemuDomainSaveImageLoad that is free of setting lifecycle events. --- No changes, ACKed. --- src/qemu/qemu_driver.c | 53 +

[libvirt] [PATCHv4 0/4] Add initial support for reverting snapshots

2012-11-19 Thread Peter Krempa
I'm reposting another version of the series. This version fixes small mistakes in patches 1-3 and reposts patch 4 as it got missing due to a sending error. Peter Krempa (4): qemu: Split out guts of qemuDomainSaveImageStartVM() to allow reuse snapshot: Add flag VIR_DOMAIN_SNAPSHOT_REVERT_STOPP

[libvirt] [PATCHv4 3/4] snapshot: Add flag to allow hypervisor restart when reverting snapshots

2012-11-19 Thread Peter Krempa
Some hypervisors require a respawn of the hypervisor to allow reverting to some snapshot states. This patch adds flag to remove the default safe approach to not allow this. When this flag is specified the hypervisor driver should re-emit events to allow management apps to reconnect. This flag is m

[libvirt] Use remote connect with credetial via Java code

2012-11-19 Thread Yaniv Hadad
Hello all, Someone can explain me how can I generate connection with credential like user and pass (ex: root\passw0rd) I use Java API, and use this following rows for connection with local host : conn = new Connect("qemu:///system", false); Thanks in advance

Re: [libvirt] libvirt-1.0 fails virdrivermoduletest

2012-11-19 Thread Martin Kletzander
On 11/11/2012 10:25 AM, Toralf Förster wrote: > I've a stable Gentoo Linux, the build log is attached. > It's hard to say from the log, but you can check yourselves what the problem is by running the particular test like this: VIR_TEST_DEBUG=1 ./virdrivermoduletest in the tests/ directory after

Re: [libvirt] [PATCHv2 4/4] snapshot: expose location through virsh snapshot-info

2012-11-19 Thread Peter Krempa
On 11/15/12 00:36, Eric Blake wrote: Now that we can filter on this information, we should also make it easy to get at. * tools/virsh-snapshot.c (cmdSnapshotInfo): Add another output row, and switch to XPath queries rather than strstr. --- tools/virsh-snapshot.c | 57 ++

[libvirt] Plan A or Plan B?

2012-11-19 Thread Gene Czarcinski
Plan A: This consists of the set of patches I have submitted for conf-file, DHCPv6, etc. The response has been a resounding SILENCE. Thus, I am assuming that there is some reluctance to adopting these changes in their current form. This especially includes the conf-file changes. While I b

Re: [libvirt] [PATCHv2 3/4] snapshot: implement new filter sets

2012-11-19 Thread Peter Krempa
On 11/15/12 00:36, Eric Blake wrote: Relatively straight-forward. And since qemu was already using VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, with 6 different APIs all calling into this common code, I've instantly added all 5 flags to 6 APIs. * src/conf/snapshot_conf.h (VIR_DOMAIN_SNAPSHOT_FILTERS_ALL):

Re: [libvirt] [PATCHv2 2/4] snapshot: add virsh back-compat support for new filters

2012-11-19 Thread Peter Krempa
On 11/15/12 00:36, Eric Blake wrote: Snapshot filtering based on types is useful enough to add back-compat support into virsh. It is also rather easy - all versions of libvirt that don't understand the new filter flags already gave us sufficient information in a single XML field to reconstruct a

Re: [libvirt] [PATCH 3/4] snapshot: expose location through virsh snapshot-info

2012-11-19 Thread Peter Krempa
On 11/15/12 00:20, Eric Blake wrote: On 11/14/2012 11:43 AM, Eric Blake wrote: Bleah. Raw XML parsing. Wouldn't it be easier in and cleaner convert this piece code to use the XML parser and xpath? Not the first time we've done this. I agree that using the XML parser and xpath is probably nice

Re: [libvirt] [PATCHv2 1/4] snapshot: add two more filter sets to API

2012-11-19 Thread Peter Krempa
On 11/15/12 00:36, Eric Blake wrote: As we enable more modes of snapshot creation, it becomes more important to be able to quickly filter based on snapshot properties. This patch introduces new filter flags; subsequent patches will introduce virsh back-compat filtering, as well as actual libvirt

Re: [libvirt] RFC: Migration with NPIV

2012-11-19 Thread Osier Yang
On 2012年11月19日 17:30, Osier Yang wrote: Hi, This proposal is trying to figure out a solution for migration of domain which uses LUN behind vHBA as disk device (QEMU emulated disk only at this stage). And other related NPIV improvements which are not related with migration. I'm not luck to get a

[libvirt] RFC: Migration with NPIV

2012-11-19 Thread Osier Yang
Hi, This proposal is trying to figure out a solution for migration of domain which uses LUN behind vHBA as disk device (QEMU emulated disk only at this stage). And other related NPIV improvements which are not related with migration. I'm not luck to get a environment to test if the thoughts are w

Re: [libvirt] [PATCH 1/4] docs: Add documents for memory device

2012-11-19 Thread Paolo Bonzini
Il 19/11/2012 04:45, Osier Yang ha scritto: > On 2012年11月17日 06:47, Paolo Bonzini wrote: >> Il 16/11/2012 10:59, Osier Yang ha scritto: >>> If "path" for "ivshmem" memory device is specified, it's going >>> to be setup with interrupts enabled. Otherwise interrupts is >>> disabled. To be more clear,