Re: [libvirt] [PATCH] bhyve: silent destroy command errors on cleanup

2014-06-13 Thread Roman Bogorodskiy
Eric Blake wrote: > On 06/13/2014 01:00 PM, Roman Bogorodskiy wrote: > > When virBhyveProcessStart() fails, it tries to unload > > a guest that could have been already loaded using > > bhyveload(8) to make sure not to leave it hanging in memory. > > > > However, we could fail before loading a V

Re: [libvirt] [PATCH] bhyve: silent destroy command errors on cleanup

2014-06-13 Thread Eric Blake
On 06/13/2014 01:00 PM, Roman Bogorodskiy wrote: > When virBhyveProcessStart() fails, it tries to unload > a guest that could have been already loaded using > bhyveload(8) to make sure not to leave it hanging in memory. > > However, we could fail before loading a VM into memory, > so 'bhyvectl --d

[libvirt] [PATCH] bhyve: silent destroy command errors on cleanup

2014-06-13 Thread Roman Bogorodskiy
When virBhyveProcessStart() fails, it tries to unload a guest that could have been already loaded using bhyveload(8) to make sure not to leave it hanging in memory. However, we could fail before loading a VM into memory, so 'bhyvectl --destroy' command will fail and print an error message that loo

Re: [libvirt] [PATCH 2/2] bhyve: do not cleanup unallocated networks on fail

2014-06-13 Thread Roman Bogorodskiy
Eric Blake wrote: > On 06/13/2014 10:48 AM, Roman Bogorodskiy wrote: > > virBhyveProcessStart() calls bhyveNetCleanup() if it fails. However, > > it might fail earlier than networks are allocated, so modify > > bhyveNetCleanup() to check if net->ifname is not NULL before > > going further with t

Re: [libvirt] [PATCH 1/2] bhyve: fix crash in bhyveBuildNetArgStr

2014-06-13 Thread Roman Bogorodskiy
Eric Blake wrote: > On 06/13/2014 10:48 AM, Roman Bogorodskiy wrote: > > bhyveBuildNetArgStr() calls virNetDevTapCreateInBridgePort() and > > passes tapfd = NULL, but tapfdSize = 1. That is wrong, because > > if virNetDevTapCreateInBridgePort() crashes after successfully > > creating a TAP devic

Re: [libvirt] [PATCH 2/2] bhyve: do not cleanup unallocated networks on fail

2014-06-13 Thread Eric Blake
On 06/13/2014 10:48 AM, Roman Bogorodskiy wrote: > virBhyveProcessStart() calls bhyveNetCleanup() if it fails. However, > it might fail earlier than networks are allocated, so modify > bhyveNetCleanup() to check if net->ifname is not NULL before > going further with the cleanup. > --- > src/bhyve/

Re: [libvirt] [PATCH 1/2] bhyve: fix crash in bhyveBuildNetArgStr

2014-06-13 Thread Eric Blake
On 06/13/2014 10:48 AM, Roman Bogorodskiy wrote: > bhyveBuildNetArgStr() calls virNetDevTapCreateInBridgePort() and > passes tapfd = NULL, but tapfdSize = 1. That is wrong, because > if virNetDevTapCreateInBridgePort() crashes after successfully > creating a TAP device, it'll jump to 'error' label,

[libvirt] [PATCH 0/2] bhyve: fix crashes when running without networking

2014-06-13 Thread Roman Bogorodskiy
Craig Rodrigues reported a problem on freebsd-virtualization list when libvirtd with bhyve driver crashes when the bridge does not exist [1]. 1: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=1431191+0+current/freebsd-virtualization These two patches addresses the problem. Roman Bogorodskiy (2):

[libvirt] [PATCH 2/2] bhyve: do not cleanup unallocated networks on fail

2014-06-13 Thread Roman Bogorodskiy
virBhyveProcessStart() calls bhyveNetCleanup() if it fails. However, it might fail earlier than networks are allocated, so modify bhyveNetCleanup() to check if net->ifname is not NULL before going further with the cleanup. --- src/bhyve/bhyve_process.c | 10 ++ 1 file changed, 6 insertions

[libvirt] [PATCH 1/2] bhyve: fix crash in bhyveBuildNetArgStr

2014-06-13 Thread Roman Bogorodskiy
bhyveBuildNetArgStr() calls virNetDevTapCreateInBridgePort() and passes tapfd = NULL, but tapfdSize = 1. That is wrong, because if virNetDevTapCreateInBridgePort() crashes after successfully creating a TAP device, it'll jump to 'error' label, that loops over tapfd and calls VIR_FORCE_CLOSE: for

[libvirt] [PATCH 0/4] catch bogus 'blockcommit --base=a --top=a'

2014-06-13 Thread Eric Blake
This patch series was first hinted at here: https://www.redhat.com/archives/libvir-list/2014-June/msg00589.html It fixes a minor bug that has existed since blockcommit was first added, where we had an off-by-one that caused us to generate different error messages in some cases where a user was pas

[libvirt] [PATCH 2/4] storage: renumber lookup tests

2014-06-13 Thread Eric Blake
The next patch will be adding tests; for ease of review of that patch, I want to create common context lines that don't change when the new tests are added (it's easier to visually review additions than it is to review an entire chunk of tests rewritten into another larger chunk of tests). * tests

[libvirt] [PATCH 4/4] blockcommit: require base below top

2014-06-13 Thread Eric Blake
The block commit code looks for an explicit base file relative to the discovered top file; so for a chain of: base <- snap1 <- snap2 <- snap3 and a command of: virsh blockcommit $dom vda --base snap2 --top snap1 we got a sane message (here from libvirt 1.0.5): error: invalid argument: could not

[libvirt] [PATCH 1/4] storage: add alias for less typing

2014-06-13 Thread Eric Blake
Typing chain->backingStore->backingStore gets old after a while; introduce some alias variables to make the test more compact. * tests/virstoragetest.c (mymain): Introduce some shorthand. Signed-off-by: Eric Blake --- tests/virstoragetest.c | 63 +

[libvirt] [PATCH 3/4] storage: better tests of lookup

2014-06-13 Thread Eric Blake
Add some more tests of what happens when we restrict a lookup to begin at a point in the middle of a chain. In particular, we want to ensure that a parent is not found when starting at the child. This commit also demonstrates that we have a slight difference in behavior on what parent we report w

Re: [libvirt] [PATCH] storage: report VIR_ERR_NO_STORAGE_VOL when the file doesn't exist

2014-06-13 Thread Eric Blake
On 06/13/2014 08:52 AM, Eric Blake wrote: > On 06/13/2014 08:48 AM, Giuseppe Scrivano wrote: >> Report VIR_ERR_NO_STORAGE_VOL instead of a system error when lstat >> fails because the file doesn't exist. >> >> Fixes this problem in virt-install: >> >> https://bugzilla.redhat.com/show_bug.cgi?id=1

Re: [libvirt] [PATCH v6] bhyve: implement PCI address allocation

2014-06-13 Thread Roman Bogorodskiy
Ján Tomko wrote: > On 06/01/2014 07:53 PM, Roman Bogorodskiy wrote: > > Automatically allocate PCI addresses for devices instead > > of hardcoding them in the driver code. The current > > allocation schema is to dedicate an entire slot for each devices. > > > > Also, allow having arbitrary numb

Re: [libvirt] [PATCH] storage: report VIR_ERR_NO_STORAGE_VOL when the file doesn't exist

2014-06-13 Thread Eric Blake
On 06/13/2014 08:48 AM, Giuseppe Scrivano wrote: > Report VIR_ERR_NO_STORAGE_VOL instead of a system error when lstat > fails because the file doesn't exist. > > Fixes this problem in virt-install: > > https://bugzilla.redhat.com/show_bug.cgi?id=1108922 > > Signed-off-by: Giuseppe Scrivano >

[libvirt] [PATCH] storage: report VIR_ERR_NO_STORAGE_VOL when the file doesn't exist

2014-06-13 Thread Giuseppe Scrivano
Report VIR_ERR_NO_STORAGE_VOL instead of a system error when lstat fails because the file doesn't exist. Fixes this problem in virt-install: https://bugzilla.redhat.com/show_bug.cgi?id=1108922 Signed-off-by: Giuseppe Scrivano --- src/storage/storage_backend.c | 12 +--- 1 file change

Re: [libvirt] [PATCH 2/5] virCaps: expose huge page info

2014-06-13 Thread Michal Privoznik
On 13.06.2014 10:28, Daniel P. Berrange wrote: On Thu, Jun 12, 2014 at 07:21:47PM +0200, Martin Kletzander wrote: On Thu, Jun 12, 2014 at 02:30:50PM +0100, Daniel P. Berrange wrote: On Tue, Jun 10, 2014 at 07:21:12PM +0200, Michal Privoznik wrote: There are two places where you'll find info on

Re: [libvirt] [RFC PATCH 4/5] util: storagefile: Add deep copy for struct virStorageSource

2014-06-13 Thread Peter Krempa
On 06/13/14 00:38, Eric Blake wrote: > On 06/12/2014 09:02 AM, Peter Krempa wrote: >> Now that we have pointers to store disk source information and thus can >> easily exchange the structs behind we need a function to copy all the >> data. >> --- >> src/libvirt_private.syms | 1 + >> src/util/v

Re: [libvirt] [PATCH] virNetDevGetLinkInfo: Don't report link speed if NIC's not up

2014-06-13 Thread Michal Privoznik
On 13.06.2014 12:25, Laine Stump wrote: On 06/13/2014 12:34 PM, Michal Privoznik wrote: The kernel's more broken than one would think. Various drivers report various (usually spurious) values if the interface is in other state than 'up' . While on some we experience -EINVAL when read()-ing the s

Re: [libvirt] [RFC PATCH 1/5] storage: encryption: Add deep copy function for storage encryption

2014-06-13 Thread Peter Krempa
On 06/12/14 23:19, Eric Blake wrote: > On 06/12/2014 09:02 AM, Peter Krempa wrote: >> --- >> src/util/virstorageencryption.c | 39 +++ >> src/util/virstorageencryption.h | 2 ++ >> 2 files changed, 41 insertions(+) > > I've definitely been wishing for this; as

Re: [libvirt] storage conf: Add key-value options to storage pools

2014-06-13 Thread Wido den Hollander
On 06/04/2014 12:14 PM, Daniel P. Berrange wrote: On Tue, Jun 03, 2014 at 05:33:13PM +0200, Ján Tomko wrote: On 05/28/2014 11:38 AM, Wido den Hollander wrote: This series of patches adds the ability to pass down options to the storage pool drivers. In the case of NFS users can specify mount

Re: [libvirt] [PATCH] virNetDevGetLinkInfo: Don't report link speed if NIC's not up

2014-06-13 Thread Laine Stump
On 06/13/2014 12:34 PM, Michal Privoznik wrote: > The kernel's more broken than one would think. Various drivers report > various (usually spurious) values if the interface is in other state > than 'up' . While on some we experience -EINVAL when read()-ing the > speed sysfs file, with other drivers

Re: [libvirt] [PATCH] virNetDevGetLinkInfo: Don't report link speed if NIC's down

2014-06-13 Thread Michal Privoznik
On 13.06.2014 11:23, Laine Stump wrote: On 06/13/2014 10:50 AM, Martin Kletzander wrote: On Fri, Jun 13, 2014 at 10:31:53AM +0300, Laine Stump wrote: On 06/13/2014 10:10 AM, Martin Kletzander wrote: On Fri, Jun 13, 2014 at 08:46:59AM +0200, Michal Privoznik wrote: The kernel's more broken tha

[libvirt] [PATCH] virNetDevGetLinkInfo: Don't report link speed if NIC's not up

2014-06-13 Thread Michal Privoznik
The kernel's more broken than one would think. Various drivers report various (usually spurious) values if the interface is in other state than 'up' . While on some we experience -EINVAL when read()-ing the speed sysfs file, with other drivers we might get anything from 0 to UINT_MAX. If that's the

Re: [libvirt] [PATCH] virNetDevGetLinkInfo: Don't report link speed if NIC's down

2014-06-13 Thread Laine Stump
On 06/13/2014 10:50 AM, Martin Kletzander wrote: > On Fri, Jun 13, 2014 at 10:31:53AM +0300, Laine Stump wrote: >> On 06/13/2014 10:10 AM, Martin Kletzander wrote: >>> On Fri, Jun 13, 2014 at 08:46:59AM +0200, Michal Privoznik wrote: The kernel's more broken than one would think. Various drive

Re: [libvirt] [PATCH] virNetDevGetLinkInfo: Don't report link speed if NIC's down

2014-06-13 Thread Laine Stump
On 06/13/2014 11:30 AM, Daniel P. Berrange wrote: > On Fri, Jun 13, 2014 at 08:46:59AM +0200, Michal Privoznik wrote: >> The kernel's more broken than one would think. Various drivers report >> various (usually spurious) values if the interface is down. While on >> some we experience -EINVAL when r

Re: [libvirt] [PATCHv4 07/21] tests: virstoragetest: Fix output when hitting errors

2014-06-13 Thread Peter Krempa
On 06/13/14 05:51, Eric Blake wrote: > On 06/11/2014 05:45 AM, Peter Krempa wrote: >> When the test is failing but the debug output isn't enabled the >> resulting line would look ugly like and would not contain the actual >> difference. >> >> TEST: virstoragetest >> .chain mem

Re: [libvirt] [PATCH] virNetDevGetLinkInfo: Don't report link speed if NIC's down

2014-06-13 Thread Daniel P. Berrange
On Fri, Jun 13, 2014 at 08:46:59AM +0200, Michal Privoznik wrote: > The kernel's more broken than one would think. Various drivers report > various (usually spurious) values if the interface is down. While on > some we experience -EINVAL when read()-ing the speed sysfs file, with > other drivers we

Re: [libvirt] [PATCH 2/5] virCaps: expose huge page info

2014-06-13 Thread Daniel P. Berrange
On Thu, Jun 12, 2014 at 07:21:47PM +0200, Martin Kletzander wrote: > On Thu, Jun 12, 2014 at 02:30:50PM +0100, Daniel P. Berrange wrote: > >On Tue, Jun 10, 2014 at 07:21:12PM +0200, Michal Privoznik wrote: > >>There are two places where you'll find info on huge pages. The first > >>one is under el

Re: [libvirt] [PATCH RFC 0/3] allow setting video ram size for graphics

2014-06-13 Thread Wangrui (K)
> -Original Message- > From: Gerd Hoffmann [mailto:kra...@redhat.com] > Sent: Thursday, June 12, 2014 4:16 PM > To: Wangrui (K) > Cc: libvir-list@redhat.com; Zengjunliang; ebl...@redhat.com > Subject: Re: [PATCH RFC 0/3] allow setting video ram size for graphics > > On Do, 2014-06-12 at 0

Re: [libvirt] [PATCH] virNetDevGetLinkInfo: Don't report link speed if NIC's down

2014-06-13 Thread Michal Privoznik
On 13.06.2014 09:31, Laine Stump wrote: On 06/13/2014 10:10 AM, Martin Kletzander wrote: On Fri, Jun 13, 2014 at 08:46:59AM +0200, Michal Privoznik wrote: The kernel's more broken than one would think. Various drivers report various (usually spurious) values if the interface is down. While on s

Re: [libvirt] [PATCH v2 2/4] virnetdev: Introduce virNetDevGetLinkInfo

2014-06-13 Thread Michal Privoznik
On 12.06.2014 15:13, Laine Stump wrote: On 06/05/2014 06:39 PM, Michal Privoznik wrote: + +/* Workaround broken kernel API. If the link is unplugged then + * depending on the NIC driver, link speed can be reported as -1. + * However, the value is printed out as unsigned i

Re: [libvirt] [PATCH] virNetDevGetLinkInfo: Don't report link speed if NIC's down

2014-06-13 Thread Martin Kletzander
On Fri, Jun 13, 2014 at 10:31:53AM +0300, Laine Stump wrote: On 06/13/2014 10:10 AM, Martin Kletzander wrote: On Fri, Jun 13, 2014 at 08:46:59AM +0200, Michal Privoznik wrote: The kernel's more broken than one would think. Various drivers report various (usually spurious) values if the interfac

Re: [libvirt] [PATCH] virNetDevGetLinkInfo: Don't report link speed if NIC's down

2014-06-13 Thread Laine Stump
On 06/13/2014 10:10 AM, Martin Kletzander wrote: > On Fri, Jun 13, 2014 at 08:46:59AM +0200, Michal Privoznik wrote: >> The kernel's more broken than one would think. Various drivers report >> various (usually spurious) values if the interface is down. While on >> some we experience -EINVAL when re

Re: [libvirt] [PATCH] virNetDevGetLinkInfo: Don't report link speed if NIC's down

2014-06-13 Thread Martin Kletzander
On Fri, Jun 13, 2014 at 08:46:59AM +0200, Michal Privoznik wrote: The kernel's more broken than one would think. Various drivers report various (usually spurious) values if the interface is down. While on some we experience -EINVAL when read()-ing the speed sysfs file, with other drivers we might