Re: [libvirt] [PATCH V2 2/4] libxl: support hotplug USB host device

2016-05-23 Thread Chun Yan Liu
>>> On 5/24/2016 at 03:23 AM, in message <57435894.9080...@suse.com>, Jim Fehlig wrote: > On 05/23/2016 12:51 AM, Chun Yan Liu wrote: > > > > Yes, I think it's OK. And another place needs to be updated, since now it's > > not only pci device, but also could be usb device,

[libvirt] [PATCH] libxl: default to qemu driver for network disks

2016-05-23 Thread Jim Fehlig
Xen only supports network-based disks with the qemu (aka qdisk) driver. Set the driverName to 'qemu' in libxlDomainDeviceDefPostParse() if not already set. When starting a domain with network-based disks, ensure the driverName is 'qemu'. Signed-off-by: Jim Fehlig ---

[libvirt] [PATCH] esx: do not store escaped password in esxVI_Context.

2016-05-23 Thread Dawid Zamirski
This patch fixes an issue where screenshot API call was failing when the esx/vcenter password contains special characters such as apostrophee. The reason for failures was that passwords were escaped for XML and stored in esxVI_Context which was then passed to raw CURL API calls where the password

[libvirt] [PATCH] esx: use lsilogic adapter type in vol create.

2016-05-23 Thread Dawid Zamirski
ESX will refuse to attach VMDKS that have buslogic adatper type to 64bit VMs whereas lsilogic works fine both 32bit and 64bit VMs. --- src/esx/esx_storage_backend_vmfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esx/esx_storage_backend_vmfs.c

[libvirt] [PATCH 0/3] esx: improve virtualHW > 7 handling.

2016-05-23 Thread Dawid Zamirski
Hello, The following patches are for issues found when using libvirt to create/manage VMs on ESXi hosts (5.5 and 6). The first patch addresses a fairly common issue with creating VMs on ESXi with SCSI controllers. The other two are to less common but work around known ESX issues e.g. 4TB drive

[libvirt] [PATCH 2/3] esx: Add VMCI device for virtualHW >= 7

2016-05-23 Thread Dawid Zamirski
This patch fixes an issue where vMotion fails when VMCI device is not present in the vmx file. --- src/vmx/vmx.c | 2 ++ tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.vmx | 1 + tests/xml2vmxdata/xml2vmx-serial-network-client.vmx | 1 +

[libvirt] [PATCH 1/3] esx: add pciBridge devices when SCSI is used

2016-05-23 Thread Dawid Zamirski
When a SCSI controller is present, ESX adds several pciBridge devices to vmx file. This fixes an error message where it refuses to create VM due to not enough PCI devices available. This applies only to virtualHW version >= 7. --- src/vmx/vmx.c | 25

[libvirt] [PATCH 3/3] esx: use newer virtualHW version for 5.1+ hosts

2016-05-23 Thread Dawid Zamirski
This is because there's a known issue where ESX will refuse to attach drives bigger than 4TB when virtualHW < 9. Therefore, to avoid that use the higher virtualHW for hosts that support it. --- https://kb.vmware.com/selfservice/microsites/search.do?language=en_US=displayKC=2054952

[libvirt] [PATCH v3 05/13] Separate the hostdevice preparation and checks to a new funtion

2016-05-23 Thread Shivaprasad G Bhat
No Functional change. Signed-off-by: Shivaprasad G Bhat --- src/qemu/qemu_hotplug.c | 90 +-- src/qemu/qemu_hotplug.h |5 +++ 2 files changed, 61 insertions(+), 34 deletions(-) diff --git a/src/qemu/qemu_hotplug.c

[libvirt] [PATCH v3 12/13] Pass virDomainDeviceDefListPtr to hotplug functions

2016-05-23 Thread Shivaprasad G Bhat
This actually does all the things as though there were more than one device in list. Signed-off-by: Shivaprasad G Bhat --- src/qemu/qemu_domain.c | 50 +++--- src/qemu/qemu_domain.h |6 +-- src/qemu/qemu_driver.c | 82

[libvirt] [PATCH v3 13/13] Enable PCI Multifunction hotplug/unplug

2016-05-23 Thread Shivaprasad G Bhat
The flow is to parse and create a list of devices and pass onto the hotplug functions. The patch also removes all checks forbidding the multifunction hotplug. Signed-off-by: Shivaprasad G Bhat --- src/qemu/qemu_driver.c | 166

[libvirt] [PATCH v3 11/13] Move the detach of PCI device to the beginnging of live hotplug

2016-05-23 Thread Shivaprasad G Bhat
The hostdevices are the only devices which have dependencies outside of themselves such that, other functions of the PCI card should also have been detached from host driver before attempting the hotplug. This patch moves the detach to the beginning of the hotplug so that the following patch can

[libvirt] [PATCH v3 10/13] Move the virDomainDefCompatibleDevice checks a level down

2016-05-23 Thread Shivaprasad G Bhat
The checks need to be performed per device and its better to do them a level down in stack as we prepare for multifunction hotplug. Signed-off-by: Shivaprasad G Bhat --- src/qemu/qemu_domain.c | 12 src/qemu/qemu_driver.c | 24

[libvirt] [PATCH v3 09/13] Introduce qemuDomain*DeviceConfigInternal

2016-05-23 Thread Shivaprasad G Bhat
This helps moving some checks into the top function before actually going ahead with the operation. Signed-off-by: Shivaprasad G Bhat --- src/qemu/qemu_domain.c | 45 - 1 file changed, 36 insertions(+), 9 deletions(-) diff

[libvirt] [PATCH v3 06/13] Move the qemu[*]DomainDeviceConfig to qemu_domain.c

2016-05-23 Thread Shivaprasad G Bhat
No functional change. Signed-off-by: Shivaprasad G Bhat --- src/qemu/qemu_domain.c | 401 src/qemu/qemu_domain.h | 17 ++ src/qemu/qemu_driver.c | 401 3 files

[libvirt] [PATCH v3 08/13] Introduce qemuDomain*DeviceLiveInternal

2016-05-23 Thread Shivaprasad G Bhat
This helps moving some checks into the top function before actually going ahead with the operation. Signed-off-by: Shivaprasad G Bhat --- src/qemu/qemu_hotplug.c | 47 +++ 1 file changed, 39 insertions(+), 8 deletions(-)

[libvirt] [PATCH v3 07/13] Move qemuDomain[*]Live functions to qemu_hotplug.c

2016-05-23 Thread Shivaprasad G Bhat
No functional change. Signed-off-by: Shivaprasad G Bhat --- src/qemu/qemu_driver.c | 337 --- src/qemu/qemu_hotplug.c | 337 +++ src/qemu/qemu_hotplug.h | 19 +++ 3 files

[libvirt] [PATCH v3 04/13] Introduce virDomainPCIMultifunctionDeviceAddressAssign

2016-05-23 Thread Shivaprasad G Bhat
This patch assigns multifunction pci addresses to devices in the devlist. The pciaddrs passed in the argument is not altered so that the actual call to reserve the address using virDomainPCIAddressEnsureAddr() passes. The function focuses on user given address validation and also the auto-assign

[libvirt] [PATCH v3 03/13] Introduce PCI Multifunction device parser

2016-05-23 Thread Shivaprasad G Bhat
This patch just introduces the parser function used by the later patches. The parser disallows hostdevices to be used with other virtio devices simultaneously. Signed-off-by: Shivaprasad G Bhat --- src/conf/domain_conf.c | 123

[libvirt] [PATCH v3 02/13] Validate address in virDomainPCIAddressReleaseAddr

2016-05-23 Thread Shivaprasad G Bhat
This function was not used so far. Now, that we begin to use it, make sure to check the address before actually releasing the address. Signed-off-by: Shivaprasad G Bhat --- src/conf/domain_addr.c | 18 +- 1 file changed, 17 insertions(+), 1

[libvirt] [PATCH v3 01/13] Release address in function granularity than slot

2016-05-23 Thread Shivaprasad G Bhat
The commit 6fe678c is partly reverted. The code is moved around and cant revert staright. Doing this at function level is necessary because some devices may not be removed by guest or may take time and new hotplug shouldn't assume the slot is free just because one of the function was freed by the

[libvirt] [PATCH v3 00/13] PCI Multifunction device hotplug support

2016-05-23 Thread Shivaprasad G Bhat
V2 was posted here. http://www.redhat.com/archives/libvir-list/2016-May/msg01384.html Changes from V2: -Squashed the original patch 1 with the patch which actually enables multifunction hotplug as suggested. -As suggested, introduced the virDomainDeviceDefParseMany for parsing. -Retained the

[libvirt] [PATCH v2 2/3] conf: make virDomainControllerFindUnusedIndex() more generally usable

2016-05-23 Thread Laine Stump
Make virDomainControllerFindUnusedIndex() a global function so that it can be used outside domain_conf.c (as well as higher up in domain_conf.c itself)/ Also make its DomainDef arg a const* so that functions which only have a const* to the domain can use it. --- Change from V1: made the function

[libvirt] [PATCH v2 1/3] conf/qemu: make IS_USB2_CONTROLLER globally available

2016-05-23 Thread Laine Stump
IS_USB2_CONTROLLER() is useful in more places aside from just when assigning PCI addresses in QEMU, and is checking for enum values that are all defined in conf/domain_conf.h anyway, so define it there instead. --- Unchanged from V1 src/conf/domain_conf.h | 7 +++

[libvirt] [PATCH v2 3/3] conf: permit auto-assignment of controller indexes

2016-05-23 Thread Laine Stump
Hand-entering indexes for 20 PCI controllers is not as tedious as manually determining and entering their PCI addresses, but it's still annoying, and the algorithm for determining the proper index is incredibly simple (in all cases except one) - just pick the lowest unused index. The one

[libvirt] [PATCH v2 0/3] auto-assign controller indexes

2016-05-23 Thread Laine Stump
Patches 1 and 2 just shuffle a couple of existing functions. Patch 3 gets to the point. v1->v2 changes are explained in patch 3. Laine Stump (3): conf/qemu: make IS_USB2_CONTROLLER globally available conf: make virDomainControllerFindUnusedIndex() more generally usable conf: permit

Re: [libvirt] [PATCH v2 8/8] storage: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Cole Robinson
On 05/23/2016 02:36 PM, Jovanka Gulicoska wrote: > Replace VIR_ERROR with virReportError and virReportSystemError > --- > src/storage/storage_driver.c | 32 > 1 file changed, 20 insertions(+), 12 deletions(-) > > diff --git a/src/storage/storage_driver.c

Re: [libvirt] [PATCH v2 4/8] libxl: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Cole Robinson
On 05/23/2016 02:35 PM, Jovanka Gulicoska wrote: > Replace VIR_ERROR with virReportError > --- > src/libxl/libxl_driver.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c > index b8b4c24..e70e124 100644 > ---

Re: [libvirt] [PATCH v2 3/8] bhyve: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Cole Robinson
On 05/23/2016 02:35 PM, Jovanka Gulicoska wrote: > Replace VIR_ERROR with virReportError > --- > src/bhyve/bhyve_driver.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c > index c58286f..8afa599 100644 > ---

Re: [libvirt] [PATCH v2 6/8] nwfilter: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Cole Robinson
On 05/23/2016 02:35 PM, Jovanka Gulicoska wrote: > Replace VIR_ERROR with virReportError > --- > src/nwfilter/nwfilter_driver.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c > index 2828b28..186830c

Re: [libvirt] [PATCH v2 1/8] uml: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Cole Robinson
On 05/23/2016 02:35 PM, Jovanka Gulicoska wrote: > Replace VIR_ERROR with virReportError and virReportSystemError > --- > src/uml/uml_driver.c | 20 ++-- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c > index

Re: [libvirt] [PATCH V2 2/4] libxl: support hotplug USB host device

2016-05-23 Thread Jim Fehlig
On 05/23/2016 12:51 AM, Chun Yan Liu wrote: > > Yes, I think it's OK. And another place needs to be updated, since now it's > not only pci device, but also could be usb device, so the error message > should be updated. > if (virDomainHostdevFind(vmdef, hostdev, ) >= 0) { > -

Re: [libvirt] [PATCH 1/2] nodedev: sysfs: Set PCI_PHYSICAL_FUNCTION flag more carefully

2016-05-23 Thread Laine Stump
On 05/23/2016 07:53 AM, Andrea Bolognani wrote: The flag was set if virPCIGetPhysicalFunction() did not return an error; unfortunately, the 'physfn' sysfs file not being present is not considered an error, which means that the flag was set pretty much unconditionally. This behavior is the

[libvirt] [PATCH v2 4/8] libxl: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Jovanka Gulicoska
Replace VIR_ERROR with virReportError --- src/libxl/libxl_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index b8b4c24..e70e124 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -319,9

[libvirt] [PATCH v2 2/8] xen: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Jovanka Gulicoska
Replace VIR_ERROR with virReportSystemError --- src/xen/xen_driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 3f5d80d..cc5c92d 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -532,8 +532,9 @@

[libvirt] [PATCH v2 0/8] Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Jovanka Gulicoska
Replace VIR_ERROR logging macros for error reporting in driver startup routines with vir*Error function. Link to task: http://wiki.libvirt.org/page/BiteSizedTasks#Replace_VIR_ERROR_with_standard_vir.2AError_in_state_driver_init Jovanka Gulicoska (8): uml: Replace VIR_ERROR with standard

[libvirt] [PATCH v2 1/8] uml: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Jovanka Gulicoska
Replace VIR_ERROR with virReportError and virReportSystemError --- src/uml/uml_driver.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 923c3f6..fea3575 100644 --- a/src/uml/uml_driver.c +++

[libvirt] [PATCH v2 5/8] node_device: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Jovanka Gulicoska
Replace VIR_ERROR with virReportError and virReportSystemError --- src/node_device/node_device_hal.c | 24 src/node_device/node_device_udev.c | 45 -- 2 files changed, 43 insertions(+), 26 deletions(-) diff --git

[libvirt] [PATCH v2 8/8] storage: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Jovanka Gulicoska
Replace VIR_ERROR with virReportError and virReportSystemError --- src/storage/storage_driver.c | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index eb5f688..879b3c7 100644 ---

[libvirt] [PATCH v2 7/8] qemu: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Jovanka Gulicoska
Replace VIR_ERROR with virReportError and virReportSystemError --- src/qemu/qemu_driver.c | 55 -- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 249393a..e711204 100644 ---

[libvirt] [PATCH v2 3/8] bhyve: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Jovanka Gulicoska
Replace VIR_ERROR with virReportError --- src/bhyve/bhyve_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index c58286f..8afa599 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -88,8 +88,8

[libvirt] [PATCH v2 6/8] nwfilter: Replace VIR_ERROR with standard vir*Error in state driver init

2016-05-23 Thread Jovanka Gulicoska
Replace VIR_ERROR with virReportError --- src/nwfilter/nwfilter_driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 2828b28..186830c 100644 --- a/src/nwfilter/nwfilter_driver.c +++

[libvirt] [PATCHv2 2/3] qemu: format SLIC ACPI table command line

2016-05-23 Thread Ján Tomko
/path/to/acpi/table/file will result in: -acpitable sig=SLIC,file=/path/to/acpi/table/file This option was introduced by QEMU commit 8a92ea2 in 2009. https://bugzilla.redhat.com/show_bug.cgi?id=1327537 --- src/qemu/qemu_command.c | 7 +++

[libvirt] [PATCHv2 0/3] qemu: support for SLIC ACPI tables

2016-05-23 Thread Ján Tomko
Windows uses this BLOB for activation purposes. https://bugzilla.redhat.com/show_bug.cgi?id=1327537 In v2: * make a subelement of * minor documentation fixes * comma-escape the value on QEMU command line * mention that this option was added in 2009 Ján Tomko (3): conf: add to qemu:

[libvirt] [PATCHv2 1/3] conf: add to

2016-05-23 Thread Ján Tomko
Add a new element to XML: /path/to/acpi/table/file To supply a path to a SLIC (Software Licensing) ACPI table blob. https://bugzilla.redhat.com/show_bug.cgi?id=1327537 --- docs/formatdomain.html.in | 8 docs/schemas/domaincommon.rng

[libvirt] [PATCHv2 3/3] security: label the slic_table

2016-05-23 Thread Ján Tomko
Add support for the slic_table to the security drivers. --- src/security/security_dac.c | 5 + src/security/security_selinux.c | 5 + src/security/virt-aa-helper.c | 4 3 files changed, 14 insertions(+) diff --git a/src/security/security_dac.c b/src/security/security_dac.c

Re: [libvirt] [PATCH] vz: add error code for case if vm is already stopped

2016-05-23 Thread Maxim Nestratov
21.05.2016 17:33, Mikhail Feoktistov пишет: If try to stop VM or container which is already stopped than Virtuozzo 7 returns code PRL_ERR_INVALID_ACTION_REQUESTED. Error code PRL_ERR_DISP_VM_IS_NOT_STARTED is used in Virtuozzo 6 --- src/vz/vz_sdk.c | 1 + 1 file changed, 1 insertion(+) diff

Re: [libvirt] [PATCH] qemu: don't refuse to undefine a guest with NVRAM file

2016-05-23 Thread Cole Robinson
On 05/23/2016 12:37 PM, Michal Privoznik wrote: > On 23.05.2016 11:16, Maxim Nestratov wrote: >> 24.02.2015 13:12, Daniel P. Berrange пишет: >> >>> The undefine operation should always be allowed to succeed >>> regardless of whether any NVRAM file exists. ie we should >>> not force the application

Re: [libvirt] [PATCH] qemu: don't refuse to undefine a guest with NVRAM file

2016-05-23 Thread Maxim Nestratov
23.05.2016 19:37, Michal Privoznik пишет: On 23.05.2016 11:16, Maxim Nestratov wrote: 24.02.2015 13:12, Daniel P. Berrange пишет: The undefine operation should always be allowed to succeed regardless of whether any NVRAM file exists. ie we should not force the application to use the

Re: [libvirt] [PATCH] qemu: don't refuse to undefine a guest with NVRAM file

2016-05-23 Thread Michal Privoznik
On 23.05.2016 11:16, Maxim Nestratov wrote: > 24.02.2015 13:12, Daniel P. Berrange пишет: > >> The undefine operation should always be allowed to succeed >> regardless of whether any NVRAM file exists. ie we should >> not force the application to use the VIR_DOMAIN_UNDEFINE_NVRAM >> flag. It is

Re: [libvirt] [PATCH] Oracle VirtualBox 5 support or libvirt

2016-05-23 Thread Eric Blake
[the moderation queue rejected your message for being too large] On 12/31/1969 05:00 PM, wrote: > --- > src/Makefile.am | 1 + > src/vbox/vbox_CAPI_v5_0.h | 25550 > That's an awfully large patch, particularly if it is mostly

[libvirt] [PATCH v2 26/32] gendispatch: Introduce @sparseflag for our calls

2016-05-23 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

[libvirt] [PATCH v2 24/32] daemonStreamHandleRead: Wire up seekable stream

2016-05-23 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

[libvirt] [PATCH v2 17/32] virnetclientstream: Introduce virNetClientStreamHandleSkip

2016-05-23 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

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

2016-05-23 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

[libvirt] [PATCH v2 00/32] Introduce sparse streams

2016-05-23 Thread Michal Privoznik
v2 of: https://www.redhat.com/archives/libvir-list/2016-April/msg01869.html diff to v1: - Reworked public API side of the feature. Event approach is no longer used. Instead I've implemented synchronous APIs as Dan suggested. You can find the code at my github repo too:

[libvirt] [PATCH v2 28/32] virsh: Implement sparse stream to vol-download

2016-05-23 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 v2 31/32] fdstream: Suppress use of IO helper for sparse streams

2016-05-23 Thread Michal Privoznik
NOT TO BE APPLIED UPSTREAM! This is just a hack so that reviewers can try sparse streams out. Problem is, if nonblocking streams are requested (which is case of every single stream in the daemon), we spawn IO helper and create a pipe to read data from it. But that means fd that

[libvirt] [PATCH v2 29/32] virsh: Implement sparse stream to vol-upload

2016-05-23 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 v2 22/32] virNetClientStream: Wire up VIR_NET_STREAM_SKIP

2016-05-23 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. But since virNetClientStreamRecvPacket

[libvirt] [PATCH v2 02/32] Implement virStreamRecvFlags to some drivers

2016-05-23 Thread Michal Privoznik
We have three virStreamDriver-s currently in our tree. virFDStream, remote driver and ESX driver.f or now, support for remote driver and ESX driver is sufficient, because implementation for virFDStream is going to be supplied later as it needs to be slightly different. Signed-off-by: Michal

[libvirt] [PATCH v2 15/32] virnetclientstream: Introduce virNetClientStreamSendSkip

2016-05-23 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

[libvirt] [PATCH v2 21/32] remote: Implement virStreamHoleSize

2016-05-23 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/remote/remote_driver.c | 24 1 file changed, 24 insertions(+) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 824fe03..5507713 100644 --- a/src/remote/remote_driver.c +++

[libvirt] [PATCH v2 06/32] Introduce virStreamSparseRecvAll

2016-05-23 Thread Michal Privoznik
This is just a wrapper over new functions that have been just introduced: virStreamRecvFlags(), virStreamHoleSize(). It's very similar to virStreamRecvAll() except it handles sparse streams well. Signed-off-by: Michal Privoznik --- include/libvirt/libvirt-stream.h | 28

[libvirt] [PATCH v2 08/32] Introduce virStreamInData

2016-05-23 Thread Michal Privoznik
This is just an internal API, that calls corresponding function in stream driver. This function will set @data=1 if the underlying file is in data section, or @data=0 if it is in a hole. At any rate, @length is set to number of bytes remaining in the section the file currently is. Signed-off-by:

[libvirt] [PATCH v2 18/32] remote_driver: Implement virStreamSkip

2016-05-23 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:

[libvirt] [PATCH] qemu: Fix error message when PCI bridge has index <= bus

2016-05-23 Thread Andrea Bolognani
Commit ff2126225df0 changed the error message to be more detailed about the failure at hand; however, while the new error message claims that "bus must be <= index", the error message is displayed if "idx <= addr->bus", ie. when bus is bigger than or *equal to* index. Change the error message to

[libvirt] [PATCH v2 16/32] daemon: Implement VIR_NET_STREAM_SKIP handling

2016-05-23 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 ---

[libvirt] [PATCH v2 11/32] RPC: Introduce virNetStreamSkip

2016-05-23 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

[libvirt] [PATCH v2 12/32] Introduce VIR_NET_STREAM_SKIP message type

2016-05-23 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 +

[libvirt] [PATCH v2 20/32] Introduce virNetClientStreamHoleSize

2016-05-23 Thread Michal Privoznik
This function will fetch previously processed stream holes and return their sum. Signed-off-by: Michal Privoznik --- src/libvirt_remote.syms | 1 + src/rpc/virnetclientstream.c | 15 +++ src/rpc/virnetclientstream.h | 4 3 files changed, 20

[libvirt] [PATCH v2 10/32] Track if stream is skippable

2016-05-23 Thread Michal Privoznik
Even though there's no way to make stream skippable 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 +-

[libvirt] [PATCH v2 23/32] remote_driver: Implement VIR_STREAM_RECV_STOP_AT_HOLE

2016-05-23 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/remote/remote_driver.c | 2 +- src/rpc/virnetclientstream.c | 11 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 5507713..72f8f21 100644 ---

[libvirt] [PATCH v2 19/32] virNetClientStreamRecvPacket: Introduce @flags argument

2016-05-23 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/remote/remote_driver.c | 3 ++- src/rpc/virnetclientstream.c | 10 +++--- src/rpc/virnetclientstream.h | 3 ++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/remote/remote_driver.c

[libvirt] [PATCH v2 03/32] Introduce virStreamSkip

2016-05-23 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 @length, which says how big the hole is. Since our streams are not rewindable like regular files, we

[libvirt] [PATCH v2 25/32] fdstream: Implement seek

2016-05-23 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 |

[libvirt] [PATCH v2 04/32] Introduce virStreamHoleSize

2016-05-23 Thread Michal Privoznik
This function is basically a counterpart for virStreamSkip. If one side of a stream called virStreamSkip() the other should call virStreamHoleSize() to get the size of the hole. Signed-off-by: Michal Privoznik --- include/libvirt/libvirt-stream.h | 3 +++

[libvirt] [PATCH v2 09/32] virNetClientStreamNew: Track origin stream

2016-05-23 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

[libvirt] [PATCH v2 07/32] Introduce virStreamSparseSendAll

2016-05-23 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- include/libvirt/libvirt-stream.h | 43 ++-- src/libvirt-stream.c | 104 +++ src/libvirt_public.syms | 1 + 3 files changed, 145 insertions(+), 3 deletions(-) diff

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

2016-05-23 Thread Michal Privoznik
NOT TO BE APPLIED UPSTREAM! Now that we have everything prepared, let's enable the feature for these two APIs. Well, except we can't. Not just yet. Because of the previous commit. Signed-off-by: Michal Privoznik --- src/storage/storage_backend.c | 6 -- 1 file changed,

[libvirt] [PATCH v2 14/32] daemon: Introduce virNetServerProgramSendStreamSkip

2016-05-23 Thread Michal Privoznik
This is just a helper function that takes in a length value, encodes it into XDR and sends to client. Signed-off-by: Michal Privoznik --- src/libvirt_remote.syms | 1 + src/rpc/virnetserverprogram.c | 33 +

[libvirt] [PATCH v2 01/32] Introduce virStreamRecvFlags

2016-05-23 Thread Michal Privoznik
Although we already have virStreamRecv, just like some other older APIs it is missing @flags argument. This means, the function is not that flexible and therefore we need virStreamRecvFlags. The latter is going to be needed when we will want it to stop at a hole in stream. Signed-off-by: Michal

[libvirt] [PATCH v2 30/32] daemon: Don't call virStreamInData so often

2016-05-23 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

[libvirt] [PATCH v2 05/32] Introduce VIR_STREAM_RECV_STOP_AT_HOLE flag

2016-05-23 Thread Michal Privoznik
This flag is for virStreamRecvFlags API. Its purpose is to stop reading from the stream if a hole occurred as holes are to be threated separately. Signed-off-by: Michal Privoznik --- include/libvirt/libvirt-stream.h | 4 src/libvirt-stream.c | 30

[libvirt] [PATCH v2 13/32] Teach wireshark plugin about VIR_NET_STREAM_SKIP

2016-05-23 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

Re: [libvirt] [PATCH 2/2] makefile: fix build on systems where gnutls is not in /usr/include

2016-05-23 Thread Michal Privoznik
On 23.05.2016 17:06, Pavel Hrdina wrote: > On Mon, May 23, 2016 at 04:42:43PM +0200, Michal Privoznik wrote: >> On 23.05.2016 10:18, Pavel Hrdina wrote: >>> We need to append GNUTLS_CFLAGS while building utils because virtcrypto >>> is using it. This fixes build on freebsd where gnutuls is in >>>

Re: [libvirt] [RFC PATCH 0/2] nodeinfo: PPC64: Fix topology and siblings info on capabilities and nodeinfo

2016-05-23 Thread Andrea Bolognani
On Thu, 2016-05-05 at 20:48 +0200, Andrea Bolognani wrote: > On Fri, 2016-01-29 at 01:32 -0500, Shivaprasad G Bhat wrote: > > The nodeinfo output was fixed earlier to reflect the actual cpus available > > in > > KVM mode on PPC64. The earlier fixes covered the aspect of not making a host > > look

Re: [libvirt] [PATCH 1/3] docs: website: remove search

2016-05-23 Thread Cole Robinson
On 05/20/2016 01:16 PM, Daniel P. Berrange wrote: > On Fri, May 20, 2016 at 10:27:03AM -0400, Cole Robinson wrote: >> It's currently broken: >> >> Could not connect to the database: Can't connect to local MySQL server >> through socket '/var/lib/mysql/mysql.sock' (111) >> >> And honestly

Re: [libvirt] [PATCH 2/2] makefile: fix build on systems where gnutls is not in /usr/include

2016-05-23 Thread Pavel Hrdina
On Mon, May 23, 2016 at 04:42:43PM +0200, Michal Privoznik wrote: > On 23.05.2016 10:18, Pavel Hrdina wrote: > > We need to append GNUTLS_CFLAGS while building utils because virtcrypto > > is using it. This fixes build on freebsd where gnutuls is in > > /usr/local/include. > > > > Signed-off-by:

Re: [libvirt] [PATCH 2/2] makefile: fix build on systems where gnutls is not in /usr/include

2016-05-23 Thread Michal Privoznik
On 23.05.2016 10:18, Pavel Hrdina wrote: > We need to append GNUTLS_CFLAGS while building utils because virtcrypto > is using it. This fixes build on freebsd where gnutuls is in > /usr/local/include. > > Signed-off-by: Pavel Hrdina > --- > src/Makefile.am | 2 +- > 1 file

Re: [libvirt] [PATCH 1/2] qemu: Remove dead code

2016-05-23 Thread Ján Tomko
On Fri, May 20, 2016 at 10:21:47AM -0400, John Ferlan wrote: > Since commit id '20a0fa8e' removed the QEMU_CAPS_DEVICE, Coverity notes > that it's no longer possible to have 'addrs' be NULL when checking for > a live domain since qemuDomainPCIAddressSetCreate would have jumped to > cleanup if

Re: [libvirt] [PATCH 0/2] Fix a couple of recently found coverity issues

2016-05-23 Thread Erik Skultety
On 20/05/16 16:21, John Ferlan wrote: > > John Ferlan (2): > qemu: Remove dead code > lxc: Fix lxcDomainDestroyFlags endjob processing > > src/lxc/lxc_driver.c | 8 > src/qemu/qemu_domain_address.c | 14 +- > 2 files changed, 9 insertions(+), 13 deletions(-)

[libvirt] [PATCH 2/2] conf: nodedev: Set PCI_PHYSICAL_FUNCTION flag more carefully

2016-05-23 Thread Andrea Bolognani
Instead of setting the flag before parsing the PCI address, set it afterwards. This ensure we can never end up in a situation where the flag has been set but pci_dev.physical_function has not been filled in. --- src/conf/node_device_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[libvirt] [PATCH 1/2] nodedev: sysfs: Set PCI_PHYSICAL_FUNCTION flag more carefully

2016-05-23 Thread Andrea Bolognani
The flag was set if virPCIGetPhysicalFunction() did not return an error; unfortunately, the 'physfn' sysfs file not being present is not considered an error, which means that the flag was set pretty much unconditionally. This, in turn, caused libvirtd to crash in virNodeDeviceDefFormat(), where

[libvirt] [PATCH 0/2] Set PCI_PHYSICAL_FUNCTION flag more carefully

2016-05-23 Thread Andrea Bolognani
If you're running libvirt master on a remote host, and connect to it using virt-manager, the remote daemon will crash. The same will happen if you run 'virsh nodedev-dumpxml' for a PCI device that happens *not* to be a virtual function. The first patch fixes the crash. The second one fixes

Re: [libvirt] [PATCH v2 4/8] Introduce PCI Multifunction device parser

2016-05-23 Thread Shivaprasad bhat
On Thu, May 19, 2016 at 11:37 PM, Laine Stump wrote: > On 05/18/2016 05:31 PM, Shivaprasad G Bhat wrote: > >> This patch just introduces the parser function used by >> the later patches. The parser disallows hostdevices to be >> used with other virtio devices simultaneously. >>

Re: [libvirt] [PATCH v2 7/8] Move the detach of PCI device to the beginnging of live hotplug

2016-05-23 Thread Shivaprasad bhat
On May 20, 2016 12:36 AM, "Laine Stump" wrote: > > On 05/19/2016 02:46 PM, Shivaprasad bhat wrote: >> >> >> >> On Fri, May 20, 2016 at 12:05 AM, Laine Stump wrote: >>> >>> On 05/18/2016 05:35 PM, Shivaprasad G Bhat wrote: The hostdevices are the only

Re: [libvirt] [PATCH] qemu: don't refuse to undefine a guest with NVRAM file

2016-05-23 Thread Maxim Nestratov
24.02.2015 13:12, Daniel P. Berrange пишет: The undefine operation should always be allowed to succeed regardless of whether any NVRAM file exists. ie we should not force the application to use the VIR_DOMAIN_UNDEFINE_NVRAM flag. It is valid for the app to decide it wants the NVRAM file left on

Re: [libvirt] [PATCH v2 3/8] Validate address in virDomainPCIAddressReleaseAddr

2016-05-23 Thread Shivaprasad bhat
On Thu, May 19, 2016 at 11:45 PM, Laine Stump wrote: > On 05/18/2016 05:30 PM, Shivaprasad G Bhat wrote: > >> This function was not used so far. Now, that we begin to use it, make >> sure to >> check the address before actually releasing the address. >> >> Signed-off-by:

Re: [libvirt] [PATCH v2 1/8] Revert "prevent hot unplugging multi function PCI device"

2016-05-23 Thread Shivaprasad bhat
On Thu, May 19, 2016 at 11:13 PM, Laine Stump wrote: > If you're going to say in the commit that you're reverting something, you > should list the commit id of the patch you're reverting (even if, as in > this case, the revert couldn't be done with "git revert"). > > Usually,

  1   2   >