Re: [libvirt] [PATCH v3 1/2] conf: Add support of zero-detection for disks

2016-04-28 Thread Peter Krempa
On Thu, Apr 28, 2016 at 16:56:55 +0200, Martin Kletzander wrote: > This option allows or disallows detection of zero-writes if it is set to > "on" or "off", respectively. It can be also set to "unmap" in which > case it will try discarding that part of image based on the value of the > "discard" o

[libvirt] Availability of release candidate 2 of libvirt-1.3.4

2016-04-28 Thread Daniel Veillard
This is tagged in git, signed tarball and rpms are uploaded (hopefully correctly that time :) to the usual place: ftp://libvirt.org/libvirt/ Again with my limited testing everything looks fine, and based on current feedback it seems other people are happy with rc1. Please test rc2, and

Re: [libvirt] [PATCH] vz: fix disk enumeration

2016-04-28 Thread Jiri Denemark
On Thu, Apr 28, 2016 at 10:20:58 +0300, Nikolay Shirokovskiy wrote: > > > On 27.04.2016 18:37, Mikhail Feoktistov wrote: > > If we want to delete all disks for container or vm > > we should make a loop from 0 to NumberOfDisks and always > > use zero index in PrlVmCfg_GetHardDisk to get disk handl

Re: [libvirt] [PATCH] virsh: support up to 64 migration options for command: again

2016-04-28 Thread Jiri Denemark
On Wed, Apr 20, 2016 at 16:51:43 +0300, Nikolay Shirokovskiy wrote: > Add ULL suffix to all related operands of << or shift will give > all zeros instead of correct mask. > > Signed-off-by: Nikolay Shirokovskiy > --- > tools/vsh.c | 18 +- > 1 file changed, 9 insertions(+), 9 del

Re: [libvirt] RFC filesystem pool proposal description.

2016-04-28 Thread Maxim Nestratov
28.04.2016 20:29, Daniel P. Berrange пишет: On Thu, Apr 28, 2016 at 07:57:14PM +0300, Olga Krishtal wrote: In this proposal description we would like to introduce a separate pool type:fspool. Fspool provides and manages filesystems. Below are listed possible examples of fspool, depending on sou

Re: [libvirt] RFC filesystem pool proposal description.

2016-04-28 Thread Daniel P. Berrange
On Thu, Apr 28, 2016 at 07:57:14PM +0300, Olga Krishtal wrote: > In this proposal description we would like to introduce a separate pool > type:fspool. Fspool provides and manages filesystems. > Below are listed possible examples of fspool, depending on source type: > volume, directory or network.

[libvirt] RFC filesystem pool proposal description.

2016-04-28 Thread Olga Krishtal
In this proposal description we would like to introduce a separate pool type:fspool. Fspool provides and manages filesystems. Below are listed possible examples of fspool, depending on source type: volume, directory or network. Volume fspool uses storage pool volume to reside upon. fspool cb

Re: [libvirt] [PATCH 0/8] (incomplete) fix of "peer" address feature

2016-04-28 Thread Andrea Bolognani
On Thu, 2016-04-28 at 10:51 -0400, Laine Stump wrote: > This patch series fixes this feature enoough that it works: >  > 1) emits "peer" attribute in formatted XML when present in the NetDef >object, so that the config will "stick" >  > 2) swaps "address" and "peer" for qemu, so that "address"

Re: [libvirt] [PATCH 0/3] qemu: Fix checks when changing disk media

2016-04-28 Thread Peter Krempa
On Thu, Apr 28, 2016 at 18:08:56 +0200, Peter Krempa wrote: > Few fields were missing and few fields can be actually changed. > > The last two patches actually fix > https://bugzilla.redhat.com/show_bug.cgi?id=1326660 since we reported > incorrect Oops, incorrect BZ. The correct one is: https:/

[libvirt] [PATCH 2/3] qemu: domain: Check few more fields for when changing disk source

2016-04-28 Thread Peter Krempa
Both disk->src->shared and disk->src->readonly can't be modified when changing disk source for floppy and cdrom drives since both arguments are passed as arguments of the disk rather than the image in qemu. Historically these fields have only two possible values since they are represented as XML t

[libvirt] [PATCH 0/3] qemu: Fix checks when changing disk media

2016-04-28 Thread Peter Krempa
Few fields were missing and few fields can be actually changed. The last two patches actually fix https://bugzilla.redhat.com/show_bug.cgi?id=1326660 since we reported incorrect error message. Peter Krempa (3): qemu: domain: Fix error message in qemuDomainDiskChangeSupported qemu: domain: Che

[libvirt] [PATCH 3/3] qemu: hotplug: Allow update of disk default snapshot location

2016-04-28 Thread Peter Krempa
Since the field is internal to libvirt we can allow the users to modify it. --- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_driver.c | 4 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f6e68ea..e6cd775 100644 --- a/src/qemu

[libvirt] [PATCH 1/3] qemu: domain: Fix error message in qemuDomainDiskChangeSupported

2016-04-28 Thread Peter Krempa
disk->dst represents the element in the XML. --- src/qemu/qemu_domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6262bfe..8132ff6 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3828,7 +3828,7 @@

[libvirt] [PATCH 0/2] configure: Improve init script choice

2016-04-28 Thread Andrea Bolognani
If not init script type is explicitly chosen by the user, we try to pick a good default based on the compilation OS. Unfortunately, in that situation our code only really does the right thing for old RHEL releases. Our reporting is sub-par, too. This series makes it so more distributions get the

[libvirt] [PATCH 2/2] configure: Add systemd detection to --with-init-script=check

2016-04-28 Thread Andrea Bolognani
Most distributions, including RHEL, have switched to systemd, so it makes sense for it to be the preferred choice. Our witness for the check is the presence of the /etc/systemd directory on the host. --- configure.ac | 5 + 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configur

[libvirt] [PATCH 1/2] configure: Improve --with-init-script=check

2016-04-28 Thread Andrea Bolognani
If we didn't find a match, either because we're cross compiling or because we're not building on RHEL, we won't install any init script. Make sure this is reported correctly in the configure summary. --- configure.ac | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/

Re: [libvirt] RFC backup API

2016-04-28 Thread Maxim Nestratov
28.04.2016 17:50, Daniel P. Berrange пишет: On Thu, Apr 28, 2016 at 05:02:20PM +0300, Maxim Nestratov wrote: 27.04.2016 15:31, Daniel P. Berrange пишет: On Fri, Apr 08, 2016 at 11:47:29PM +0300, Maxim Nestratov wrote: --

[libvirt] [PATCH v3 0/2] Add support for zero-write detection

2016-04-28 Thread Martin Kletzander
v3: - I know Peter said he'll review it, but there are conflicts every once in a while, so rebased version will apply cleanly for a while - And it's actually not that big of a change to wait for some bigger things to be designed, I believe =) - https://www.redhat.com/archives/libvir-list/2

[libvirt] [PATCH v3 1/2] conf: Add support of zero-detection for disks

2016-04-28 Thread Martin Kletzander
This option allows or disallows detection of zero-writes if it is set to "on" or "off", respectively. It can be also set to "unmap" in which case it will try discarding that part of image based on the value of the "discard" option. Signed-off-by: Martin Kletzander --- docs/formatdomain.html.in

[libvirt] [PATCH v3 2/2] qemu: Add support for zero-detection writes

2016-04-28 Thread Martin Kletzander
Signed-off-by: Martin Kletzander --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c| 11 + tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 + tests/qemucapab

[libvirt] [PATCH 6/8] qemu/lxc: log peer address when setting a domain interface's IP

2016-04-28 Thread Laine Stump
--- src/lxc/lxc_container.c | 23 ++- src/qemu/qemu_interface.c | 24 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 15dacf1..7f4ce72 100644 --- a/src/lxc/lxc_container.c +++ b/

[libvirt] [PATCH 4/8] util: allow calling virSocketAddrGetIpPrefix with NULL netmask or address

2016-04-28 Thread Laine Stump
There are times when we don't have a netmask pointer to give to virSocketAddrGetIpPrefix() (e.g. the IP addresses in domain interfaces only have a prefix, no netmask), but it would have caused a segv if we called it with NULL instead of a pointer to a netmask. This patch qualifies the code that wou

[libvirt] [PATCH 5/8] qemu/lxc: use correct prefix when setting tap/veth IP address

2016-04-28 Thread Laine Stump
Commit c9a641 (first appearred in 1.2.12) added support for setting the guest-side IP address of veth devices in lxc domains, and commit 6e244c (not yet in a release) used that as a model to allow setting the IP address of tap devices in qemu domains. Unfortunately, the original hardcoded the assu

[libvirt] [PATCH 8/8] qemu: require "peer" if ip address is supplied for an interface

2016-04-28 Thread Laine Stump
Since "peer" is really the address of the tap interface, while "address" is actually the peer address of the tap interface, and since you can't set the peer address of a POINTOPOINT tap device without setting the local address, we need to require "peer" in the config. --- src/qemu/qemu_domain.c |

[libvirt] [PATCH 7/8] qemu: swap "address" and "peer" when setting IP address for tap interfaces

2016-04-28 Thread Laine Stump
Commit 6e244c added the ability to set the IP address and peer address for the tap interface used by in qemu. However, it sets the "address" on the host-side of the tap, and the "peer" on the guest side. This is opposite to what is done with veth interfaces in the lxc driver, where "address" is th

[libvirt] [PATCH 2/8] tests: mock virNetDevSetIPAddress

2016-04-28 Thread Laine Stump
Now that we can include in tests, we could almost test XML that has an element in an interface. Except that the test fails when it tries to actually set the IP address for the interface's tap device. This patch mocks virNetDevSetIPAddress() to just return success. --- tests/qemuxml2argvmock.c |

[libvirt] [PATCH 1/8] conf: clean up virDomainNetIpParseXML()

2016-04-28 Thread Laine Stump
Rearrange this function to be better organized and more correct: * the error codes were changed from the incorrect INVALID_ARG to XML_ERROR * prefix still isn't required, but if present it must be valid or an error will be logged. * don't emit a debug log just because prefix or peer is missi

[libvirt] [PATCH 3/8] conf: emit an IP address "peer" attribute in XML when present

2016-04-28 Thread Laine Stump
This was accidentally left out of the patch that added support for setting a tap device's "peer" address, which rendered the new feature DOA. xml2argv and xml2xml tests were added to assure it doesn't disappear in the future. --- src/conf/domain_conf.c | 8 +- ...

[libvirt] [PATCH 0/8] (incomplete) fix of "peer" address feature

2016-04-28 Thread Laine Stump
This patch series fixes this feature enoough that it works: 1) emits "peer" attribute in formatted XML when present in the NetDef object, so that the config will "stick" 2) swaps "address" and "peer" for qemu, so that "address" consistently refers to the IP address used by the guest, and "p

Re: [libvirt] RFC backup API

2016-04-28 Thread Daniel P. Berrange
On Thu, Apr 28, 2016 at 05:02:20PM +0300, Maxim Nestratov wrote: > 27.04.2016 15:31, Daniel P. Berrange пишет: > > >On Fri, Apr 08, 2016 at 11:47:29PM +0300, Maxim Nestratov wrote: > >> > >>int virBackupRestore(const c

[libvirt] [PATCH v3] tools: Fix connect command

2016-04-28 Thread Martin Kletzander
The man page says: "(Re)-Connect to the hypervisor. When the shell is first started, this is automatically run with the URI parameter requested by the "-c" option on the command line." However, if you run: virsh -c 'test://default' 'connect; uri' the output will not be 'test://default'. That'

[libvirt] [PATCH v2 3/3] qemu: Generate channel target paths on hotplug as well

2016-04-28 Thread Martin Kletzander
Since commit 714080791778e3dfbd484ccb3953bffd820b8ba9, qemu agent channel cannot be plugged in because we won't generate its path automatically. Let's not only fix that, but also add tests for it so next time it's checked for. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1322210 Signed-

[libvirt] [PATCH v2 1/3] qemuhotplugtest: Allow testing of live data

2016-04-28 Thread Martin Kletzander
For now, the test was dumping an XML of inactive domain (well, setting the id to '-1' to be precise) when checking the results. This patch enables future additions to test the live XML output as well. Signed-off-by: Martin Kletzander --- tests/qemuhotplugtest.c | 27 +--

[libvirt] [PATCH v2 0/3] qemu: Fix hotplug of guest agent

2016-04-28 Thread Martin Kletzander
v2: - mostly a rebase, it was almost ACKed but not completely, just to make sure let's see it again with everything done. - use /tmp for paths in tests (automatically fixed by rebasing on top of commit 1893b6df117b) v1: - https://www.redhat.com/archives/libvir-list/2016-March/msg01454.htm

[libvirt] [PATCH v2 2/3] qemu: Move channel path generation out of command creation

2016-04-28 Thread Martin Kletzander
Put it into separate function called qemuDomainPrepareChannel() and call it from the new qemuProcessPrepareDomain(). Signed-off-by: Martin Kletzander --- src/qemu/qemu_command.c | 25 +++-- src/qemu/qemu_command.h | 5 ++--- src/qemu/qemu_domain.c | 20

[libvirt] [PATCH v3 4/4] conf: Parse more of our nodedev XML

2016-04-28 Thread Martin Kletzander
We were lacking tests that are checking for the completeness of our nodedev XMLs and also whether we output properly formatted ones. This patch adds parsing for the capability elements inside the element. Also bunch of tests are added to show everything works properly. Signed-off-by: Martin Kle

[libvirt] [PATCH v3 1/4] Change virDevicePCIAddress to virPCIDeviceAddress

2016-04-28 Thread Martin Kletzander
We had both and the only difference was that the latter also included information about multifunction setting. The problem with that was that we couldn't use functions made for only one of the structs (e.g. parsing). To consolidate those two structs, use the one in virpci.h, include that in domai

[libvirt] [PATCH v3 2/4] Move capability formatting together

2016-04-28 Thread Martin Kletzander
All sub-PCI capabilities should be next to each other for clarity. Signed-off-by: Martin Kletzander --- docs/schemas/nodedev.rng | 22 +++--- src/conf/node_device_conf.c| 9 - .../pci__00_1c_0_header_type.xml

[libvirt] [PATCH v3 3/4] schemas: Update nodedev schema to match reality

2016-04-28 Thread Martin Kletzander
There were few things done in the nodedev code but we were lacking tests for it. And because of that we missed that the schema was not updated either. Fix the schema and add various test files to show the schema is correct. Signed-off-by: Martin Kletzander --- docs/schemas/nodedev.rng

[libvirt] [PATCH v3 0/4] Fix parsing our own XMLs

2016-04-28 Thread Martin Kletzander
v3: - Actually use virPCIDeviceAddress. It was actually ACKed with that changed but I feel like it's way too big of a change for just pushing it. Also, I'm in no rush with this, so I'l gladly wait after therelease with this. v2: - Just a rebase - I did *not* use virPCIDeviceAddress w

Re: [libvirt] RFC backup API

2016-04-28 Thread Maxim Nestratov
27.04.2016 15:31, Daniel P. Berrange пишет: On Fri, Apr 08, 2016 at 11:47:29PM +0300, Maxim Nestratov wrote: Hello all, Here is the first more detailed view on the list of the backup API functions that look reasonable to have. Though they are presented with parameters and short description all

Re: [libvirt] [PATCH v3] qemu: Regenerate VNC socket paths

2016-04-28 Thread Pavel Hrdina
On Thu, Apr 28, 2016 at 01:53:21PM +0200, Martin Kletzander wrote: > Similarly to what commit 714080791778 did with some internal paths, > clear vnc socket paths that were generated by us. Having such path in > the definition can cause trouble when restoring the domain. The path is > generated to

Re: [libvirt] [PATCH 5/8] conf: Add disk iothread bus check in device post parse

2016-04-28 Thread John Ferlan
On 04/22/2016 03:04 AM, Peter Krempa wrote: > On Thu, Apr 21, 2016 at 19:24:13 -0400, John Ferlan wrote: >> Add a check in the device post processing for any disk using iothread to be >> using the proper bus (which happens to be only virtio for now). >> >> This check could have been added in devi

Re: [libvirt] [PATCH 6/8] conf: Add support for virtio-scsi iothreads

2016-04-28 Thread John Ferlan
[...] >> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c >> index fd7579a..32e3dcd 100644 >> --- a/src/conf/domain_conf.c >> +++ b/src/conf/domain_conf.c >> @@ -7847,6 +7847,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, >> char *busNr = NULL; >> int numaNode = -1;

Re: [libvirt] [PATCH v2 1/3] qemu: add panic device support for S390

2016-04-28 Thread Boris Fiuczynski
On 04/27/2016 05:02 PM, Andrea Bolognani wrote: On Fri, 2016-04-15 at 10:20 +0200, Boris Fiuczynski wrote: If a panic device is being defined without a model in a domain the default value is always overwritten with model ISA. An ISA bus does not exist on S390 and therefore specifying a panic dev

Re: [libvirt] [PATCH v2 04/12] qemu: Introduce qemuDomainSecretHostdevPrepare and Destroy

2016-04-28 Thread John Ferlan
On 04/27/2016 07:05 PM, Cole Robinson wrote: > On 04/16/2016 10:17 AM, John Ferlan wrote: >> Similar to the qemuDomainSecretDiskPrepare, generate the secret >> for the Hostdev's prior to call qemuProcessLaunch which calls >> qemuBuildCommandLine. Additionally, since the secret is not longer >> ad

Re: [libvirt] [PATCH v2 02/12] qemu: Introduce qemuDomainSecretPrepare and Destroy

2016-04-28 Thread John Ferlan
[...] >> >> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c >> index 26c19ff..24ed8ed 100644 >> --- a/src/qemu/qemu_command.c >> +++ b/src/qemu/qemu_command.c >> @@ -832,7 +832,7 @@ qemuBuildNetworkDriveURI(virStorageSourcePtr src, >> >> int >> qemuGetDriveSourceString(virStor

[libvirt] [PATCH v3] qemu: Regenerate VNC socket paths

2016-04-28 Thread Martin Kletzander
Similarly to what commit 714080791778 did with some internal paths, clear vnc socket paths that were generated by us. Having such path in the definition can cause trouble when restoring the domain. The path is generated to the per-domain directory that contains the domain ID. However, that ID wil

Re: [libvirt] [PATCH v2 2/3] qemu: add default panic device to S390 guests

2016-04-28 Thread Boris Fiuczynski
On 04/27/2016 05:54 PM, Andrea Bolognani wrote: On Fri, 2016-04-15 at 10:20 +0200, Boris Fiuczynski wrote: This patch adds by default a panic device with model s390 to S390 guests. Signed-off-by: Boris Fiuczynski --- src/qemu/qemu_domain.c | 7 ++

[libvirt] [PATCH 09/27] RPC: Introduce virNetStreamSkip

2016-04-28 Thread Michal Privoznik
This is going to be RPC representation for virStreamSkip. Signed-off-by: Michal Privoznik --- src/rpc/virnetprotocol.x | 4 src/virnetprotocol-structs | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/rpc/virnetprotocol.x b/src/rpc/virnetprotocol.x index 327a334..f73e1aa 100644

[libvirt] [PATCH 17/27] daemonStreamHandleRead: Wire up seekable stream

2016-04-28 Thread Michal Privoznik
Whenever client is able to receive some data from stream daemonStreamHandleRead is called. But now the behaviour of this function needs to be changed a bit. Previously it just read data from underlying file (of chardev or whatever) and sent those through the stream to client. This model will not wo

[libvirt] [PATCH 00/27] Introduce sparse streams

2016-04-28 Thread Michal Privoznik
So, after couple of sleepless nights and headaches I'm proud to announce that finally got this working. What? Our regular streams that are can be used to transfer disk images for domains are unaware of any sparseness. Therefore they have two limitations: a) transferring big but sparse image can

[libvirt] [PATCH 26/27] daemon: Don't call virStreamInData so often

2016-04-28 Thread Michal Privoznik
While virStreamInData() should be a small and quick function, in our implementation it seeks multiple times. Moreover, it is called even if we know that we are in data. Well, quite. If we track its return values and do some basic math with them, we can end up calling virStreamInData right at the bo

[libvirt] [PATCH 23/27] virsh: Implement sparse stream to vol-download

2016-04-28 Thread Michal Privoznik
The command grew new --sparse switch that does nothing more than enables the sparse streams feature for this command. Among with the switch new helper function is introduced: virshStreamSkip(). This is the callback that is called whenever daemon sends us a hole. In the callback we reflect the hole

[libvirt] [PATCH 27/27] storage: Enable sparse streams for virStorageVol{Download, Upload}

2016-04-28 Thread Michal Privoznik
Now that we have everything prepared, let's enable the feature for these two APIs. Signed-off-by: Michal Privoznik --- src/storage/storage_backend.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index f92d0

[libvirt] [PATCH 15/27] virnetclientstream: Introduce virNetClientStreamHandleSkip

2016-04-28 Thread Michal Privoznik
This is a function that handles an incoming STREAM_SKIP packet. Even though it is not wired up yet, it will be soon. At the beginning do couple of checks whether server plays nicely and sent us a STREAM_SKIP packed only after we've enabled sparse streams. Then decodes the message payload to see how

[libvirt] [PATCH 13/27] daemon: Introduce virNetServerProgramSendStreamSkip

2016-04-28 Thread Michal Privoznik
This is just a helper function that takes in an offset value, encodes it into XDR and sends to client. Signed-off-by: Michal Privoznik --- src/libvirt_remote.syms | 1 + src/rpc/virnetserverprogram.c | 33 + src/rpc/virnetserverprogram.h | 7 +++ 3 fil

[libvirt] [PATCH 06/27] Introduce virStreamInData and virStreamRegisterInData

2016-04-28 Thread Michal Privoznik
These functions will be called to determine whether underlying file that stream is transferring is currently in a data or hole. While virStreamRegisterInData is exposed, virStreamInData does not need to be made a public API as it will be called just internally. Signed-off-by: Michal Privoznik --

[libvirt] [PATCH 08/27] Track if stream is seekable

2016-04-28 Thread Michal Privoznik
Even though there's no way how to make stream seekable right now, it is going to be soon. We need to track this info so that we don't send virStreamSkip to a client that did not want it or vice versa. Signed-off-by: Michal Privoznik --- daemon/remote.c | 2 +- daemon/stream.c

[libvirt] [PATCH 21/27] gendispatch: Introduce @sparseflag for our calls

2016-04-28 Thread Michal Privoznik
Now, not all APIs are going to support sparse streams. To some it makes no sense at all, e.g. virDomainOpenConsole() or virDomainOpenChannel(). To others, we will need a special flag to indicate that client wants to enable sparse streams. Instead of having to write RPC dispatchers by hand we can ju

[libvirt] [PATCH 22/27] Introduce virStorageVol{Download, Upload}Flags

2016-04-28 Thread Michal Privoznik
These flags to APIs will tell if caller wants to use sparse stream for storage transfer. At the same time, it's safe to enable them in storage driver frontend and rely on our backends checking the flags. This way we can enable specific flags only on some specific backends, e.g. enable VIR_STORAGE_V

[libvirt] [PATCH 10/27] Introduce VIR_NET_STREAM_SKIP message type

2016-04-28 Thread Michal Privoznik
This is a special type of stream packet, that is bidirectional and will contain information on how much bytes are both sides skipping in the stream. Signed-off-by: Michal Privoznik --- daemon/stream.c| 3 ++- src/rpc/virnetclient.c | 1 + src/rpc/virnetprotocol.x | 12 +++

[libvirt] [PATCH 05/27] Introduce virStreamRegisterSkip and virStreamSkipCallback

2016-04-28 Thread Michal Privoznik
The former is a public API and registers a callback that will be called whenever the other side of a stream calls virStreamSkip. The latter is a wrapper that actually calls the callback. It is not made public as it is intended to be used purely internally. Signed-off-by: Michal Privoznik --- inc

[libvirt] [PATCH 16/27] remote_driver: Implement virStreamSkip

2016-04-28 Thread Michal Privoznik
Now that we have RPC wrappers over VIR_NET_STREAM_SKIP we can start wiring them up. This commit wires up situation when a client wants to send a hole to daemon. To keep stream offsets synchronous, upon successful call on the daemon skip the same hole in local part of the stream. Signed-off-by: Mi

[libvirt] [PATCH 03/27] virStream{Recv, Send}All: Increase client buffer

2016-04-28 Thread Michal Privoznik
These are wrappers over virStreamRecv and virStreamSend so that users have to care about nothing but writing data into / reading data from a sink (typically a file). Note, that these wrappers are used exclusively on client side as the daemon has slightly different approach. Anyway, the wrappers all

[libvirt] [PATCH 07/27] virNetClientStreamNew: Track origin stream

2016-04-28 Thread Michal Privoznik
This has no real added value right now, but is going to be very helpful later. Signed-off-by: Michal Privoznik --- src/remote/remote_driver.c | 6 -- src/rpc/gendispatch.pl | 2 +- src/rpc/virnetclientstream.c | 6 +- src/rpc/virnetclientstream.h | 3 ++- 4 files changed, 12 inse

[libvirt] [PATCH 20/27] fdstream: Implement seek

2016-04-28 Thread Michal Privoznik
Implement virStreamSkip and virStreamInData callbacks. These callbacks do no magic, just skip a hole or detect whether we are in a data section of a file or in a hole and how much bytes can we read until section changes. Signed-off-by: Michal Privoznik --- src/fdstream.c | 102 ++

[libvirt] [PATCH 02/27] virnetclientstream: Process stream messages later

2016-04-28 Thread Michal Privoznik
There are two functions on the client that handle incoming stream data. The first one virNetClientStreamQueuePacket() is a low level function that just processes the incoming stream data from the socket and stores it into an internal structure. This happens in the client event loop therefore the s

[libvirt] [PATCH 25/27] fdstream: Suppress use of IO helper for sparse streams

2016-04-28 Thread Michal Privoznik
This is kind of a hacky approach to the following problem, but so far I am unable to come up with anything better. On some occasions (esp. when dealing with regular files) libvirt_iohelper is spawned to prefetch data for us. We will then have a pipe then for reading the data from it. This does not

[libvirt] [PATCH 24/27] virsh: Implement sparse stream to vol-upload

2016-04-28 Thread Michal Privoznik
Similarly to previous commit, implement sparse streams feature for vol-upload. This is, however, slightly different approach, because we must implement a function that will tell us whether we are in a data section or in a hole. But there's no magic hidden in here. Signed-off-by: Michal Privoznik

[libvirt] [PATCH 11/27] Teach wireshark plugin about VIR_NET_STREAM_SKIP

2016-04-28 Thread Michal Privoznik
Ideally, this would be generated, but to achieve that corresponding XDR definitions needed to go into a different .x file. But they belong just to the one that they are right now. Signed-off-by: Michal Privoznik --- tools/wireshark/src/packet-libvirt.c | 40

[libvirt] [PATCH 19/27] virStreamSendAll: Wire up sparse streams

2016-04-28 Thread Michal Privoznik
Plenty of clients use virStreamSendAll() instead of using virStreamSend() directly. We should allow those clients to utilize the new feature too. Signed-off-by: Michal Privoznik --- src/libvirt-stream.c | 37 +++-- 1 file changed, 31 insertions(+), 6 deletions(-)

[libvirt] [PATCH 18/27] virNetClientStream: Wire up VIR_NET_STREAM_SKIP

2016-04-28 Thread Michal Privoznik
Whenever server sends a client stream packet (either regular with actual data or stream skip one) it is queued on @st->rx. So the list is a mixture of both types of stream packets. So now that we have all the helpers needed we can wire their processing up. Signed-off-by: Michal Privoznik --- src

[libvirt] [PATCH 12/27] daemon: Implement VIR_NET_STREAM_SKIP handling

2016-04-28 Thread Michal Privoznik
Basically, whenever the new type of stream packet arrives to the daemon call this function that decodes it and calls virStreamSkipCallback(). Otherwise a regular data stream packet has arrived and therefore continue its processing. Signed-off-by: Michal Privoznik --- daemon/stream.c | 68 ++

[libvirt] [PATCH 14/27] virnetclientstream: Introduce virNetClientStreamSendSkip

2016-04-28 Thread Michal Privoznik
While the previous commit implemented a helper for sending a STREAM_SKIP packet for daemon, this is a client's counterpart. Signed-off-by: Michal Privoznik --- src/libvirt_remote.syms | 1 + src/rpc/virnetclientstream.c | 52 src/rpc/virnetclien

[libvirt] [PATCH 04/27] Introduce virStreamSkip

2016-04-28 Thread Michal Privoznik
This API can be used to tell the other side of the stream to skip some bytes in the stream. This can be used to create a sparse file on the receiving side of a stream. It takes just one argument @offset, which says how big the hole is. Since our streams are not rewindable like regular files, we do

[libvirt] [PATCH 01/27] Revert "rpc: Fix slow volume download (virsh vol-download)"

2016-04-28 Thread Michal Privoznik
This reverts commit d9c9e138f22c48626f719f880920e04c639e0177. Unfortunately, things are going to be handled differently so this commit must go. Signed-off-by: Michal Privoznik --- src/rpc/virnetclientstream.c | 152 +++ 1 file changed, 53 insertions(+), 9

[libvirt] [PATCH 1/2] virsh: Introduce virshDomainDetachInterface function.

2016-04-28 Thread Nitesh Konkar
virshDomainDetachInterface handles virsh interface detach from the specified live/config domain xml. Signed-off-by: Nitesh Konkar --- tools/virsh-domain.c | 99 1 file changed, 99 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-

[libvirt] [PATCH 0/2] virsh: Properly handle detach-interface --live --config.

2016-04-28 Thread Nitesh Konkar
The virsh attach/detach interface command fails when both live and config are set and when the interface gets attached to different pci slots on live and config xml respectively. When we attach an interface with both --live and --config, the first time they get the same PCI slots, but the second

[libvirt] [PATCH 2/2] virsh: Pass the corect live/config xml to virshDomainDetachInterface.

2016-04-28 Thread Nitesh Konkar
cmdDetachInterface function checks for live config flags and then passes the live/config domain xml to virshDomainDetachInterface accordingly. Signed-off-by: Nitesh Konkar --- tools/virsh-domain.c | 114 +-- 1 file changed, 19 insertions(+), 95 d

Re: [libvirt] [PATCH v2] qemu: Regenerate VNC socket paths

2016-04-28 Thread Martin Kletzander
On Thu, Apr 28, 2016 at 10:50:36AM +0200, Martin Kletzander wrote: On Thu, Apr 28, 2016 at 09:16:46AM +0200, Pavel Hrdina wrote: On Wed, Apr 27, 2016 at 04:32:36PM +0200, Martin Kletzander wrote: Similarly to what commit 714080791778 did with some internal paths, clear vnc socket paths that wer

Re: [libvirt] [PATCH v2] qemu: Regenerate VNC socket paths

2016-04-28 Thread Martin Kletzander
On Thu, Apr 28, 2016 at 09:16:46AM +0200, Pavel Hrdina wrote: On Wed, Apr 27, 2016 at 04:32:36PM +0200, Martin Kletzander wrote: Similarly to what commit 714080791778 did with some internal paths, clear vnc socket paths that were generated by us. Having such path in the definition can cause tro

Re: [libvirt] [PATCH] qemu: Error out if setting vcpu count would lead to invalid config

2016-04-28 Thread Peter Krempa
On Wed, Apr 27, 2016 at 17:36:06 +0200, Martin Kletzander wrote: > On Wed, Apr 27, 2016 at 04:48:43PM +0200, Peter Krempa wrote: > >When the domain definition describes a machine with NUMA, setting the > >maximum vCPU count via the API might lead to an invalid config. > > > >Add a check that will f

Re: [libvirt] [PATCH v2] qemu: conf: Set default logging approach in virQEMUDriverConfigNew

2016-04-28 Thread Peter Krempa
On Wed, Apr 27, 2016 at 17:21:15 +0200, Martin Kletzander wrote: > On Wed, Apr 27, 2016 at 04:35:37PM +0200, Peter Krempa wrote: > >Instead of setting the default qemu stdio logging approach in > >virQEMUDriverConfigLoadFile set it in virQEMUDriverConfigNew so that > >it's properly set even when th

Re: [libvirt] [PATCH v2 06/12] qemu: hotplug: Assume support for -device for attach virtio disk

2016-04-28 Thread Peter Krempa
On Wed, Apr 27, 2016 at 19:07:57 -0400, Cole Robinson wrote: > On 04/16/2016 10:17 AM, John Ferlan wrote: > > Since support for QEMU_CAPS_DEVICE is not assumed, let's drop the legacy > > code to make life easier going forward. > > > > Signed-off-by: John Ferlan > > --- > > src/qemu/qemu_hotplug.

Re: [libvirt] [PATCH] trivial: zh_CN: fix the wrong translation

2016-04-28 Thread Peter Krempa
On Thu, Apr 28, 2016 at 09:21:45 +0800, Wanlong Gao wrote: > From: Allen Gao > > s/数值/设置/ > > Signed-off-by: Wanlong Gao > --- > po/zh_CN.po | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) We pull translations from libvirt's subproject on zanata: https://fedora.zanata.org/project

Re: [libvirt] [PATCH] vz: fix disk enumeration

2016-04-28 Thread Nikolay Shirokovskiy
On 27.04.2016 18:37, Mikhail Feoktistov wrote: > If we want to delete all disks for container or vm > we should make a loop from 0 to NumberOfDisks and always > use zero index in PrlVmCfg_GetHardDisk to get disk handle. > When we delete first disk after that numbers of other disks > will be chang

Re: [libvirt] [PATCH v2] qemu: Regenerate VNC socket paths

2016-04-28 Thread Pavel Hrdina
On Wed, Apr 27, 2016 at 04:32:36PM +0200, Martin Kletzander wrote: > Similarly to what commit 714080791778 did with some internal paths, > clear vnc socket paths that were generated by us. Having such path in > the definition can cause trouble when restoring the domain. The path is > generated to

Re: [libvirt] [PATCH] send default USB controller in xml to destination during migration on PPC64

2016-04-28 Thread Shivaprasad bhat
Thanks Cole.. Here is the XML for a PPC64 guest. https://paste.fedoraproject.org/360574/61826548/ You can see the slot 1 is free as I unplugged a device there. On X86, Q35 seems to use the model ich9-ehci1 by default. So, may not be applicable there. For pc-i440fx, I couldn't force USB to occupy a