Re: [libvirt] [PATCH 0/4] Plug some virsh leaks

2013-08-28 Thread Ján Tomko
On 08/28/2013 03:41 AM, Eric Blake wrote: On 08/27/2013 07:06 AM, Ján Tomko wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1001536 Ján Tomko (4): virsh: free messages after logging them to a file virsh: free the list from ListAll APIs even for 0 items virsh: free the formatting

Re: [libvirt] [PATCH v3 2/2] Test network update XML parsing

2013-08-28 Thread Ján Tomko
On 08/27/2013 10:39 PM, Laine Stump wrote: On 08/26/2013 11:43 AM, Ján Tomko wrote: Add checks for updating sections of network definition via virNetworkDefUpdateSection. ACK. This is a good start on testing this part of the code. (In order to test higher level functionality, we probably

Re: [libvirt] [PATCH] virsh: Fix debugging

2013-08-28 Thread Ján Tomko
On 08/28/2013 03:39 AM, Eric Blake wrote: On 08/27/2013 06:27 AM, Martin Kletzander wrote: diff --git a/tools/virsh.c b/tools/virsh.c index ac77156..34f5c4a 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -2321,10 +2321,9 @@ vshInitDebug(vshControl *ctl) debugEnv =

[libvirt] [PATCH] virsh-pool.c: Don't jump over variable declaration

2013-08-28 Thread Michal Privoznik
Since 785ff34bf8 we are using the outputStr variable in cleanup label. However, there is a possibility to jump to the label before the variable has been declared: virsh-pool.c: In function 'cmdPoolList': virsh-pool.c:1121:25: error: jump skips variable initialization [-Werror=jump-misses-init]

Re: [libvirt] [PATCH v2] kvm: warn if num cpus is greater than num recommended

2013-08-28 Thread Andrew Jones
- Original Message - On 08/23/2013 07:24 AM, Andrew Jones wrote: The comment in kvm_max_vcpus() states that it's using the recommended procedure from the kernel API documentation to get the max number of vcpus that kvm supports. It is, but by always returning the maximum number

Re: [libvirt] [PATCH] virsh: Fix debugging

2013-08-28 Thread Martin Kletzander
On 08/28/2013 08:22 AM, Ján Tomko wrote: On 08/28/2013 03:39 AM, Eric Blake wrote: On 08/27/2013 06:27 AM, Martin Kletzander wrote: diff --git a/tools/virsh.c b/tools/virsh.c index ac77156..34f5c4a 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -2321,10 +2321,9 @@ vshInitDebug(vshControl

Re: [libvirt] [PATCH] virsh: Fix debugging

2013-08-28 Thread Michal Privoznik
On 28.08.2013 08:22, Ján Tomko wrote: On 08/28/2013 03:39 AM, Eric Blake wrote: On 08/27/2013 06:27 AM, Martin Kletzander wrote: diff --git a/tools/virsh.c b/tools/virsh.c index ac77156..34f5c4a 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -2321,10 +2321,9 @@ vshInitDebug(vshControl

Re: [libvirt] [PATCH] qemu: Remove hostdev entry when freeing the depending network entry

2013-08-28 Thread Peter Krempa
On 08/28/13 07:17, Laine Stump wrote: On 08/27/2013 01:21 PM, Peter Krempa wrote: When using a interface type=network that points to a network with hostdev forwarding mode a hostdev alias is created for the network. This allias is inserted into the hostdev list, but is backed with a part of

Re: [libvirt] [PATCH] virsh: Fix debugging

2013-08-28 Thread Martin Kletzander
On Wed 28 Aug 2013 11:18:43 AM CEST, Michal Privoznik wrote: On 28.08.2013 08:22, Ján Tomko wrote: On 08/28/2013 03:39 AM, Eric Blake wrote: On 08/27/2013 06:27 AM, Martin Kletzander wrote: diff --git a/tools/virsh.c b/tools/virsh.c index ac77156..34f5c4a 100644 --- a/tools/virsh.c +++

Re: [libvirt] [PATCH 0/n] improvements to native-to-xml parsing

2013-08-28 Thread Daniel P. Berrange
On Tue, Aug 27, 2013 at 10:00:27PM -0600, Eric Blake wrote: I tried to use 'virsh qemu-attach', and hit different failures with both libvirt.git on Fedora 19, and with an older version of libvirt on RHEL 6. I'm posting patches that I have so far to start reviews, but need to write still more

[libvirt] [PATCH 2/3] virfile: Introduce internal API for managing ACL

2013-08-28 Thread Michal Privoznik
For now, only three APIs are implemented: virFileGetACL to retrieve permission for a specific user virFileSetACL for setting requested permissions for a specific user, virFileRemoveACL to remove those permissions. Signed-off-by: Michal Privoznik mpriv...@redhat.com --- configure.ac |

[libvirt] [PATCH 0/3] Keep original file label

2013-08-28 Thread Michal Privoznik
This is just a resurrection of my previous patchset. As of atomicity problem, I just realized there is none. The qemuProcessHook (which is responsible for locking the files) is called prior virSecurityManagerSetAllLabel (responsible for chown()-ing). Anyway, even if there's still one and it's

[libvirt] [PATCH 1/3] virFile: Add APIs for extended attributes handling

2013-08-28 Thread Michal Privoznik
Currently, only three wrappers are being implemented: virFileSetAttr for setting attributes virFileGetAttr for querying attributes (note we need to call it twice, first time to get length of attribute value, second to get actual value) virFileRemoveAttr for removing attributes Signed-off-by:

[libvirt] [PATCH 3/3] security_dac: Favour ACLs over chown()

2013-08-28 Thread Michal Privoznik
On filesystems supporting ACLs we don't need to do a chown but we can just set ACLs to gain access for qemu. However, since we are setting these on too low level, where we don't know if disk is just a read only or read write, we set read write access unconditionally. From implementation POV, a

Re: [libvirt] [PATCHv3 2/6] virsh: Add vshCmdCompleter and vshOptCompleter

2013-08-28 Thread Tomas Meszaros
On 26/08/13 at 11:47am, Eric Blake wrote: On 08/26/2013 06:36 AM, Tomas Meszaros wrote: completer and completer_flags added to the _vshCmdDef and _vshCmdOptDef structures so it will be possible for completion generators to conveniently call completer functions with desired flags. ---

[libvirt] [PATCH] virt-sanlock-cleanup; Fix augtool usage

2013-08-28 Thread Jiri Denemark
Surprisingly, augtool get (or print) returns path = value while we are only interested in the value. We need to remove the path = part from the augtool's output. The following is an example of the augtool command as used in virt-sanlock-cleanup script: $ augtool get

Re: [libvirt] [PATCH] virt-sanlock-cleanup; Fix augtool usage

2013-08-28 Thread Jiri Denemark
On Wed, Aug 28, 2013 at 13:54:29 +0200, Jiri Denemark wrote: Surprisingly, augtool get (or print) returns path = value while we are only interested in the value. We need to remove the path = part from the augtool's output. The following is an example of the augtool command as used in

Re: [libvirt] [PATCHv3 2/6] virsh: Add vshCmdCompleter and vshOptCompleter

2013-08-28 Thread Eric Blake
[re-adding the list, which was accidentally omitted] On 08/28/2013 05:26 AM, Tomas Meszaros wrote: Per-option completions make sense. For example, 'virsh vol-key --pool TAB' wants to use a pool completer, while 'virsh vol-key --vol TAB' wants to use a volume completer; furthermore, 'virsh

[libvirt] [libvirt-glib] Add missing symbols to .sym files

2013-08-28 Thread Christophe Fergeau
These symbols are in public headers, but were not listed in the corresponding .sym file, causing them to be unavailable from the resulting shared library. I would have preferred not to export gvir_config_object_new_from_xml() at all, but since the similar gvir_config_object_new() is already

Re: [libvirt] [PATCH v2] kvm: warn if num cpus is greater than num recommended

2013-08-28 Thread Eric Blake
On 08/28/2013 01:45 AM, Andrew Jones wrote: What I'm more worried about is what number is libvirt supposed to show to the end user, and should libvirt enforce the lower recommended max, or the larger kernel absolute max? Which of the two values does the QMP 'MachineInfo' type return in its

Re: [libvirt] [PATCH] virt-sanlock-cleanup; Fix augtool usage

2013-08-28 Thread Eric Blake
On 08/28/2013 05:58 AM, Jiri Denemark wrote: +++ b/tools/virt-sanlock-cleanup.in @@ -26,7 +26,8 @@ fi LOCKSPACE=__LIBVIRT__DISKS__ -LOCKDIR=`augtool print '/files@sysconfdir@/libvirt/qemu-sanlock.conf/disk_lease_dir'` +LOCKDIR=`augtool get

[libvirt] [PATCH] bridge_driver: Introduce networkObjFromNetwork

2013-08-28 Thread Michal Privoznik
Similarly to qemu_driver.c, we can join often repeating code of looking up network into one function: networkObjFromNetwork. Signed-off-by: Michal Privoznik mpriv...@redhat.com --- src/network/bridge_driver.c | 76 ++--- 1 file changed, 31 insertions(+),

Re: [libvirt] [PATCH] virt-sanlock-cleanup; Fix augtool usage

2013-08-28 Thread Jiri Denemark
On Wed, Aug 28, 2013 at 06:38:26 -0600, Eric Blake wrote: On 08/28/2013 05:58 AM, Jiri Denemark wrote: +++ b/tools/virt-sanlock-cleanup.in @@ -26,7 +26,8 @@ fi LOCKSPACE=__LIBVIRT__DISKS__ -LOCKDIR=`augtool print '/files@sysconfdir@/libvirt/qemu-sanlock.conf/disk_lease_dir'`

Re: [libvirt] [libvirt-glib] Add missing symbols to .sym files

2013-08-28 Thread Michal Privoznik
On 28.08.2013 14:31, Christophe Fergeau wrote: These symbols are in public headers, but were not listed in the corresponding .sym file, causing them to be unavailable from the resulting shared library. I would have preferred not to export gvir_config_object_new_from_xml() at all, but since

[libvirt] [PATCHv2 2/2] qemu_hotplug: Fix whitespace around addition in argument

2013-08-28 Thread Peter Krempa
--- src/qemu/qemu_hotplug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index a7256f3..9c655ff 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -814,7 +814,7 @@ int

[libvirt] [PATCHv2 1/2] qemu: Remove hostdev entry when freeing the depending network entry

2013-08-28 Thread Peter Krempa
When using a interface type=network that points to a network with hostdev forwarding mode a hostdev alias is created for the network. This allias is inserted into the hostdev list, but is backed with a part of the network object that it is connected to. When a VM is being stopped

[libvirt] [PATCHv2 0/2] Fix crash of libvirtd with interaface type=network and hostdev forwarding

2013-08-28 Thread Peter Krempa
Version 2 contains a fix of more callers in qemu and a whitespace cleanup. Peter Krempa (2): qemu: Remove hostdev entry when freeing the depending network entry qemu_hotplug: Fix whitespace around addition in argument src/conf/domain_conf.c | 26 ++

Re: [libvirt] [libvirt-glib] Add missing symbols to .sym files

2013-08-28 Thread Daniel P. Berrange
On Wed, Aug 28, 2013 at 02:31:22PM +0200, Christophe Fergeau wrote: These symbols are in public headers, but were not listed in the corresponding .sym file, causing them to be unavailable from the resulting shared library. I would have preferred not to export gvir_config_object_new_from_xml()

Re: [libvirt] [PATCHv2 0/2] Support setting the 'removable' flag for USB disks

2013-08-28 Thread anonym
27/08/13 14:40, Peter Krempa wrote: On 08/23/13 12:38, Fred A. Kemp wrote: From: Fred A. Kemp ano...@riseup.net The commit message of patch #2 explains the purpose of this patch set. A review would be greatly appreciated! Note that I've only added the new capability for

Re: [libvirt] [PATCHv2 0/2] Support setting the 'removable' flag for USB disks

2013-08-28 Thread Peter Krempa
On 08/28/13 15:34, anonym wrote: 27/08/13 14:40, Peter Krempa wrote: On 08/23/13 12:38, Fred A. Kemp wrote: From: Fred A. Kemp ano...@riseup.net The commit message of patch #2 explains the purpose of this patch set. A review would be greatly appreciated! Note that I've only added the new

Re: [libvirt] [PATCHv2 0/2] Fix crash of libvirtd with interaface type=network and hostdev forwarding

2013-08-28 Thread Michal Privoznik
On 28.08.2013 15:14, Peter Krempa wrote: Version 2 contains a fix of more callers in qemu and a whitespace cleanup. Peter Krempa (2): qemu: Remove hostdev entry when freeing the depending network entry qemu_hotplug: Fix whitespace around addition in argument src/conf/domain_conf.c

Re: [libvirt] Information needed regarding libvirt error

2013-08-28 Thread Martin Kletzander
On 08/27/2013 03:32 PM, arun abhinay wrote: Hi Martin, Thanks for your reply. We have tried applying the patch as mentioned in link https://www.redhat.com/archives/libvir-list/2013-August/msg01246.html but we could still observe this issue. I was looking at the problem today and found

Re: [libvirt] [PATCH 2/3] qemu: simplify list cleanup

2013-08-28 Thread Eric Blake
On 08/27/2013 10:00 PM, Eric Blake wrote: No need to open code now that we have a nice function. * src/qemu/qemu_command.c (qemuParseCommandLinePid): Simplify cleanup. Signed-off-by: Eric Blake ebl...@redhat.com --- src/qemu/qemu_command.c | 8 ++-- 1 file changed, 2 insertions(+),

[libvirt] [RFC]Libvirt Wireshark Dissector

2013-08-28 Thread Yuto KAWAMURA
Hi libvirt developers, I would like to ask you to review the dissector of libvirt RPC protocol which I've been developing on project of Google Summer of Code 2013[1][2][3]. It can add support for dissecting libvirt RPC protocol packet which communicate via TCP socket to Wireshark. This feature

[libvirt] Entering freeze for libvirt-1.1.2

2013-08-28 Thread Daniel Veillard
I am a day late but I finally tagged the release candidate 1 of 1.1.2 in git and push the tarball and rpms to the usual place: ftp://libvirt.org/libvirt/ so the plan is to have an rc2 candidate on friday and if everything looks good push the final release 1.1.2 on Monday. Please give it

Re: [libvirt] [PATCH] virsh: detect programming errors with option parsing

2013-08-28 Thread Michal Privoznik
On 17.08.2013 00:14, Eric Blake wrote: Noticed while reviewing another patch that had an accidental mismatch due to refactoring. An audit of the code showed that very few callers of vshCommandOpt were expecting a return of -2, indicating programmer error, and of those that DID check, they

Re: [libvirt] [PATCHv3 5/6] virsh: Add vshSuspendTargetCompleter

2013-08-28 Thread Tomas Meszaros
On 26/08/13 at 02:43pm, Eric Blake wrote: On 08/26/2013 06:36 AM, Tomas Meszaros wrote: vshSuspendTargetCompleter returns targets available for suspend. This completer can be used for the command option completion (for dompmsuspend, etc.). virsh dompmsuspend --target TAB mem

Re: [libvirt] Entering freeze for libvirt-1.1.2

2013-08-28 Thread Doug Goldstein
On Wed, Aug 28, 2013 at 11:25 AM, Daniel Veillard veill...@redhat.comwrote: I am a day late but I finally tagged the release candidate 1 of 1.1.2 in git and push the tarball and rpms to the usual place: ftp://libvirt.org/libvirt/ so the plan is to have an rc2 candidate on friday and if

[libvirt] [PATCH 1/2] rename struct interface_driver to virNetcfDriverState

2013-08-28 Thread Laine Stump
This better fits the modern naming scheme in libvirt, and anticipates an upcoming change where a single instance of this state will be maintained by a separate state driver, and every instance of the netcf driver will share the same state. --- src/interface/interface_backend_netcf.c | 52

[libvirt] [PATCH 0/2] netcf: use only a single netcf instance for all connections

2013-08-28 Thread Laine Stump
There is a good description in 2/2. I'll be out of reach for the next several days, so unable to push even if it gets ACKed before the freeze. I have done a rudimentary test and it seems to work, but if someone with a suitable setup wants to do a stress test with [many] connections, that would be

Re: [libvirt] [Libvirt-announce] Entering freeze for libvirt-1.1.2

2013-08-28 Thread Justin Clift
On 28/08/2013, at 5:25 PM, Daniel Veillard wrote: I am a day late but I finally tagged the release candidate 1 of 1.1.2 in git and push the tarball and rpms to the usual place: ftp://libvirt.org/libvirt/ so the plan is to have an rc2 candidate on friday and if everything looks good push

Re: [libvirt] Entering freeze for libvirt-1.1.2

2013-08-28 Thread Kashyap Chamarthy
On 08/28/2013 09:55 PM, Daniel Veillard wrote: I am a day late but I finally tagged the release candidate 1 of 1.1.2 in git and push the tarball and rpms to the usual place: ftp://libvirt.org/libvirt/ so the plan is to have an rc2 candidate on friday and if everything looks good push

Re: [libvirt] [PATCH] virsh: detect programming errors with option parsing

2013-08-28 Thread Eric Blake
On 08/28/2013 10:31 AM, Michal Privoznik wrote: On 17.08.2013 00:14, Eric Blake wrote: Noticed while reviewing another patch that had an accidental mismatch due to refactoring. An audit of the code showed that very few callers of vshCommandOpt were expecting a return of -2, indicating

[libvirt] [PATCH 4/3] qemu: don't leave vm in table on failure to attach

2013-08-28 Thread Eric Blake
Failure to attach to a domain during 'virsh qemu-attach' left the list of domains in an odd state: $ virsh qemu-attach 4176 error: An error occurred, but the cause is unknown $ virsh list --all IdName State 2

[libvirt] [PATCHv2 2/3] qemu: simplify list cleanup

2013-08-28 Thread Eric Blake
No need to open code now that we have a nice function. Interestingly, our virStringFreeList function is typed correctly (a malloc'd list of malloc'd strings is NOT const, whether at the point where it is created, or at the point where it is cleand up), so using it with a 'const char **' argument

[libvirt] [PATCH] virNetDevVethCreate: assign names based on mac address by default

2013-08-28 Thread Oskari Saarenmaa
Interface names do not have to be numerical (or veth + number) and trying to assign them to that format is susceptible to race conditions. Instead, assign the parent interface name according to the mac address (the last three bytes) if no name was given by the caller and use the parent interface

[libvirt] [PATCHv3 3/4] VMX: Add a VMWare Fusion 5 configuration for tests

2013-08-28 Thread Doug Goldstein
A user was having an issue with this specific VMWare Fusion config and he gave me permission to add it as part of our test suite to further expand our VMX test coverage. Unfortunately our VMX parser and generator does not support many features contained within and just silently ignores fields it

[libvirt] [PATCHv3 1/4] VMX: Create virVMXFormatDisk() from HD and CD-ROM

2013-08-28 Thread Doug Goldstein
virVMXFormatHardDisk() and virVMXFormatCDROM() duplicated a lot of code from each other and made a lot of nested if checks to build each part of the VMX file. This hopefully simplifies the code path while combining the two functions with no net difference. --- src/libvirt_vmx.syms | 3 +-

[libvirt] [PATCHv3 4/4] VMX: Some serial ports are not actually connected

2013-08-28 Thread Doug Goldstein
Sometimes a serial port might not be actually wired to a device when the user does not have the VM powered on and we should not consider this a fatal error. --- src/vmx/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index bcbb997..036e234

[libvirt] [PATCHv3 0/4] VMX: CD-ROM handling improvements

2013-08-28 Thread Doug Goldstein
A user came into #virt the other day and was trying to get libvirtd to work with VMWare Fusion 5, which is basically the Mac OS X version of VMWare Workstation. In helping him out I noticed a few limitations of our VMX parser so I've added support through this patchset. However I came across the

[libvirt] [PATCHv3 2/4] VMX: Add cdrom-raw dev type from VMWare Fusion

2013-08-28 Thread Doug Goldstein
According to VMWare's documentation 'cdrom-raw' is an acceptable value for deviceType for a CD-ROM drive. The documentation states that the VMX configuration for a CD-ROM deviceType is as follows: ide|scsi(n):(n).deviceType = cdrom-raw|atapi-cdrom|cdrom-image From the documentation it appears

Re: [libvirt] [PATCH 1/2] rename struct interface_driver to virNetcfDriverState

2013-08-28 Thread Eric Blake
On 08/28/2013 11:39 AM, Laine Stump wrote: This better fits the modern naming scheme in libvirt, and anticipates an upcoming change where a single instance of this state will be maintained by a separate state driver, and every instance of the netcf driver will share the same state. ---

Re: [libvirt] [PATCH 2/2] netcf driver: use a single netcf handle for all connections

2013-08-28 Thread Eric Blake
On 08/28/2013 11:39 AM, Laine Stump wrote: This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=983026 The netcf interface driver previously had no state driver associated with it - as a connection was opened, it would create a new netcf instance just for that connection, and close it

[libvirt] [PATCH 5/3] qemu: don't leave shutdown inhibited on attach failure

2013-08-28 Thread Eric Blake
While debugging a failure of 'virsh qemu-attach', I noticed that we were leaking the count of active domains on failure. This means that a libvirtd session that is supposed to quit after active domains disappear will hang around forever. * src/qemu/qemu_process.c (qemuProcessAttach): Undo count