[Qemu-devel] [PATCH] PCI: add param check for api

2015-11-20 Thread Cao jin
add param check for pci_add_capability2, as it is a public API. Signed-off-by: Cao jin --- hw/pci/pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 168b9cc..6938f64 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2144,6 +2144,9 @@ int pci_add_capabil

Re: [Qemu-devel] [PATCH] PCI: minor performance optimization

2015-11-20 Thread Cao jin
On 11/20/2015 09:30 PM, Michael S. Tsirkin wrote: On Fri, Nov 20, 2015 at 07:58:01PM +0800, Cao jin wrote: On 11/20/2015 07:26 PM, Michael S. Tsirkin wrote: On Fri, Nov 20, 2015 at 07:04:07PM +0800, Cao jin wrote: On 11/20/2015 06:45 PM, Michael S. Tsirkin wrote: On Fri, Nov 20, 2015 at

Re: [Qemu-devel] [PATCH] Assume madvise for (no)hugepage works

2015-11-20 Thread Amit Shah
On (Thu) 19 Nov 2015 [15:27:48], Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > madvise() returns EINVAL in the case of many failures, but also > returns it in cases where the host kernel doesn't have THP enabled. > Postcopy only really cares that THP is off before it de

[Qemu-devel] [PATCH for-2.5] tests: Fix check-report-qtest-% target

2015-11-20 Thread Andreas Färber
Commit e253c28 ("tests: Fix how qom-test is run") introduced $(qtest-generic-y) and used it for check-qtest-% target, but did not update check-report-qtest-%. This causes check-report-qtest-aarch64.xml target to fail with a gtester usage error for lack of test arguments. Fix this by adding $(qtest

Re: [Qemu-devel] [PATCH] target-i386: Do not set MCG_SER_P by default

2015-11-20 Thread Borislav Petkov
On Sat, Nov 21, 2015 at 12:11:35AM +0100, Andreas Färber wrote: > Hi, > > CC'ing qemu-devel. Ah, thanks. > Am 21.11.2015 um 00:01 schrieb Borislav Petkov: > > From: Borislav Petkov > > > > Software Error Recovery, i.e. SER, is purely an Intel feature and it > > shouldn't be set by default. Ena

Re: [Qemu-devel] [PATCH v5] raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2015-11-20 Thread Programmingkid
On Nov 20, 2015, at 11:26 AM, Kevin Wolf wrote: > Am 27.07.2015 um 19:05 hat Programmingkid geschrieben: >> Mac OS X can be picky when it comes to allowing the user to use physical >> devices >> in QEMU. Most mounted volumes appear to be off limits to QEMU. If an issue is >> detected, a message i

[Qemu-devel] [PATCH v6] raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2015-11-20 Thread Programmingkid
Mac OS X can be picky when it comes to allowing the user to use physical devices in QEMU. Most mounted volumes appear to be off limits to QEMU. If an issue is detected, a message is displayed showing the user how to unmount a volume. Signed-off-by: John Arbuckle --- This patch depends on the Get

[Qemu-devel] [PATCH v2] raw-posix.c: Make GetBSDPath() handle caching options

2015-11-20 Thread Programmingkid
Add support for caching options that can be specified from the command line. Signed-off-by: John Arbuckle --- Only location of code has been changed. block/raw-posix.c | 15 +-- 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c

Re: [Qemu-devel] [PATCH] target-i386: Do not set MCG_SER_P by default

2015-11-20 Thread Andreas Färber
Hi, CC'ing qemu-devel. Am 21.11.2015 um 00:01 schrieb Borislav Petkov: > From: Borislav Petkov > > Software Error Recovery, i.e. SER, is purely an Intel feature and it > shouldn't be set by default. Enable it only on Intel. Is this new in 2.5? Otherwise we would probably need compatibility cod

Re: [Qemu-devel] [PATCH -qemu] nvme: support Google vendor extension

2015-11-20 Thread Ming Lin
On Fri, 2015-11-20 at 09:58 +0100, Paolo Bonzini wrote: > > On 20/11/2015 09:11, Ming Lin wrote: > > On Thu, 2015-11-19 at 11:37 +0100, Paolo Bonzini wrote: > >> > >> On 18/11/2015 06:47, Ming Lin wrote: > >>> @@ -726,7 +798,11 @@ static void nvme_process_db(NvmeCtrl *n, hwaddr > >>> addr, int v

[Qemu-devel] [PATCH 1/2] ide-test: fix timeouts

2015-11-20 Thread John Snow
Use explicit timeouts instead of trying to fudge it by counting nsleep calls. Signed-off-by: John Snow --- tests/ide-test.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/ide-test.c b/tests/ide-test.c index fc1ce52..d37dc5e 100644 --- a/tests/ide-te

[Qemu-devel] [PATCH 2/2] ide-test: cdrom_pio_impl fixup

2015-11-20 Thread John Snow
Final tidying: move the interrupt wait into the loop, document that the status read clears the IRQ, and move the final interrupt check outside of the loop. This should be functionally equivalent to how it works currently, but a little less ambiguous and slightly more explicit about the state trans

[Qemu-devel] [PATCH 0/2] ide-test: tidy up after pio race fix

2015-11-20 Thread John Snow
Two things: (1) Fix the timeouts to be more deterministic, and (2) Finish tidying up the PIO loop. John Snow (2): ide-test: fix timeouts ide-test: cdrom_pio_impl fixup tests/ide-test.c | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) -- 2.4.3

Re: [Qemu-devel] [PATCH v12 34/36] qapi: Add positive tests to qapi-schema-test

2015-11-20 Thread Eric Blake
On 11/18/2015 01:53 AM, Eric Blake wrote: > Add positive tests to qapi-schema-test for things that were > made possible by recent patches but which caused compile errors > due to collisions prior to that point. The focus is mainly on > collisions due to names we have reserved for qapi, even though

Re: [Qemu-devel] [OpenBIOS] [Qemu-ppc] CUDA has problems with Mac OS 10.4

2015-11-20 Thread BALATON Zoltan
On Fri, 20 Nov 2015, Alfonso Gamboa wrote: booting into MacOS9 with qemu to the Desktop is now possible, see: http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&start=250 Very nice. On Nov 20, 2015 7:46 AM, "Programmingkid" wrote: I use to have the same belief until Mark set me str

Re: [Qemu-devel] [PATCH WIP 04/30] qcow2: add a 'keyid' parameter to qcow2 options

2015-11-20 Thread Eric Blake
On 11/20/2015 11:04 AM, Daniel P. Berrange wrote: > Add a 'keyid' parameter that refers to the ID of a > QCryptoSecret instance that provides the encryption key. > > $QEMU \ > -object secret,id=sec0,filename=/home/berrange/encrypted.pw \ > -drive file=/home/berrange/encrypted.qcow2,keyid=s

Re: [Qemu-devel] [PATCH WIP 01/30] crypto: add QCryptoSecret object class for password/key handling

2015-11-20 Thread Eric Blake
On 11/20/2015 11:04 AM, Daniel P. Berrange wrote: > Introduce a new QCryptoSecret object class which will be used > for providing passwords and keys to other objects which need > sensitive credentials. > > The new object can provide secret values directly as properties, > or indirectly via a file.

Re: [Qemu-devel] [PATCH COLO-Frame v10 23/38] qmp event: Add event notification for COLO error

2015-11-20 Thread Eric Blake
On 11/03/2015 04:56 AM, zhanghailiang wrote: > If some errors happen during VM's COLO FT stage, it's important to notify the > users > of this event. Together with 'colo_lost_heartbeat', users can intervene in > COLO's > failover work immediately. > If users don't want to get involved in COLO's f

Re: [Qemu-devel] [PATCH 5/5] target-arm: support QMP dump-guest-memory

2015-11-20 Thread Andrew Jones
On Fri, Nov 20, 2015 at 06:19:14PM +, Peter Maydell wrote: > On 19 November 2015 at 14:53, Andrew Jones wrote: > > Add the support needed for creating prstatus elf notes. This > > allows us to use QMP dump-guest-memory. > > > > Signed-off-by: Andrew Jones > > --- > > target-arm/Makefile.objs

[Qemu-devel] qcow2 corruption repair can not proceed due to bad snapshot

2015-11-20 Thread Brian Taber
I recently ran across an issue (completely my own fault) that others have encountered with varying details/success in fixing. I had a VM stuck in shutdown (windoze asking/waiting to kill a program) that I thought was already down when I created a snapshot on the 3 disks attached to the VM. After

Re: [Qemu-devel] [OpenBIOS] [Qemu-ppc] CUDA has problems with Mac OS 10.4

2015-11-20 Thread Alfonso Gamboa
booting into MacOS9 with qemu to the Desktop is now possible, see: http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&start=250 Some issues, remain, certain extensions crash on boot. On Nov 20, 2015 7:46 AM, "Programmingkid" wrote: > > On Nov 20, 2015, at 8:39 AM, BALATON Zoltan wrote

[Qemu-devel] [ANNOUNCE] QEMU 2.5.0-rc1 is now available

2015-11-20 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the second release candidate for the QEMU 2.5 release. This release is meant for testing purposes and should not be used in a production environment. http://wiki.qemu.org/download/qemu-2.5.0-rc1.tar.bz2 You can help imp

Re: [Qemu-devel] CPU Cache simulation

2015-11-20 Thread Lluís Vilanova
Pranith Kumar writes: > On Wed, Nov 18, 2015 at 1:06 PM, Eduardo Habkost wrote: >> >> >> Interesting. How much did you change QEMU to make this work? Have >> you been rebasing this to recent QEMU versions often? > The core of qemu is not changed except for one TCG issue I didn't know > how to

Re: [Qemu-devel] [PATCH 4/4] qjson: surprise, allocating 6 QObjects per token is expensive

2015-11-20 Thread Paolo Bonzini
On 20/11/2015 19:48, Eric Blake wrote: >> > +token = g_malloc(sizeof(JSONToken) + input->len + 1); >> > +token->type = type; >> > +memcpy(token->str, input->str, input->len + 1); >> > +token->str[input->len] = 0; > Looks like you are writing the last byte twice. Either the +1 in

Re: [Qemu-devel] ivshmem property size should be a size, not a string

2015-11-20 Thread Marc-André Lureau
Hi - Original Message - > >> Hash ivshmem been used in anger? If yes, how? > > Still the question to answer. I don't expect users to read this ML everyday (anybody actually). Personally, I have no clue how widespread ivshmem usage is. > Besides the usual PCI properties, we have: > >

Re: [Qemu-devel] [PATCH 2/4] qjson: do not save/restore contexts

2015-11-20 Thread Paolo Bonzini
On 20/11/2015 19:28, Eric Blake wrote: >> > +token = parser_context_peek_token(ctxt); >> > if (token == NULL) { >> > goto out; >> > } >> > >> > +if (token_get_type(token) != JSON_ESCAPE) { >> > +goto out; >> > +} > Could merge these two conditionals. Foll

Re: [Qemu-devel] [PATCH 1/4] qjson: replace QString in JSONLexer with GString

2015-11-20 Thread Paolo Bonzini
On 20/11/2015 19:23, Eric Blake wrote: > On 11/20/2015 02:04 AM, Paolo Bonzini wrote: >> JSONLexer only needs a simple resizable buffer. json-streamer.c >> can allocate memory for each token instead of relying on reference >> counting of QStrings. >> >> Signed-off-by: Paolo Bonzini >> --- >> i

Re: [Qemu-devel] [PATCH] numa: Clean up query-memdev error handling, plug leak

2015-11-20 Thread Markus Armbruster
Eduardo Habkost writes: > On Fri, Nov 20, 2015 at 05:24:02PM +0100, Markus Armbruster wrote: >> Eduardo Habkost writes: >> >> > On Fri, Nov 20, 2015 at 03:57:17PM +0100, Markus Armbruster wrote: >> >> Eduardo Habkost writes: >> >> >> >> > On Fri, Nov 20, 2015 at 02:00:40PM +0100, Markus Armbr

Re: [Qemu-devel] ivshmem property size should be a size, not a string

2015-11-20 Thread Markus Armbruster
Marc-André Lureau writes: > - Original Message - >> Eric Blake writes: >> >> > On 11/20/2015 09:23 AM, Marc-André Lureau wrote: >> >> Hi >> >> >> >> - Original Message - >> >>> Everybody's favourite device model has "size" property. It's declared >> >>> as *string* >> >>> >> >

Re: [Qemu-devel] [PATCH] numa: Clean up query-memdev error handling, plug leak

2015-11-20 Thread Eduardo Habkost
On Fri, Nov 20, 2015 at 05:24:02PM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Fri, Nov 20, 2015 at 03:57:17PM +0100, Markus Armbruster wrote: > >> Eduardo Habkost writes: > >> > >> > On Fri, Nov 20, 2015 at 02:00:40PM +0100, Markus Armbruster wrote: > >> >> qmp_query_mem

Re: [Qemu-devel] WG: [ovirt-users] Segmentation fault in libtcmalloc

2015-11-20 Thread Dr. David Alan Gilbert
* Grundmann, Christian (christian.grundm...@fabasoft.com) wrote: > Hi, > it seems that using virtio-scsi did the trick, > But now the VMs are pausing without an coredump, so the underlying Problem > (no storage Error) is not fixed, > As I am using Snapshots (and so the disks have to grow very fas

Re: [Qemu-devel] [PATCH 4/4] qjson: surprise, allocating 6 QObjects per token is expensive

2015-11-20 Thread Eric Blake
On 11/20/2015 02:04 AM, Paolo Bonzini wrote: > Replace the contents of the tokens GQueue with a simple struct. This cuts > the amount of memory allocated by tests/check-qjson from ~500MB to ~20MB, > and the execution time from 600ms to 80ms on my laptop. Still a lot (some > could be saved by usin

Re: [Qemu-devel] [PATCH 3/4] qjson: store tokens in a GQueue

2015-11-20 Thread Eric Blake
On 11/20/2015 02:04 AM, Paolo Bonzini wrote: > Even though we still have the "streamer" concept, the tokens can now > be deleted as they are read. While doing so convert from QList to > GQueue, since the next step will make tokens not a QObject and we > will have to do the conversion anyway. > >

Re: [Qemu-devel] [PATCH 2/4] qjson: do not save/restore contexts

2015-11-20 Thread Eric Blake
On 11/20/2015 02:04 AM, Paolo Bonzini wrote: > JSON is LL(1) and our parser indeed needs only 1 token lookahead. > Saving the parser context is mostly unnecessary; we can replace it > with peeking at the next token, or remove it altogether when the > restore only happens on errors. The token list

[Qemu-devel] [PATCH WIP 27/30] crypto: implement the LUKS block encryption format

2015-11-20 Thread Daniel P. Berrange
Provide a block encryption implementation that follows the LUKS/dm-crypt specification. This supports all combinations of hash, cipher algorithm, cipher mode and iv generator that are implemented by the current crypto layer. The notable missing feature is support for the 'xts' cipher mode, which

Re: [Qemu-devel] [PATCH 1/4] qjson: replace QString in JSONLexer with GString

2015-11-20 Thread Eric Blake
On 11/20/2015 02:04 AM, Paolo Bonzini wrote: > JSONLexer only needs a simple resizable buffer. json-streamer.c > can allocate memory for each token instead of relying on reference > counting of QStrings. > > Signed-off-by: Paolo Bonzini > --- > include/qapi/qmp/json-lexer.h| 7 +++ > i

[Qemu-devel] [PATCH WIP 28/30] block: add generic full disk encryption driver

2015-11-20 Thread Daniel P. Berrange
Add a block driver that is capable of supporting any full disk encryption format. This utilizes the previously added block encryption code, and at this time supports the LUKS format. The driver code is capable of supporting any format supported by the QCryptoBlock module, so it registers one block

Re: [Qemu-devel] ivshmem property size should be a size, not a string

2015-11-20 Thread Marc-André Lureau
- Original Message - > Eric Blake writes: > > > On 11/20/2015 09:23 AM, Marc-André Lureau wrote: > >> Hi > >> > >> - Original Message - > >>> Everybody's favourite device model has "size" property. It's declared > >>> as *string* > >>> > >>> DEFINE_PROP_STRING("size", IVSh

Re: [Qemu-devel] [PATCH 2/5] dump: qemunotes aren't commonly needed

2015-11-20 Thread Peter Maydell
On 19 November 2015 at 14:53, Andrew Jones wrote: > Only one of three architectures implementing qmp-dump-guest-memory write > qemu notes. And, another architecture (arm/aarch64) is coming, which > won't use them either. Make the common implementation truly common. > > (No functional change.) > >

[Qemu-devel] [PATCH WIP 20/30] crypto: ensure qapi/crypto.json is listed in qapi-modules

2015-11-20 Thread Daniel P. Berrange
The rebuild of qapi-types.c/h is not correctly triggered when qapi/crypto.json is changed because it was missing from the list of files in the qapi-modules variable. Signed-off-by: Daniel P. Berrange --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Ma

[Qemu-devel] [PATCH WIP 13/30] block: remove all encryption handling APIs

2015-11-20 Thread Daniel P. Berrange
Now that all encryption keys must be provided upfront via the QCryptoSecret API and associated block driver properties there is no need for any explicit encryption handling APIs in the block layer. Encryption can be handled transparently within the block driver. We only retain an API for querying w

[Qemu-devel] [PATCH WIP 30/30] qcow2: add LUKS full disk encryption support

2015-11-20 Thread Daniel P. Berrange
The QCow2 format currently has support for built-in AES encryption, however, this is fundamentally flawed from a cryptographic security POV, so its use is deprecated. The previously added generic full disk encryption driver could be used to encrypt QCow2 files by either laying it above or below the

Re: [Qemu-devel] [PATCH 5/5] target-arm: support QMP dump-guest-memory

2015-11-20 Thread Peter Maydell
On 19 November 2015 at 14:53, Andrew Jones wrote: > Add the support needed for creating prstatus elf notes. This > allows us to use QMP dump-guest-memory. > > Signed-off-by: Andrew Jones > --- > target-arm/Makefile.objs | 3 +- > target-arm/arch_dump.c | 222 > ++

Re: [Qemu-devel] ivshmem property size should be a size, not a string

2015-11-20 Thread Markus Armbruster
Eric Blake writes: > On 11/20/2015 09:23 AM, Marc-André Lureau wrote: >> Hi >> >> - Original Message - >>> Everybody's favourite device model has "size" property. It's declared >>> as *string* >>> >>> DEFINE_PROP_STRING("size", IVShmemState, sizearg), >>> >>> >>> * In QMP, the size

[Qemu-devel] [PATCH WIP 06/30] qemu-img: add support for --object command line arg

2015-11-20 Thread Daniel P. Berrange
Allow creation of user creatable object types with qemu-img via a --object command line arg. This will be used to supply passwords and/or encryption keys to the various block driver backends via the recently added 'secret' object type. # echo -n letmein > mypasswd.txt # qemu-img info --object se

[Qemu-devel] [PATCH WIP 29/30] qcow2: convert QCow2 to use QCryptoBlock for encryption

2015-11-20 Thread Daniel P. Berrange
The QCryptoBlock framework trivially supports the legecy QCow encryption format. Convert QCow2 to use QCryptoBlock, since this will unlock the ability to support LUKS in QCow2 without increasing the code burden for encryption in QCow2. Signed-off-by: Daniel P. Berrange --- block/qcow2-cluster.c

[Qemu-devel] [PATCH WIP 08/30] qemu-io: add support for --object command line arg

2015-11-20 Thread Daniel P. Berrange
Allow creation of user creatable object types with qemu-io via a --object command line arg. This will be used to supply passwords and/or encryption keys to the various block driver backends via the recently added 'secret' object type. # echo -n letmein > mypasswd.txt # qemu-io --object secret,id

[Qemu-devel] [PATCH WIP 22/30] crypto: add support for PBKDF2 algorithm

2015-11-20 Thread Daniel P. Berrange
The LUKS data format includes use of PBKDF2 (Password-Based Key Derivation Function). The Nettle library can provide an implementation of this, but we don't want code directly depending on a specific crypto library backend. Introduce a include/crypto/pbkdf.h header which defines a QEMU API for invo

[Qemu-devel] [PATCH WIP 23/30] crypto: add support for generating initialization vectors

2015-11-20 Thread Daniel P. Berrange
There are a number of different algorithms that can be used to generate initialization vectors for disk encryption. This introduces a simple internal QCryptoBlockIV object to provide a consistent internal API to the different algorithms. The initially implemented algorithms are 'plain', 'plain64' a

[Qemu-devel] [PATCH WIP 01/30] crypto: add QCryptoSecret object class for password/key handling

2015-11-20 Thread Daniel P. Berrange
Introduce a new QCryptoSecret object class which will be used for providing passwords and keys to other objects which need sensitive credentials. The new object can provide secret values directly as properties, or indirectly via a file. The latter includes support for file descriptor passing synta

[Qemu-devel] [PATCH WIP 18/30] crypto: move QCryptoHashAlgorithm enum definition into QAPI

2015-11-20 Thread Daniel P. Berrange
The QCryptoHashAlgorithm enum is defined in the crypto/hash.h header. In the future some QAPI types will want to reference the hash enums, so move the enum definition into QAPI too. Signed-off-by: Daniel P. Berrange --- crypto/hash.c | 4 ++-- include/crypto/hash.h | 9 + qapi/

[Qemu-devel] [PATCH WIP 25/30] crypto: fix transposed arguments in cipher error message

2015-11-20 Thread Daniel P. Berrange
When reporting an incorrect key length for a cipher, we mixed up the actual vs expected arguments. Signed-off-by: Daniel P. Berrange --- crypto/cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/cipher.c b/crypto/cipher.c index e92d49a..a69ff5e 100644 --- a/crypt

[Qemu-devel] [PATCH WIP 19/30] crypto: move QCryptoCipherAlgorithm/Mode enum definitions into QAPI

2015-11-20 Thread Daniel P. Berrange
The QCryptoCipherAlgorithm and QCryptoCipherMode enums are defined in the crypto/cipher.h header. In the future some QAPI types will want to reference the hash enums, so move the enum definition into QAPI too. Signed-off-by: Daniel P. Berrange --- crypto/cipher.c | 8 include/c

[Qemu-devel] [PATCH WIP 26/30] crypto: add block encryption framework

2015-11-20 Thread Daniel P. Berrange
Add a generic framework for support different block encryption formats. Upon instantiating a QCryptoBlock object, it will read the encryption header and extract the encryption keys. It is then possible to call methods to encrypt/decrypt data buffers. There is also a mode whereby it will create/ini

[Qemu-devel] [PATCH WIP 10/30] qemu-nbd: allow specifying image as a set of options args

2015-11-20 Thread Daniel P. Berrange
Currently qemu-nbd allows an image filename to be passed on the command line, but does not have a way to set any options except the format eg qemu-nbd https://127.0.0.1/images/centos7.iso qemu-nbd /home/berrange/demo.qcow2 This adds a --source arg (that is mutually exclusive with a position

[Qemu-devel] [PATCH WIP 11/30] qemu-img: allow specifying image as a set of options args

2015-11-20 Thread Daniel P. Berrange
Currently qemu-img allows an image filename to be passed on the command line, but does not have a way to set any options except the format eg qemu-img info https://127.0.0.1/images/centos7.iso This adds a --source arg (that is mutually exclusive with a positional filename arg and -f arg) that

[Qemu-devel] [PATCH WIP 24/30] crypto: add support for anti-forensic split algorithm

2015-11-20 Thread Daniel P. Berrange
The LUKS format specifies an anti-forensic split algorithm which is used to artificially expand the size of the key material on disk. This is an implementation of that algorithm. Signed-off-by: Daniel P. Berrange --- crypto/Makefile.objs| 1 + crypto/afsplit.c| 194

[Qemu-devel] [PATCH WIP 07/30] qemu-nbd: add support for --object command line arg

2015-11-20 Thread Daniel P. Berrange
Allow creation of user creatable object types with qemu-nbd via a --object command line arg. This will be used to supply passwords and/or encryption keys to the various block driver backends via the recently added 'secret' object type. # echo -n letmein > mypasswd.txt # qemu-nbd --object secret,

[Qemu-devel] [PATCH WIP 21/30] crypto: add cryptographic random byte source

2015-11-20 Thread Daniel P. Berrange
Signed-off-by: Daniel P. Berrange --- crypto/Makefile.objs| 1 + crypto/random.c | 50 + include/crypto/random.h | 43 ++ 3 files changed, 94 insertions(+) create mode 100644 crypto/random.c cre

[Qemu-devel] [PATCH WIP 12/30] block: rip out all traces of password prompting

2015-11-20 Thread Daniel P. Berrange
Now that qcow & qcow2 are wired up to get encryption keys via the QCryptoSecret object, all traces of code which had to deal with prompting for passwords can be ripped out. When the image is initially opened, the encryption key must be available immediately, or an error will be reported. $ qemu-s

[Qemu-devel] [PATCH WIP 15/30] qcow2: make qcow2_encrypt_sectors encrypt in place

2015-11-20 Thread Daniel P. Berrange
Instead of requiring separate input/output buffers for encrypting data, change qcow2_encrypt_sectors() to assume use of a single buffer, encrypting in place. The current callers all used the same buffer for input/output already. Signed-off-by: Daniel P. Berrange --- block/qcow2-cluster.c | 17 ++

[Qemu-devel] [PATCH WIP 00/30] Support for full disk encryption

2015-11-20 Thread Daniel P. Berrange
This Work-In-Progress series introduces a framework for full disk encryption, and implements the LUKS encryption format using it. It provides a new block driver that can use this directly, but also aims to integrate it natively into the qcow2 file format (more on that later). For convenience, this

[Qemu-devel] [PATCH WIP 16/30] crypto: add ability to query the cipher key, block & IV lens

2015-11-20 Thread Daniel P. Berrange
Adds new methods to allow querying the length of the cipher key, block size and initialization vectors. Signed-off-by: Daniel P. Berrange --- crypto/cipher.c| 48 ++ include/crypto/cipher.h| 37 +++ tests

[Qemu-devel] [PATCH WIP 09/30] qemu-io: allow specifying image as a set of options args

2015-11-20 Thread Daniel P. Berrange
Currently qemu-io allows an image filename to be passed on the command line, but does not have a way to set any options except the format eg qemu-io https://127.0.0.1/images/centos7.iso qemu-io /home/berrange/demo.qcow2 This adds a --source arg (that is mutually exclusive with a positional file

[Qemu-devel] [PATCH WIP 05/30] qom: add user_creatable_add & user_creatable_del methods

2015-11-20 Thread Daniel P. Berrange
The QMP monitor code has two helper methods object_add and qmp_object_del that are called from several places in the code (QMP, HMP and main emulator startup). We soon need to use this code from qemu-img, qemu-io and qemu-nbd too, but don't want those to depend on the monitor. To avoid this, move

[Qemu-devel] [PATCH WIP 14/30] block: remove support for writing to qcow/qcow2 encrypted images

2015-11-20 Thread Daniel P. Berrange
Refuse to open a qcow/qcow2 image with encryption if write access has been requested. To enable historic data to be liberated support for reading images is retained, as it does not pose an unreasonable support burden now that the new key handling infrastructure is inplace. Signed-off-by: Daniel P.

[Qemu-devel] [PATCH WIP 17/30] crypto: add method for querying hash digest size

2015-11-20 Thread Daniel P. Berrange
Add a qcrypto_hash_digest_len() method which allows querying of the raw digest size for a given hash algorithm. Signed-off-by: Daniel P. Berrange --- crypto/hash.c| 15 +++ include/crypto/hash.h| 11 +++ tests/test-crypto-hash.c | 5 + 3 files changed, 31

[Qemu-devel] [PATCH WIP 03/30] qcow: add a 'keyid' parameter to qcow options

2015-11-20 Thread Daniel P. Berrange
Add a 'keyid' parameter that refers to the ID of a QCryptoSecret instance that provides the encryption key. eg $QEMU \ -object secret,id=sec0,filename=/home/berrange/encrypted.pw \ -drive file=/home/berrange/encrypted.qcow,keyid=sec0 Signed-off-by: Daniel P. Berrange --- block/qcow.c

[Qemu-devel] [PATCH WIP 04/30] qcow2: add a 'keyid' parameter to qcow2 options

2015-11-20 Thread Daniel P. Berrange
Add a 'keyid' parameter that refers to the ID of a QCryptoSecret instance that provides the encryption key. $QEMU \ -object secret,id=sec0,filename=/home/berrange/encrypted.pw \ -drive file=/home/berrange/encrypted.qcow2,keyid=sec0 Signed-off-by: Daniel P. Berrange --- block/qcow2.c

[Qemu-devel] [PATCH WIP 02/30] crypto: add support for loading encrypted x509 keys

2015-11-20 Thread Daniel P. Berrange
Make use of the QCryptoSecret object to support loading of encrypted x509 keys. The optional 'passwordid' parameter to the tls-creds-x509 object type, provides the ID of a secret object instance that holds the decryption password for the PEM file. # echo "123456" > mypasswd.txt # $QEMU \ -ob

Re: [Qemu-devel] [PATCH] block/qapi: Plug memory leak on query-block error path

2015-11-20 Thread Eric Blake
On 11/20/2015 05:53 AM, Markus Armbruster wrote: > Spotted by Coverity. Worth mentioning that commit 553a7e87 was the culprit. > > Signed-off-by: Markus Armbruster > --- > block/qapi.c | 8 +++- > 1 file changed, 3 insertions(+), 5 deletions(-) > -- Eric Blake eblake redhat com+1-

Re: [Qemu-devel] [PATCH for-2.5] block/qapi: Plug memory leak on query-block error path

2015-11-20 Thread Eric Blake
On 11/20/2015 05:53 AM, Markus Armbruster wrote: > Spotted by Coverity. > > Signed-off-by: Markus Armbruster > --- > block/qapi.c | 8 +++- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/block/qapi.c b/block/qapi.c > index d20262d..267f147 100644 > --- a/block/qapi.c > +

[Qemu-devel] Is ivshmem's test for unix domain client socket valid?

2015-11-20 Thread Markus Armbruster
Looks rather fishy: if (strncmp(s->server_chr->filename, "unix:", 5)) { error_setg(errp, "chardev is not a unix client socket"); return; } Paolo, is this reliable? Is it the proper way to check?

Re: [Qemu-devel] [PATCH] tests: fix cdrom_pio_impl in ide-test

2015-11-20 Thread Peter Maydell
On 20 November 2015 at 17:12, John Snow wrote: > This looks correct. This will definitely fix the race in the test, since > it was due to a race where we were reading the data when DRQ was not set. > > Where I still remain a little confused is the precise flow control that > leads to sending an i

[Qemu-devel] [PATCH v13 02/14] qobject: Rename qtype_code to QType

2015-11-20 Thread Eric Blake
The name QType matches our CODING_STYLE conventions for type names in CamelCase. It also matches the fact that we are already naming all the enum members with a prefix of QTYPE, not QTYPE_CODE. And doing the rename will also make it easier for the next patch to use QAPI for providing the enum, wh

[Qemu-devel] [PATCH v13 14/14] qapi: Detect base class loops

2015-11-20 Thread Eric Blake
It should be fairly obvious that qapi base classes need to form an acyclic graph, since QMP cannot specify the same key more than once, while base classes are included as flat members alongside other members added by the child. But the old check_member_clash() parser function was not prepared to c

[Qemu-devel] [PATCH v13 11/14] qapi: Populate info['name'] for each entity

2015-11-20 Thread Eric Blake
Every non-implicit entity is associated with an info dictionary, but it is not easy to reverse-engineer the name of the top-most entity associated with that info. Add a new info['name'] field to track this information, as it will be handy in future commits for better error messages. Signed-off-by

Re: [Qemu-devel] [PATCH v2 4/4] json-streamer: Limit number of tokens in addition to total size

2015-11-20 Thread Eric Blake
On 11/20/2015 01:50 AM, Paolo Bonzini wrote: > > > On 20/11/2015 07:13, Markus Armbruster wrote: @@ -64,6 +65,7 @@ static void json_message_process_token(JSONLexer *lexer, QString *token, JSONTok parser->bracket_count == 0)) { goto out_emit; } els

[Qemu-devel] [PATCH v13 01/14] qobject: Simplify QObject

2015-11-20 Thread Eric Blake
The QObject hierarchy is small enough, and unlikely to grow further (since we only use it to map to JSON and already cover all JSON types), that we can simplify things by not tracking a separate vtable, but just inline the refcnt element of the vtable QType directly into QObject, and track a separa

Re: [Qemu-devel] [RFC v1] virtio-crypto specification

2015-11-20 Thread Jani Kokkonen
Hi Arei, Yes, I am member of TC. I will contact you on this topic for further clarification. -Jani -Original Message- From: Gonglei (Arei) Sent: Friday, November 20, 2015 11:14 AM To: Michael S. Tsirkin Cc: virtio-...@lists.oasis-open.org; qemu-devel@nongnu.org; Jani Kokkonen; Huangp

[Qemu-devel] [PATCH v13 13/14] qapi: Move duplicate collision checks to schema check()

2015-11-20 Thread Eric Blake
With the recent commit 'qapi: Detect collisions in C member names', we have two different locations for detecting clashes - one at parse time, and another at QAPISchema*.check() time. Remove all of the ad hoc parser checks, and delete associated code (for example, the global check_member_clash() me

[Qemu-devel] [PATCH v13 08/14] qapi: Shorter visits of optional fields

2015-11-20 Thread Eric Blake
For less code, reflect the determined boolean value of an optional visit back to the caller instead of making the caller read the boolean after the fact. The resulting generated code has the following diff: |-visit_optional(v, &has_fdset_id, "fdset-id"); |-if (has_fdset_id) { |+if (vi

[Qemu-devel] [PATCH v13 10/14] qapi: Track enum values by QAPISchemaMember, not string

2015-11-20 Thread Eric Blake
Rather than using just an array of strings, make enum.values be an array of the new QAPISchemaMember type. Creating an enum requires wrapping strings, and visiting an enum requires getting at the name of each value. But using this type means we can share the existing code for C name clash detecti

[Qemu-devel] [PATCH v13 09/14] qapi: Prepare new QAPISchemaMember base class

2015-11-20 Thread Eric Blake
We want to share some clash detection code between enum values and object type members. To assist with that, split off part of QAPISchemaObjectTypeMember into a new base class QAPISchemaMember that tracks name, owner, and common clash detection code; while the former keeps the additional fields fo

[Qemu-devel] [PATCH v13 12/14] qapi: Enforce (or whitelist) case conventions on qapi members

2015-11-20 Thread Eric Blake
We document that members of enums and objects should be 'lower-case', although we were not enforcing it. We have to whitelist a few pre-existing entities that violate the norms. Add three new tests to expose the new error message, each of which first uses the whitelisted name 'UuidInfo' to prove t

[Qemu-devel] [PATCH v13 04/14] qapi: Simplify visiting of alternate types

2015-11-20 Thread Eric Blake
Previously, working with alternates required two lookup arrays and some indirection: for type Foo, we created Foo_qtypes[] which maps each qtype to a value of the generated FooKind enum, then look up that value in FooKind_lookup[] like we do for other union types. This has a couple of subtle bugs.

[Qemu-devel] [PATCH v13 07/14] qapi: Simplify visits of optional fields

2015-11-20 Thread Eric Blake
None of the visitor callbacks would set an error when testing if an optional field was present; make this part of the interface contract by eliminating the errp argument. The resulting generated code has a nice diff: |-visit_optional(v, &has_fdset_id, "fdset-id", &err); |-if (err) { |-

Re: [Qemu-devel] [Intel-gfx] [Announcement] 2015-Q3 release of XenGT - a Mediated Graphics Passthrough Solution from Intel

2015-11-20 Thread Alex Williamson
On Fri, 2015-11-20 at 08:10 +, Tian, Kevin wrote: > > From: Tian, Kevin > > Sent: Friday, November 20, 2015 3:10 PM > > > > > > > > > > > The proposal is therefore that GPU vendors can expose vGPUs to > > > > > userspace, and thus to QEMU, using the VFIO API. For instance, vfio > > > > > supp

[Qemu-devel] [PATCH v13 06/14] qapi: Fix alternates that accept 'number' but not 'int'

2015-11-20 Thread Eric Blake
The QMP input visitor allows integral values to be assigned by promotion to a QTYPE_QFLOAT. However, when parsing an alternate, we did not take this into account, such that an alternate that accepts 'number' and some other type, but not 'int', would reject integral values. With this patch, we now

[Qemu-devel] [PATCH v13 00/14] qapi member collision (post-introspection cleanups, subset D)

2015-11-20 Thread Eric Blake
Pending prerequisites: + Markus' "typedefs: Put them back into alphabetical order" https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg04417.html + Markus' qapi-next branch http://repo.or.cz/qemu/armbru.git/shortlog/refs/heads/qapi-next Also available as a tag at this location: git fetch git:

[Qemu-devel] [PATCH v13 03/14] qapi: Convert QType into QAPI built-in enum type

2015-11-20 Thread Eric Blake
What's more meta than using qapi to define qapi? :) Convert QType into a full-fledged[*] builtin qapi enum type, so that a subsequent patch can then use it as the discriminator type of qapi alternate types. Fortunately, the judicious use of 'prefix' in the qapi definition avoids churn to the spel

[Qemu-devel] [PATCH v13 05/14] qapi: Inline _make_implicit_tag()

2015-11-20 Thread Eric Blake
Now that alternates no longer use an implicit tag, we can inline _make_implicit_tag() into its one caller, _def_union_type(). No change to generated code. Suggested-by: Markus Armbruster Signed-off-by: Eric Blake --- v13: commit message touchup v12: new patch --- scripts/qapi.py | 9 +++--

Re: [Qemu-devel] [PATCH] tests: fix cdrom_pio_impl in ide-test

2015-11-20 Thread John Snow
On 11/20/2015 09:29 AM, Peter Lieven wrote: > The check for the cleared BSY flag has to be performed > before each data transfer and not just before the > first one. > > Commit 5f81724d revealed this glitch as the BSY flag > was not set in ATAPI PIO transfers before. > > While at it fix the des

Re: [Qemu-devel] [Intel-gfx] [Announcement] 2015-Q3 release of XenGT - a Mediated Graphics Passthrough Solution from Intel

2015-11-20 Thread Alex Williamson
On Fri, 2015-11-20 at 07:09 +, Tian, Kevin wrote: > > From: Alex Williamson [mailto:alex.william...@redhat.com] > > Sent: Friday, November 20, 2015 4:03 AM > > > > > > > > > > The proposal is therefore that GPU vendors can expose vGPUs to > > > > userspace, and thus to QEMU, using the VFIO API

Re: [Qemu-devel] [PATCH] tests: fix cdrom_pio_impl in ide-test

2015-11-20 Thread Kevin Wolf
Am 20.11.2015 um 15:29 hat Peter Lieven geschrieben: > The check for the cleared BSY flag has to be performed > before each data transfer and not just before the > first one. > > Commit 5f81724d revealed this glitch as the BSY flag > was not set in ATAPI PIO transfers before. > > While at it fix

Re: [Qemu-devel] [PATCH] tests: fix cdrom_pio_impl in ide-test

2015-11-20 Thread John Snow
On 11/20/2015 09:37 AM, Peter Maydell wrote: > On 20 November 2015 at 14:29, Peter Lieven wrote: >> The check for the cleared BSY flag has to be performed >> before each data transfer and not just before the >> first one. >> >> Commit 5f81724d revealed this glitch as the BSY flag >> was not set

Re: [Qemu-devel] ivshmem property size should be a size, not a string

2015-11-20 Thread Eric Blake
On 11/20/2015 09:23 AM, Marc-André Lureau wrote: > Hi > > - Original Message - >> Everybody's favourite device model has "size" property. It's declared >> as *string* >> >> DEFINE_PROP_STRING("size", IVShmemState, sizearg), >> >> >> * In QMP, the size must be given as JSON string inst

Re: [Qemu-devel] [PATCH for 2.6 0/3] Bitmap clean-up patches for 2.6

2015-11-20 Thread Vladimir Sementsov-Ogievskiy
Hi Fam! Thanks for it, I really like the idea about dropping granularity from hbitmap. I've waste lots of time understanding the code about bitmaps. Keeping in mind what units are in what granularity and what granularity is in what units is more than inconvenient) On 20.11.2015 12:59, Fam Zh

Re: [Qemu-devel] [Intel-gfx] [Announcement] 2015-Q3 release of XenGT - a Mediated Graphics Passthrough Solution from Intel

2015-11-20 Thread Alex Williamson
On Fri, 2015-11-20 at 13:51 +0800, Jike Song wrote: > On 11/20/2015 12:22 PM, Alex Williamson wrote: > > On Fri, 2015-11-20 at 10:58 +0800, Jike Song wrote: > >> On 11/19/2015 11:52 PM, Alex Williamson wrote: > >>> On Thu, 2015-11-19 at 15:32 +, Stefano Stabellini wrote: > On Thu, 19 Nov 2

Re: [Qemu-devel] [PATCH for 2.6 2/3] block: Hide HBitmap in block dirty bitmap interface

2015-11-20 Thread Vladimir Sementsov-Ogievskiy
On 20.11.2015 12:59, Fam Zheng wrote: HBitmap is an implementation detail of block dirty bitmap that should be hidden from users. Introduce a BdrvDirtyBitmapIter to encapsulate the underlying HBitmapIter. A small difference in the interface is, before, an HBitmapIter is initialized in place, now

  1   2   3   >