Re: [libvirt] build: fail to 'make distcheck'

2011-10-12 Thread Alex Jia
On 10/12/2011 01:30 PM, Alex Jia wrote: On 10/12/2011 01:14 PM, Wenyi Gao wrote: Hi All, I failed to 'make distcheck' on Ubuntu 11.04 with the following information: .33 OK PASS: nwfilterschematest TEST: domainsnapshotschematest

Re: [libvirt] Possible security hole? unprivileged user can use virsh to overwrite sensitive system file

2011-10-12 Thread Alex Jia
On 10/12/2011 11:57 AM, Hong Xiang wrote: [hxiang@T420 ~]$ cat /etc/redhat-release Red Hat Enterprise Linux Workstation release 6.1 (Santiago) [hxiang@T420 ~]$ cat /etc/openclient-release Open Client RHEL 64 3.10 (Gold Master) [hxiang@T420 ~]$ libvirtd --version libvirtd (libvirt) 0.8.7

Re: [libvirt] build: fail to 'make distcheck'

2011-10-12 Thread Wenyi Gao
On Wed, 2011-10-12 at 14:02 +0800, Alex Jia wrote: On 10/12/2011 01:30 PM, Alex Jia wrote: On 10/12/2011 01:14 PM, Wenyi Gao wrote: Hi All, I failed to 'make distcheck' on Ubuntu 11.04 with the following information: .33 OK PASS:

Re: [libvirt] [RFC PATCH 3/5] Implement virDomainBlockIoThrottle for the qemu driver

2011-10-12 Thread Zhi Yong Wu
On Tue, Oct 11, 2011 at 11:19 PM, Adam Litke a...@us.ibm.com wrote: On Mon, Oct 10, 2011 at 09:45:11PM +0800, Lei HH Li wrote: Summary here. Signed-off-by: Zhi Yong Wu wu...@linux.vnet.ibm.com ---  src/qemu/qemu_command.c      |   35 ++  src/qemu/qemu_driver.c       |   54

Re: [libvirt] [RFC PATCH 1/5] Add new API virDomainBlockIoThrottle

2011-10-12 Thread Zhi Yong Wu
On Tue, Oct 11, 2011 at 10:59 PM, Adam Litke a...@us.ibm.com wrote: On Mon, Oct 10, 2011 at 09:45:09PM +0800, Lei HH Li wrote: Hi Lei.  You are missing a patch summary at the top of this email.  In your summary you want to let reviewers know what the patch is doing.  For example, this patch

Re: [libvirt] Possible security hole? unprivileged user can use virsh to overwrite sensitive system file

2011-10-12 Thread Daniel P. Berrange
On Wed, Oct 12, 2011 at 11:57:25AM +0800, Hong Xiang wrote: I found there's a way for a unprivileged user to overwrite sensitive system file with virsh, here's how: 1. (as an unprivileged user) start virsh and connect to the r/w socket of libvirtd: virsh -c

[libvirt] [PATCH v4 0/2] add blkio.weight_device support

2011-10-12 Thread Hu Tao
This series adds support for blkio.weight_device. changes from v3: - fix some memory leaks - don't store major/minor, do the convertion from device path to major/minor only when enforcing the weight_device limits - use virStrToLong_i instead of atoi - use c_isdigit instead of isdigit

[libvirt] [PATCH v4 1/2] Add VIR_TYPED_PARAM_STRING

2011-10-12 Thread Hu Tao
This makes string can be transported between client and server. For compatibility, o new server should not send strings to old client if it doesn't see the flag VIR_DOMAIN_TYPED_STRING_OKAY. o new client that wants to be able to send/receive strings should always set the flag

[libvirt] [PATCH 1/4] tests: Add support for skipping tests

2011-10-12 Thread Philipp Hahn
AM_TESTS has support for skipping tests, while the C-implementation virtTestRun() does not support that feature. Print _ or SKIP in verbose mode for tests returning EXIT_AM_SKIP=77. Signed-off-by: Philipp Hahn h...@univention.de --- tests/testutils.c |4 1 files changed, 4

[libvirt] [PATCH 0/4] Xen fixes

2011-10-12 Thread Philipp Hahn
Here are several patches relevant to Xen: The first two patches fix the test-suite when building as root in a Xen-dom0 domain. The other two patches fix problems when doing virsh edit on Xen domains. Philipp Hahn (4): tests: Add support for skipping tests tests: Skip Xen-HVM tests for root on

[libvirt] [PATCH 2/4] tests: Skip Xen-HVM tests for root on dom0

2011-10-12 Thread Philipp Hahn
Several tests fail when run as root on a Xen-dom0-system, since virInitialize() then succeeds to open /proc/xen/privcmd and returns the actual supported features instead of the faked one when calling xenHypervisorMakeCapabilitiesInternal(). Since Xen-4.1 supports additional features like hap and

[libvirt] [PATCH 4/4] xen: Return tap2 for tap2 disks

2011-10-12 Thread Philipp Hahn
For some versions of Xen the difference between tap and tap2 is important. When converting back from xen-sxpr to libvirt-xml, that information is lost, which breaks re-defining the domain using that data. Explicitly return tap2 for disks defines as device/tap2. Signed-off-by: Philipp Hahn

[libvirt] [PATCH 3/4] xen: fix PyGrub boot device order

2011-10-12 Thread Philipp Hahn
When PyGrub is used as the bootloader in Xen, it gets passed the first bootable disk. Xend supports a bootable-flag for this, which isn't explicitly supported by libvirt. When converting libvirt-xml to xen-sxpr the bootable-flag gets implicitly set by xen.xend.XenConfig.device_add() for the first

[libvirt] [PATCH v4 2/2] add interface for blkio.weight_device

2011-10-12 Thread Hu Tao
This patch adds a parameter --weight-device to virsh command blkiotune for setting/getting blkio.weight_device. --- daemon/remote.c |2 +- include/libvirt/libvirt.h.in |9 ++ src/conf/domain_conf.c | 129 ++- src/conf/domain_conf.h | 16

Re: [libvirt] [RFC PATCH 0/5] Summary on QEMU I/O throttling support to libvirt

2011-10-12 Thread Stefan Hajnoczi
Jianfeng and Hu Tao, Just want to draw your attention to this thread if you haven't seen it :). Your review and thoughts on I/O throttling in libvirt would be appreciated. Stefan On Mon, Oct 10, 2011 at 2:45 PM, Lei Li li...@linux.vnet.ibm.com wrote: Today libvirt supports the cgroups

Re: [libvirt] [PATCH] events: Propose a separate lock for event queue

2011-10-12 Thread Daniel P. Berrange
On Mon, Oct 10, 2011 at 01:45:50PM +0200, Michal Privoznik wrote: Currently, push pop from event queue (both server client side) rely on lock from higher levels, e.g. on driver lock (qemu), private_data (remote), ...; This alone is not sufficient as not every function that interacts with

Re: [libvirt] [PATCH] Make saving domain XML more robust

2011-10-12 Thread lvroyce
tested-by: Royce Lv lvro...@linux.vnet.ibm.com Patch works as expected.Use setmaxmem cmd,tested cases of set mem success ,writing tmp config file failure and rename failure.old xml file reserves in case of failure so still can be used,and tmp config file cleared leaving no trash to xml

[libvirt] [PATCH v2] events: Propose a separate lock for event queue

2011-10-12 Thread Michal Privoznik
Currently, push pop from event queue (both server client side) rely on lock from higher levels, e.g. on driver lock (qemu), private_data (remote), ...; This alone is not sufficient as not every function that interacts with this queue can/does lock, esp. in client where we have a different

[libvirt] [PATCH] qemu: Check for domain being active on successful job acquire

2011-10-12 Thread Michal Privoznik
As this is needed. Although some functions check for domain being active before obtaining job, we need to check it after, because obtaining job unlocks domain object, during which a state of domain can be changed. --- src/qemu/qemu_driver.c | 75

Re: [libvirt] [PATCH v2] daemon: Always advertise libvirtd service

2011-10-12 Thread Daniel P. Berrange
On Tue, Oct 11, 2011 at 09:24:26PM +0800, Osier Yang wrote: This is a regression introduced by new RPC codes, previously we advertise the service via ssh even if the daemon doesn't listen on TLS port (TCP is not choosed). Now the service is only advertised when it listens on TLS or TCP port.

Re: [libvirt] [PATCH v2] daemon: Always advertise libvirtd service

2011-10-12 Thread Osier Yang
于 2011年10月12日 20:34, Daniel P. Berrange 写道: On Tue, Oct 11, 2011 at 09:24:26PM +0800, Osier Yang wrote: This is a regression introduced by new RPC codes, previously we advertise the service via ssh even if the daemon doesn't listen on TLS port (TCP is not choosed). Now the service is only

Re: [libvirt] [RFC PATCH 3/5] Implement virDomainBlockIoThrottle for the qemu driver

2011-10-12 Thread Adam Litke
On Wed, Oct 12, 2011 at 03:02:12PM +0800, Zhi Yong Wu wrote: On Tue, Oct 11, 2011 at 11:19 PM, Adam Litke a...@us.ibm.com wrote: On Mon, Oct 10, 2011 at 09:45:11PM +0800, Lei HH Li wrote: Summary here. Signed-off-by: Zhi Yong Wu wu...@linux.vnet.ibm.com ---  

[libvirt] [PATCH 01/10] fdstream: Emit stream abort callback even if poll() doesnt.

2011-10-12 Thread Peter Krempa
This patch causes the fdstream driver to call the stream event callback if virStreamAbort() is issued on a stream using this driver. This prohibited to abort streams from the daemon, as the daemon remote handler installs a callback to watch for stream errors as the only mean of detecting changes

[libvirt] [PATCH 07/10] virsh: add support for VIR_DOMAIN_CONSOLE_FORCE flag

2011-10-12 Thread Peter Krempa
This patch adds support for the newly introduced VIR_DOMAIN_CONSOLE flag. The console command now has an optional parameter --force that specifies that the user wants to forcibly interrupt an ongoing console session and create a new one. The behaviour to this point was, that the daemon openend two

[libvirt] [PATCH 02/10] virnetclientstream: Propagate stream error messages to callback

2011-10-12 Thread Peter Krempa
If a stream notification message arives from the daemon side, the event dispatcher only sets the error state for the stream but does not emit the stream error event and the corresponding callback is not called. This patch adds the emision of the event in the cause a stream error (abortion)

[libvirt] [PATCH 00/10] Console coruption with two or more clients series

2011-10-12 Thread Peter Krempa
This series fixes anoying console corruption if two clients try to connect at same time to the console. The current state of this is, that two/more of libvirt iohelpers are spawned on the same time that compete for data from the pty. This causes that each of the consoles get scrambled and

[libvirt] [PATCH 06/10] Add flags for virDomainOpenConsole

2011-10-12 Thread Peter Krempa
This patch adds a set of flags to be used with the virDomainOpenConsole API call to specify if the user wishes to interrupt an existing console session or just to try open a new one. VIR_DOMAIN_CONSOLE_TRY - specifies that the caller wants to try open a new console

[libvirt] [PATCH 08/10] qemu: Add ability to abort existing console while creating new one

2011-10-12 Thread Peter Krempa
This patch fixes console corruption, that happens if two concurrent sessions are opened for a single console on a domain. Result of this corruption was, that each of the console streams did recieve just a part of the data written to the pipe so every console rendered unusable. This patch adds a

[libvirt] [PATCH 09/10] lxc: Add ability to abort existing console when creating a new one

2011-10-12 Thread Peter Krempa
This patch is identical to the patch fixing this same issue in the qemu hypervisor. --- src/lxc/lxc_driver.c | 28 +++- 1 files changed, 27 insertions(+), 1 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index c475887..a2ef8a1 100644 ---

[libvirt] [PATCH 10/10] uml: Add ability to abort existing console when creating a new one

2011-10-12 Thread Peter Krempa
This patch is identical to the patch fixing this same issue in the qemu hypervisor. --- src/uml/uml_driver.c | 28 +++- 1 files changed, 27 insertions(+), 1 deletions(-) diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 2b7219a..265faf1 100644 ---

[libvirt] [PATCH 04/10] fdstream: Add internal function to check if a fdstream is open

2011-10-12 Thread Peter Krempa
This patch adds a new internal api function to check if a fdstream is open. The check is done as an trivial check of private data structures, as if the stream is closed, those don't exist. --- src/fdstream.c |9 + src/fdstream.h |2 ++ src/libvirt_private.syms

[libvirt] [PATCH 03/10] daemon: Subscribe the stream event callback for error events.

2011-10-12 Thread Peter Krempa
This patch subscribes the daemon-side event callback for error and hangup events. The functionality to handle them is already implemented in the callback. --- daemon/stream.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/daemon/stream.c b/daemon/stream.c index

Re: [libvirt] [PATCH 2/3] snapshot: implement LIST_LEAVES flag in qemu

2011-10-12 Thread Daniel Veillard
On Fri, Oct 07, 2011 at 08:37:04PM -0600, Eric Blake wrote: With the recent refactoring of qemu snapshot relationships, it is now trivial to filter on leaves. * src/conf/domain_conf.c (virDomainSnapshotObjListCount) (virDomainSnapshotObjListCopyNames): Handle new flag. *

Re: [libvirt] [PATCH 1/3] snapshot: add API for filtering by leaves

2011-10-12 Thread Daniel Veillard
On Fri, Oct 07, 2011 at 08:37:03PM -0600, Eric Blake wrote: Counterpart to --roots. * include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_LIST_LEAVES): New flag. * src/libvirt.c (virDomainSnapshotNum, virDomainSnapshotListNames) (virDomainSnapshotNumChildren)

[libvirt] [PATCH 1/3] example: Fix argument handling

2011-10-12 Thread Philipp Hahn
sys.argv contains the original command line arguments, while args only contains the arguments not handled by getopt(). Currently this is no problem since --help is the only command line option passable, which terminates the process, so the code is never reached. Any option added in the future will

[libvirt] [PATCH 2/3] example: Redirect --help output to stdout/stderr

2011-10-12 Thread Philipp Hahn
When --help is requested, print usage() to stdout. When an illegal option is passed, print usage to stderr. Signed-off-by: Philipp Hahn h...@univention.de --- examples/domain-events/events-python/event-test.py |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git

[libvirt] [PATCH 0/3] example: event-test.py

2011-10-12 Thread Philipp Hahn
Some minor improvements to the event-test Python example. Philipp Hahn (3): example: Fix argument handling example: Redirect --help output to stdout/stderr example: Support debug output and loop switch examples/domain-events/events-python/event-test.py | 25 +-- 1 files

[libvirt] [PATCH 3/3] example: Support debug output and loop switch

2011-10-12 Thread Philipp Hahn
Add support for enabling debug output via command line option. Allow to toggle the loop implementation between pure-Python and native-C. Signed-off-by: Philipp Hahn h...@univention.de --- examples/domain-events/events-python/event-test.py | 13 +++-- 1 files changed, 11 insertions(+),

Re: [libvirt] [PATCH 0/5 v2] Improve Ceph Qemu+RBD support

2011-10-12 Thread Daniel P. Berrange
On Mon, Sep 19, 2011 at 09:13:38PM -0700, Sage Weil wrote: The current support for qemu and Ceph RBD (rados block device) has two main deficiencies: authentication doesn't work, and it relies on environment variables (which don't work with latest upstream). This patch set addresses both

Re: [libvirt] [PATCH 1/5] secret: add Ceph secret type

2011-10-12 Thread Daniel P. Berrange
On Mon, Sep 19, 2011 at 09:13:39PM -0700, Sage Weil wrote: Add a new secret type to store a Ceph authentication key. The ceph_id field contains the name of the key (e.g. 'admin' for the ceph superuser). Signed-off-by: Sage Weil s...@newdream.net --- docs/schemas/secret.rng | 17

Re: [libvirt] [PATCH] qemu: Do not reattach PCI device used by other domain when shutdown

2011-10-12 Thread Eric Blake
On 09/27/2011 12:53 AM, Osier Yang wrote: Apologies on the delayed review. This is some hairy code, and I want to make sure we get it right, so I kind of shelved it knowing it would be a longer review. When failing on starting a domain, it tries to reattach all the PCI devices defined in

Re: [libvirt] [PATCH 3/5] qemu: pass virConnectPtr into Domain{Attach, Detach}*

2011-10-12 Thread Daniel P. Berrange
On Mon, Sep 19, 2011 at 09:13:41PM -0700, Sage Weil wrote: The qemu RBD driver needs access to the conn in order to get the secret needed for connecting to the ceph cluster. Signed-off-by: Sage Weil s...@newdream.net --- src/qemu/qemu_command.c |5 +++-- src/qemu/qemu_command.h |3

Re: [libvirt] [PATCH 2/5] storage: add authId, authDomain to virDomainDiskDef

2011-10-12 Thread Daniel P. Berrange
On Mon, Sep 19, 2011 at 09:13:40PM -0700, Sage Weil wrote: Add additional fields to let you specify the how to authenticate with a network disk type. The authId is the name to authenticate as, and the authDomain optionally describes the domain that user exists in. The latter allows us to

Re: [libvirt] [PATCH 0/5 v2] Improve Ceph Qemu+RBD support

2011-10-12 Thread Sage Weil
Hi Daniel, On Wed, 12 Oct 2011, Daniel P. Berrange wrote: On Mon, Sep 19, 2011 at 09:13:38PM -0700, Sage Weil wrote: The current support for qemu and Ceph RBD (rados block device) has two main deficiencies: authentication doesn't work, and it relies on environment variables (which don't

Re: [libvirt] [PATCH 5/5] qemu/rbd: improve rbd device specification

2011-10-12 Thread Daniel P. Berrange
On Mon, Sep 19, 2011 at 09:13:43PM -0700, Sage Weil wrote: This improves the support for qemu rbd devices by adding support for a few key features (e.g., authentication) and cleaning up the way in which rbd configuration options are passed to qemu. And auth member of the disk source xml

Re: [libvirt] [PATCH 4/5] buf: implement generic virBufferEscape

2011-10-12 Thread Eric Blake
On 10/11/2011 04:39 AM, Daniel P. Berrange wrote: On Mon, Sep 19, 2011 at 09:13:42PM -0700, Sage Weil wrote: Implement a generic helper to escape a given set of characters with a leading '\'. Generalizes virBufferEscapeSexpr(). Signed-off-by: Sage Weils...@newdream.net @@ -408,14 +428,13 @@

Re: [libvirt] [PATCH v5 2/2] qemu: Implement VIR_DUMP_RESET

2011-10-12 Thread Eric Blake
On 10/11/2011 06:56 AM, Michal Privoznik wrote: This patch extends qemudDomainCoreDump so it supports new VIR_DUMP_RESET flag. If this flag is set, domain is reset on successful dump. However, this is needed to be done after we start CPUs. --- src/qemu/qemu_driver.c | 20 +++-

Re: [libvirt] build: fail to 'make distcheck'

2011-10-12 Thread Eric Blake
On 10/12/2011 12:59 AM, Wenyi Gao wrote: On Wed, 2011-10-12 at 14:02 +0800, Alex Jia wrote: On 10/12/2011 01:30 PM, Alex Jia wrote: On 10/12/2011 01:14 PM, Wenyi Gao wrote: Hi All, I failed to 'make distcheck' on Ubuntu 11.04 with the following information: TEST: daemon-conf

Re: [libvirt] [PATCH 3/4] xen: fix PyGrub boot device order

2011-10-12 Thread Eric Blake
On 10/12/2011 02:26 AM, Philipp Hahn wrote: When PyGrub is used as the bootloader in Xen, it gets passed the first bootable disk. Xend supports a bootable-flag for this, which isn't explicitly supported by libvirt. Hmm, the XML has been enhanced in the meantime; we can now mark various disks

[libvirt] [PATCH] [libvirt-perl] Add missing $flags arguments to documentation

2011-10-12 Thread Guido Günther
Hi, when looking at the DomainSnapshot docs I wondered if these also take the flags argument as the other functions so I went ahead and updated the docs after checking the source. Cheers, -- Guido --- lib/Sys/Virt/DomainSnapshot.pm | 16 ++-- 1 files changed, 10 insertions(+), 6

[libvirt] [libvirt PATCHv3 08/10] add DHCP snooping

2011-10-12 Thread David L Stevens
This patch adds DHCP Snooping support to libvirt. Signed-off-by: David L Stevens dlstev...@us.ibm.com --- examples/xml/nwfilter/no-ip-spoofing.xml |5 + src/Makefile.am |2 + src/nwfilter/nwfilter_dhcpsnoop.c| 602 ++

[libvirt] [libvirt PATCHv3 07/10] support variable value changing

2011-10-12 Thread David L Stevens
This patch adds a function that applies or deletes filter rules to existing chains. Rules referencing the given variable are instantiated with the given value, or optionally deleted. For example, passing variable IP with different values will install rules using the IP variable with each of the

Re: [libvirt] [PATCH] [libvirt-perl] Add missing $flags arguments to documentation

2011-10-12 Thread Daniel P. Berrange
On Wed, Oct 12, 2011 at 09:48:39PM +0200, Guido Günther wrote: Hi, when looking at the DomainSnapshot docs I wondered if these also take the flags argument as the other functions so I went ahead and updated the docs after checking the source. Cheers, -- Guido ---

[libvirt] [libvirt PATCHv3 04/10] make default chain policy DROP

2011-10-12 Thread David L Stevens
This patch simplifies the table rules by setting the protocol chains policy to be DROP and removes the explicit -j DROP entries that the protocol rules had previously. It also makes no-other-rarp-traffic.xml obsolete. Signed-off-by: David L Stevens dlstev...@us.ibm.com ---

[libvirt] [libvirt PATCHv3 05/10] allow chain modification

2011-10-12 Thread David L Stevens
This patch adds the internal capability to add rules to existing chains instead of using temporary chains and to generate placeholders for chains that are referenced without generating a rule for them immediately. Finally, it includes variable matching for filter instantiation (i.e.,

[libvirt] [libvirt PATCHv3 10/10] support multiple static IP addresses

2011-10-12 Thread David L Stevens
This patch adds support for multiple static IP addresses in a comma-separated list. For example: interface type='network' filterref filter='clean-traffic' parameter name='ip_learning' value='none'/ parameter name='IP'

[libvirt] [libvirt PATCHv3 06/10] support addRules

2011-10-12 Thread David L Stevens
This patch adds the capability of adding individual rules to existing chains. Signed-off-by: David L Stevens dlstev...@us.ibm.com --- src/conf/nwfilter_conf.h |6 ++ src/nwfilter/nwfilter_ebiptables_driver.c | 73 + 2 files changed, 79

[libvirt] [libvirt PATCHv3 09/10] add leasefile support

2011-10-12 Thread David L Stevens
This patch adds support for saving DHCP snooping leases to an on-disk file and restoring saved leases that are still active on restart. Signed-off-by: David L Stevens dlstev...@us.ibm.com --- src/nwfilter/nwfilter_dhcpsnoop.c | 370 +++-- 1 files changed,

[libvirt] [libvirt PATCHv3 03/10] reverse sense of address matching

2011-10-12 Thread David L Stevens
This patch changes rules of the form: if ! addr drop accept to: if addr return ... drop The patch adds a mac chain to do a mac address list and separates the arp chain into separate arpmac and arpip chains that can check multiple MAC or IP addresses in any

Re: [libvirt] [PATCH] [libvirt-perl] Add missing $flags arguments to documentation

2011-10-12 Thread Guido Günther
On Wed, Oct 12, 2011 at 08:53:31PM +0100, Daniel P. Berrange wrote: On Wed, Oct 12, 2011 at 09:48:39PM +0200, Guido Günther wrote: Hi, when looking at the DomainSnapshot docs I wondered if these also take the flags argument as the other functions so I went ahead and updated the docs after

[libvirt] [libvirt PATCHv3 02/10] allow required ARP packets

2011-10-12 Thread David L Stevens
The ARP protocol requires processing of packets that may not be explicitly addressed to a host and only defines request and reply. This patch removes the filtering of ARP requests not explicitly addressed to a VM to allow for proper ARP cache updates for entries based on any traffic and

Re: [libvirt] [PATCH v2] events: Propose a separate lock for event queue

2011-10-12 Thread Daniel P. Berrange
On Wed, Oct 12, 2011 at 01:58:46PM +0200, Michal Privoznik wrote: Currently, push pop from event queue (both server client side) rely on lock from higher levels, e.g. on driver lock (qemu), private_data (remote), ...; This alone is not sufficient as not every function that interacts with

Re: [libvirt] [PATCH v2 2/2] qemu: Implement migration optional disk

2011-10-12 Thread Daniel P. Berrange
On Mon, Oct 03, 2011 at 04:07:24PM +0200, Michal Privoznik wrote: This patch implements previous extension in qemu driver. That is, during prepare phase check for every source to be accessible. If not, but marked as optional, simply VIR_FREE the source. Moreover, if migration is persistent, we

Re: [libvirt] [PATCH v2 1/2] migration: Introduce migration element for cdrom and floppy

2011-10-12 Thread Daniel P. Berrange
On Mon, Oct 03, 2011 at 04:07:23PM +0200, Michal Privoznik wrote: This element says what to do with cdrom (or floppy) on migration. Currently, only one attribute is supported: 'optional'. It accepts 'require', 'optional' and 'drop' values. Setting a cdrom to be required means migration will

Re: [libvirt] [libvirt PATCHv3 01/10] support continue/return

2011-10-12 Thread Stefan Berger
On 10/12/2011 03:50 PM, David L Stevens wrote: This patch adds support for continue and return actions in filter rules. Signed-off-by: David L Stevensdlstev...@us.ibm.com --- src/conf/nwfilter_conf.c |8 ++-- src/conf/nwfilter_conf.h |2 ++ 2 files changed, 8

Re: [libvirt] [libvirt PATCHv3 00/10] DHCP snooping support for libvirt

2011-10-12 Thread Stefan Berger
David, I have unfortunately missed v2 of this and in the meantime (since after V1) I had been thinking about this a bit. The problem we're having at the moment is that it's not possible to evaluate fields of packets that may have more than one possible value. This is the general

Re: [libvirt] [libvirt PATCHv3 00/10] DHCP snooping support for libvirt

2011-10-12 Thread David Stevens
Stefan Berger stef...@linux.vnet.ibm.com wrote on 10/12/2011 02:02:59 PM: The problem we're having at the moment is that it's not possible to evaluate fields of packets that may have more than one possible value. This is the general problem, the specific one being allowing multiple MAC

Re: [libvirt] [PATCH] qemu: Check for domain being active on successful job acquire

2011-10-12 Thread Eric Blake
On 10/12/2011 05:59 AM, Michal Privoznik wrote: As this is needed. Although some functions check for domain being active before obtaining job, we need to check it after, because obtaining job unlocks domain object, during which a state of domain can be changed. --- src/qemu/qemu_driver.c |

Re: [libvirt] [RFC PATCH 1/5] Add new API virDomainBlockIoThrottle

2011-10-12 Thread Eric Blake
On 10/12/2011 01:07 AM, Zhi Yong Wu wrote: On Tue, Oct 11, 2011 at 10:59 PM, Adam Litkea...@us.ibm.com wrote: On Mon, Oct 10, 2011 at 09:45:09PM +0800, Lei HH Li wrote: Hi Lei. You are missing a patch summary at the top of this email. In your summary you want to let reviewers know what the

Re: [libvirt] [PATCH 4/4] xen: Return tap2 for tap2 disks

2011-10-12 Thread Eric Blake
On 10/12/2011 02:55 AM, Philipp Hahn wrote: For some versions of Xen the difference between tap and tap2 is important. When converting back from xen-sxpr to libvirt-xml, that information is lost, which breaks re-defining the domain using that data. Explicitly return tap2 for disks defines as

Re: [libvirt] [PATCH 2/3] snapshot: implement LIST_LEAVES flag in qemu

2011-10-12 Thread Eric Blake
On 10/12/2011 08:22 AM, Daniel Veillard wrote: On Fri, Oct 07, 2011 at 08:37:04PM -0600, Eric Blake wrote: With the recent refactoring of qemu snapshot relationships, it is now trivial to filter on leaves. * src/conf/domain_conf.c (virDomainSnapshotObjListCount)

Re: [libvirt] [PATCH 2/3] example: Redirect --help output to stdout/stderr

2011-10-12 Thread Eric Blake
On 10/12/2011 09:11 AM, Philipp Hahn wrote: When --help is requested, print usage() to stdout. When an illegal option is passed, print usage to stderr. Signed-off-by: Philipp Hahnh...@univention.de --- examples/domain-events/events-python/event-test.py |8 1 files changed, 4

Re: [libvirt] [PATCH 1/3] example: Fix argument handling

2011-10-12 Thread Eric Blake
On 10/12/2011 08:54 AM, Philipp Hahn wrote: sys.argv contains the original command line arguments, while args only contains the arguments not handled by getopt(). Currently this is no problem since --help is the only command line option passable, which terminates the process, so the code is

Re: [libvirt] [PATCH 3/3] example: Support debug output and loop switch

2011-10-12 Thread Eric Blake
On 10/12/2011 09:13 AM, Philipp Hahn wrote: Add support for enabling debug output via command line option. Allow to toggle the loop implementation between pure-Python and native-C. Signed-off-by: Philipp Hahnh...@univention.de --- examples/domain-events/events-python/event-test.py | 13

[libvirt] [PATCH 0/3] Detect netcat implementation

2011-10-12 Thread Guido Günther
Hi, Finally here's a respin of the netcat detection when used over SSH. Changes are: * virBufferQuoteString renamed to virBufferEscapeShell * Use outer quote only when metacharacters show up * Make a pessimistic buffer allocation instead of resizing it all the time Cheers, -- Guido Guido

[libvirt] [PATCH 2/3] Add virBufferEscapeShell

2011-10-12 Thread Guido Günther
Escape strings so they're safe to pass to the shell. Based on glib's g_quote_string. --- src/libvirt_private.syms |1 + src/util/buf.c | 54 ++ src/util/buf.h |1 + 3 files changed, 56 insertions(+), 0 deletions(-) diff

[libvirt] [PATCH 3/3] Use virBufferEscapeShell in virNetSocketNewConnectSSH

2011-10-12 Thread Guido Günther
to escape the netcat command since it's passed to the shell. Adjust expected test case output accordingly. --- src/rpc/virnetsocket.c | 25 - tests/virnetsockettest.c | 10 +- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git

[libvirt] [PATCH 1/3] Autodetect if the remote nc command supports the -q option

2011-10-12 Thread Guido Günther
Based on a patch by Marc Deslauriers marc.deslauri...@ubuntu.com RH: https://bugzilla.redhat.com/show_bug.cgi?id=562176 Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/517478 Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=573172 --- src/rpc/virnetsocket.c | 23

Re: [libvirt] [PATCH 1/3] Autodetect if the remote nc command supports the -q option

2011-10-12 Thread Eric Blake
On 10/12/2011 04:39 PM, Guido Günther wrote: Based on a patch by Marc Deslauriersmarc.deslauri...@ubuntu.com RH: https://bugzilla.redhat.com/show_bug.cgi?id=562176 Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/517478 Debian:

Re: [libvirt] [PATCH 2/3] Add virBufferEscapeShell

2011-10-12 Thread Eric Blake
On 10/12/2011 04:39 PM, Guido Günther wrote: Escape strings so they're safe to pass to the shell. Based on glib's g_quote_string. Is this still true, or does it now resemble more what I did (independently from g_quote_string) in tools/virsh.c cmdEcho? --- src/libvirt_private.syms |1

Re: [libvirt] [PATCH 3/3] Use virBufferEscapeShell in virNetSocketNewConnectSSH

2011-10-12 Thread Eric Blake
On 10/12/2011 04:40 PM, Guido Günther wrote: to escape the netcat command since it's passed to the shell. Adjust expected test case output accordingly. --- src/rpc/virnetsocket.c | 25 - tests/virnetsockettest.c | 10 +- 2 files changed, 25

[libvirt] [PATCH] build: add compiler attributes to virUUIDParse

2011-10-12 Thread Eric Blake
Coverity complained that most, but not all, clients of virUUIDParse were checking for errors. Silence those coverity warnings by explicitly marking the cases where we trust the input, and fixing one instance that really should have been checking. In particular, this silences about half of the 46

[libvirt] [PATCH] build: update to latest gnulib

2011-10-12 Thread Eric Blake
358 changes; most probably have no impact on libvirt, but we might as well stay current. * .gnulib: Update to latest. --- * .gnulib da1717b...2394a60 (358): atanl: Simplify for platforms where 'long double' == 'double'. acosl: Simplify for platforms where 'long double' == 'double'.

[libvirt] [PATCH RESEND] spec: mingw cleanups

2011-10-12 Thread Eric Blake
* libvirt.spec.in (%configure): Drop unused %{one} macro. * mingw32-libvirt.spec.in (%{rhel}): Compile ESX but not HyperV on mingw build for RHEL. (%build): Make configure honor spec conditionals. Reorder to match libvirt.spec. * autobuild.sh (mingw): Update list to match. Suggested by Daniel P.

[libvirt] [PATCH RESEND] command: avoid fd leak on failure

2011-10-12 Thread Eric Blake
virCommandTransferFD promises that the fd is no longer owned by the caller. Normally, we want the fd to remain open until the child runs, but in error situations, we must close it earlier. * src/util/command.c (virCommandTransferFD): Close fd now if we can't track it to close later.

[libvirt] [PATCH] qemu: check for json allocation failure

2011-10-12 Thread Eric Blake
Detected by Coverity. Introduced in commit b1b5b51. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBlockInfo): Avoid null dereference on OOM. --- src/qemu/qemu_monitor_json.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c

[libvirt] [PATCH] qemu: avoid text monitor null deref

2011-10-12 Thread Eric Blake
Detected by Coverity. If, for some reason, our text monitor input does not match our assumptions, we end up incrementing p while it is NULL, then dereferencing the pointer 0x1, which will fault. * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetBlockStatsParamsNumber): Rewrite to avoid deref of

[libvirt] [PATCH] qemu: fix text block info parsing

2011-10-12 Thread Eric Blake
Detected by Coverity. p (the pointer to the string) is always true; when in reality, we wanted to know whether the integer value of the just-parsed string is '0' or '1'. Logic bug since commit b1b5b51. * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetBlockInfo): Set results to proper value.

Re: [libvirt] [PATCH] qemu: Do not reattach PCI device used by other domain when shutdown

2011-10-12 Thread Osier Yang
于 2011年10月13日 00:41, Eric Blake 写道: On 09/27/2011 12:53 AM, Osier Yang wrote: Apologies on the delayed review. This is some hairy code, and I want to make sure we get it right, so I kind of shelved it knowing it would be a longer review. When failing on starting a domain, it tries to

Re: [libvirt] [PATCH] qemu: Get the dev from activePciHostdevs list before reattachment

2011-10-12 Thread Osier Yang
于 2011年10月13日 01:31, Eric Blake 写道: On 10/11/2011 01:59 AM, Osier Yang wrote: BZ# https://bugzilla.redhat.com/show_bug.cgi?id=736214 The problem is caused by the original info of domain's PCI dev is maintained by qemu_driver-activePciHostdevs list, (E.g. dev-reprobe, which stands for whether

[libvirt] [PATCH 1/2] Fix occasional container creation failure due to misuse of grantpt

2011-10-12 Thread Serge E. Hallyn
glibc's grantpt and ptsname cannot be used on a fd for a pty not in /dev/pts. The lxc controller tries to do just that. So if you try to start a container on a system where /dev/pts/0 is not available, it will fail. You can make this happen by opening a terminal on /dev/pts/0, and doing 'sleep

[libvirt] [PATCH 2/2] Fix type in lxc_controller

2011-10-12 Thread Serge E. Hallyn
s/Mouting/Mounting. Signed-off-by: Serge Hallyn serge.hal...@canonical.com --- src/lxc/lxc_controller.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 1a56e0c..6557c07 100644 --- a/src/lxc/lxc_controller.c +++

[libvirt] [PATCH v2] qemu: Do not reattach PCI device used by other domain when shutdown

2011-10-12 Thread Osier Yang
When failing on starting a domain, it tries to reattach all the PCI devices defined in the domain conf, regardless of whether the devices are still used by other domain. This will cause the devices to be deleted from the list qemu_driver-activePciHostdevs, thus the devices will be thought as

Re: [libvirt] Possible security hole? unprivileged user can use virsh to overwrite sensitive system file

2011-10-12 Thread Hong Xiang
It turned out that in my environment the user 'hxiang' I was testing with is in group 'desktop_admin_r' and PolicyKit takes all users in that group as administrators. That's why I could connect without authentication. Sorry for the false alarm. On 10/12/2011 04:22 PM, Daniel P. Berrange wrote: