]> git.ipfire.org Git - thirdparty/qemu.git/commit - block.c
block: Introduce path_has_protocol() function
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Thu, 9 Dec 2010 11:53:00 +0000 (11:53 +0000)
committerKevin Wolf <kwolf@redhat.com>
Fri, 17 Dec 2010 15:10:59 +0000 (16:10 +0100)
commit9e0b22f4f2c4122bb3544bb44fb7ce2fd7964c12
treea277f978c78901326c3cc1f83c46a8ac036cc367
parent0fc0f1fa7f86e9f1d480c6508191ca90ac10b32c
block: Introduce path_has_protocol() function

The bdrv_find_protocol() function returns NULL if an unknown protocol
name is given.  It returns the "file" protocol when the filename
contains no protocol at all.  This makes it difficult to distinguish
between paths which contain a protocol and those which do not.

Factor out a helper function that tests whether or not a filename has a
protocol.  The next patch makes use of this function.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c