[libvirt] [RFC] Can we error out early for unknown device models?
by Martin Kletzander
Hi everyone,
I had this idea that since we are probing QEMU binaries for devices
using 'qom-list-types', we could store that data in the capabilities
and check whether device models are supported before starting QEMU.
We do that for _some newer_ devices, but this would be global. It
would help out particularly with devices like the following one, for
example:
<interface type='network'>
<source network='default'/>
<model type='non-existing_device'/>
</interface>
where we simply construct QEMU command-line with that device model and
it then properly errors out:
error: internal error: process exited while connecting to monitor:
qemu-system-x86_64: -device non-existing_device,...: Parameter
'driver' expects device type
This would be easy to achieve with current data unless there are some
models hidden from qom-list-types' output. I hope there are none.
When I checked the output of 'qemu-kvm -device \?', the devices listed
there are separated into categories and have buses assigned to them
and that lead me to another idea. What if that data is added to
qom-list-types' output and used in libvirt as well? We could then
solve another annoying cases like misusing devices or plugging them
into unsupported buses. Although I don't know any person who would do
such a thing, even when solving the first idea, there'd still be a
possibility to do a thing like:
<interface type='network'>
<source network='default'/>
<model type='AC97'/>
</interface>
This idea is obviously meant for the QEMU driver, but if there's
something similar in other drivers, it might be useful as well.
I'd be interested in any feedback and welcome any ideas to whether it
is useful, how the storing should be done or even if it's something we
want to have or not.
Have a nice day,
Martin
10 years
[libvirt] [libvirt-python PATCH] Add a type check for time in libvirt_virDomainSetTime
by Luyao Huang
When pass a number or other things to setTime,no error output,but set time to 0.
Add a type check and give a clear error messages:
TypeError: time must be dict
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
libvirt-override.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libvirt-override.c b/libvirt-override.c
index 9ba87eb..05552a7 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -7795,6 +7795,11 @@ libvirt_virDomainSetTime(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
return NULL;
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
+ if (!PyDict_Check(py_dict)) {
+ PyErr_Format(PyExc_TypeError, "time must be dict");
+ return NULL;
+ }
+
py_dict_size = PyDict_Size(py_dict);
if (py_dict_size == 2) {
--
1.8.3.1
10 years
[libvirt] [PATCHv2 0/2] Add non-FreeBSD guest support to Bhyve driver.
by Conrad Meyer
Drvbhyve hardcodes bhyveload(8) as the host bootloader for guests.
bhyveload(8) loader only supports FreeBSD guests.
This patch adds <bootloader> and <bootloader_args> handling to
bhyve_command, so libvirt can boot non-FreeBSD guests in Bhyve.
See patch logs for further details.
Thanks,
Conrad
Changelog:
v2:
- Dropped hvm -> xen change per Peter's feedback.
Conrad Meyer (2):
bhyve: Support /domain/bootloader configuration for non-FreeBSD
guests.
Generated PO files for 'bhyve: Support /domain/bootloader'
docs/drvbhyve.html.in | 28 ++++++++++--
docs/formatdomain.html.in | 4 +-
po/af.po | 4 ++
po/am.po | 4 ++
po/ar.po | 4 ++
po/as.po | 4 ++
po/be.po | 4 ++
po/bg.po | 4 ++
po/bn.po | 4 ++
po/bn_IN.po | 4 ++
po/bo.po | 4 ++
po/bs.po | 4 ++
po/ca.po | 4 ++
po/cs.po | 4 ++
po/cy.po | 4 ++
po/da.po | 4 ++
po/de.po | 4 ++
po/el.po | 4 ++
po/en_GB.po | 4 ++
po/es.po | 4 ++
po/et.po | 4 ++
po/eu_ES.po | 4 ++
po/fa.po | 4 ++
po/fi.po | 4 ++
po/fr.po | 4 ++
po/gl.po | 4 ++
po/gu.po | 4 ++
po/he.po | 4 ++
po/hi.po | 4 ++
po/hr.po | 4 ++
po/hu.po | 4 ++
po/hy.po | 4 ++
po/id.po | 4 ++
po/is.po | 4 ++
po/it.po | 4 ++
po/ja.po | 4 ++
po/ka.po | 4 ++
po/kn.po | 4 ++
po/ko.po | 4 ++
po/ku.po | 4 ++
po/libvirt.pot | 4 ++
po/lo.po | 4 ++
po/lt.po | 4 ++
po/lv.po | 4 ++
po/mk.po | 4 ++
po/ml.po | 4 ++
po/mr.po | 4 ++
po/ms.po | 4 ++
po/my.po | 4 ++
po/nb.po | 4 ++
po/nl.po | 4 ++
po/nn.po | 4 ++
po/nso.po | 4 ++
po/or.po | 4 ++
po/pa.po | 4 ++
po/pl.po | 4 ++
po/pt.po | 4 ++
po/pt_BR.po | 4 ++
po/ro.po | 4 ++
po/ru.po | 4 ++
po/si.po | 4 ++
po/sk.po | 4 ++
po/sl.po | 4 ++
po/sq.po | 4 ++
po/sr.po | 4 ++
po/sr(a)latin.po | 4 ++
po/sv.po | 4 ++
po/ta.po | 4 ++
po/te.po | 4 ++
po/th.po | 4 ++
po/tr.po | 4 ++
po/uk.po | 4 ++
po/ur.po | 4 ++
po/vi.po | 4 ++
po/vi_VN.po | 4 ++
po/zh_CN.po | 4 ++
po/zh_TW.po | 4 ++
po/zu.po | 4 ++
src/bhyve/bhyve_command.c | 107 +++++++++++++++++++++++++++++++++++++++++-----
79 files changed, 428 insertions(+), 15 deletions(-)
--
1.9.3
10 years
[libvirt] Coming release plans for libvirt-1.2.10
by Daniel Veillard
It's already the end of the month and I didn't pushed plans yet
(forgot !) for the coming release. We have only until the end of
the week to get to next month, o we should freeze this week.
There isn't that many commits yet sine 1.2.9, less than 140 and
a number of them are the large splitting changes for the hypervisor
driver.
So a slightly smaller freeze may be just fine, I'm tempted to push
the rc1 for 1.2.10 freeze very early on Wednesday and targetting
a release out next Monday.
Hopefully that works for everyone,
thanks,
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
10 years
Re: [libvirt] Close the BlockDriverState when guest eject the media
by Weidong Huang
On 2014/10/20 19:39, Kevin Wolf wrote:
> Am 20.10.2014 um 13:27 hat Weidong Huang geschrieben:
>> On 2014/10/20 17:41, Kevin Wolf wrote:
>>
>>> Am 18.10.2014 um 12:02 hat Weidong Huang geschrieben:
>>>> Hi ALL:
>>>>
>>>> There are two ways to eject the cdrom tray. One is by the eject's qmp commmand(eject_device).
>>>> The another one is by the guest(bdrv_eject). They have different results.
>>>
>>> Yes, they are different things.
>>>
>>> If a guest opens the tray (using bdrv_eject) and then closes it again,
>>> with no user interaction in between, the virtual media must still be in
>>> the drive and the guest must be able to access the same image again.
>>> Calling bdrv_close() in this case would be a bug.
>>>
>>> The goal of the monitor command "eject" on the other hand is to remove
>>> the medium so that the drive is empty. That a device with a closed tray
>>> has to be opened for this is only secondary.
>>
>>
>> Thanks for your reply.
>>
>> There is a problem.
>>
>> 1. Qemu receive the "eject" command.
>> 2. Runs "eject_request_cb" when an eject request is issued from the monitor, the tray
>> is closed, and the medium is locked. But the drive is not closed.
>> 3. Guest agree with opening tray and qemu will call bdrv_eject to complete. The drive is
>> still not close.
>>
>> So the result of the monitor command "eject" is not to remove the medium in this situation.
>
> Now I understand, thanks for explaining.
>
> But I think libvirt can actually work correctly with what qemu offers
> today. qemu returns an error if the medium cannot be removed with the
> 'eject' command and it only sends an eject request to the guest.
>
> With this error, libvirt can know that the DEVICE_TRAY_MOVED event
> doesn't mean that the medium has removed, but that it needs to issue
> another 'eject' command.
>
> If this isn't implemented correctly in libvirt today, this needs a
> libvirt fix rather than a qemu one.
>
hi all!
How about fix it in libvirt?
>>>> eject_device: close the BlockDriverState(bdrv_close(bs))
>>>> bdrv_eject: don't close the BlockDriverState,
>>>>
>>>> This is ambiguous. So libvirt can't handle some situations.
>>>>
>>>> libvirt send eject qmp command ---> qemu send eject request to guest --->
>>>> guest respond to qemu ---> qemu emit tray_open event to libvirt --->
>>>> libvirt will not send change qmp command if media source is null. So
>>>> the media is not be replace to the null.
>>>
>>> What is the problem that libvirt has with the guest opening the tray? I
>>> don't think libvirt should even care about that case.
>>
>>
>> For example, using libvirt to change media by xml below(media source is null):
>> <disk type='file' device='cdrom'>
>> <driver name='qemu'/>
>> <target dev='hdb' bus='ide'/>
>> </disk>
>>
>> libivrt return ok. But media still is in the guest.
>> This is confused.
>
> Kevin
>
> .
>
10 years
[libvirt] [PATCHv4 0/3] Add non-FreeBSD guest support to Bhyve driver.
by Conrad Meyer
Drvbhyve hardcodes bhyveload(8) as the host bootloader for guests.
bhyveload(8) loader only supports FreeBSD guests.
This patch series adds <bootloader> and <bootloader_args> handling to
bhyve_command, so libvirt can boot non-FreeBSD guests in Bhyve.
Additionally, support for grub-bhyve(1)'s --cons-dev argument is added so that
interactive GRUB menus can be manipulated with the domain-configured serial
device.
See patch logs for further details.
Thanks,
Conrad
Changelog:
v4:
- Supports interactive GRUB menus (Per Roman) (Ubuntu CD tested)
- Various style fixes (per Roman) (syntax-check clean)
- Moved devices.map filename from driver connection object to domain private
object (per Roman)
- Fleshed out drvbhyve.html (per Roman)
v3:
- Based on latest git as of less than an hour ago; tested HDD booting a Linux
guest several times.
- Added first cut at CD booting. I'm not sure grub-bhyve supports this
(was not able to to test it).
- make 'syntax-check' clean
- Per Roman (off-list), split up virBhyveProcessBuildLoadCmd into a few
smaller functions.
- Also per Roman (off-list), use virCommandAddArgSet() for bootloader_args.
(Without the nasty cast, my compiler complains.)
v2:
- Dropped hvm -> xen change per Peter's feedback.
Conrad Meyer (3):
bhyve: Support /domain/bootloader configuration for non-FreeBSD
guests.
Generated PO files for 'bhyve: Support /domain/bootloader'
bhyve: Add console support for grub-bhyve bootloader
docs/drvbhyve.html.in | 94 +++++++++++++++++++-
docs/formatdomain.html.in | 4 +-
po/af.po | 7 +-
po/am.po | 7 +-
po/ar.po | 7 +-
po/as.po | 7 +-
po/be.po | 7 +-
po/bg.po | 7 +-
po/bn.po | 7 +-
po/bn_IN.po | 7 +-
po/bo.po | 7 +-
po/bs.po | 7 +-
po/ca.po | 7 +-
po/cs.po | 7 +-
po/cy.po | 7 +-
po/da.po | 7 +-
po/de.po | 7 +-
po/el.po | 7 +-
po/en_GB.po | 7 +-
po/es.po | 7 +-
po/et.po | 7 +-
po/eu_ES.po | 7 +-
po/fa.po | 7 +-
po/fi.po | 7 +-
po/fr.po | 7 +-
po/gl.po | 7 +-
po/gu.po | 7 +-
po/he.po | 7 +-
po/hi.po | 7 +-
po/hr.po | 7 +-
po/hu.po | 7 +-
po/hy.po | 7 +-
po/id.po | 7 +-
po/is.po | 7 +-
po/it.po | 7 +-
po/ja.po | 7 +-
po/ka.po | 7 +-
po/kn.po | 7 +-
po/ko.po | 7 +-
po/ku.po | 7 +-
po/libvirt.pot | 7 +-
po/lo.po | 7 +-
po/lt.po | 7 +-
po/lv.po | 7 +-
po/mk.po | 7 +-
po/ml.po | 7 +-
po/mr.po | 7 +-
po/ms.po | 7 +-
po/my.po | 7 +-
po/nb.po | 7 +-
po/nl.po | 7 +-
po/nn.po | 7 +-
po/nso.po | 7 +-
po/or.po | 7 +-
po/pa.po | 7 +-
po/pl.po | 7 +-
po/pt.po | 7 +-
po/pt_BR.po | 7 +-
po/ro.po | 7 +-
po/ru.po | 7 +-
po/si.po | 7 +-
po/sk.po | 7 +-
po/sl.po | 7 +-
po/sq.po | 7 +-
po/sr.po | 7 +-
po/sr(a)latin.po | 7 +-
po/sv.po | 7 +-
po/ta.po | 7 +-
po/te.po | 7 +-
po/th.po | 7 +-
po/tr.po | 7 +-
po/uk.po | 7 +-
po/ur.po | 7 +-
po/vi.po | 7 +-
po/vi_VN.po | 7 +-
po/zh_CN.po | 7 +-
po/zh_TW.po | 7 +-
po/zu.po | 7 +-
src/bhyve/bhyve_command.c | 215 ++++++++++++++++++++++++++++++++++++++++++----
src/bhyve/bhyve_command.h | 5 +-
src/bhyve/bhyve_domain.c | 5 ++
src/bhyve/bhyve_domain.h | 1 +
src/bhyve/bhyve_driver.c | 2 +-
src/bhyve/bhyve_process.c | 13 ++-
84 files changed, 768 insertions(+), 103 deletions(-)
--
1.9.3
10 years
[libvirt] [PATCH] util: eliminate "use after free" in callers of virNetDevLinkDump
by Laine Stump
virNetDevLinkDump() gets a message from netlink into "resp", then
calls nlmsg_parse() to fill the table "tb" with pointers into resp. It
then returns tb to its caller, but not before freeing the buffer at
resp. That means that all the callers of virNetDevLinkDump() are
examining memory that has already been freed. This can be verified by
filling the buffer at resp with garbage prior to freeing it (or, I
suppose, just running libvirtd under valgrind) then performing some
operation that calls virNetDevLinkDump().
The code has been like this ever since virNetDevLinkDump() was written
- the original author didn't notice it, and neither did later
additional users of the function. It has only been pure luck (or maybe
a lack of heavy load, and/or maybe an allocation algorithm in malloc()
that delays re-use of just-freed memory) that has kept this from
causing errors, for example when configuring a PCI passthrough or
macvtap passthrough network interface.
The solution taken in this patch is the simplest - just return resp to
the caller along with tb, then have the caller free it after they are
finished using the data (pointers) in tb. I alternately could have
made a cleaner interface by creating a new struct that put tb and resp
together along with a vir*Free() function for it, but this function is
only used in a couple places, and I'm not sure there will be
additional new uses of virNetDevLinkDump(), so the value of adding a
new type, extra APIs, etc. is dubious.
---
src/util/virnetdev.c | 26 +++++++++++++++++---------
src/util/virnetdev.h | 2 +-
src/util/virnetdevvportprofile.c | 17 ++++++++++++-----
3 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index db5623a..c22a0e6 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1353,23 +1353,25 @@ static struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = {
/**
* virNetDevLinkDump:
*
- * @ifname: The name of the interface; only use if ifindex < 0
- * @ifindex: The interface index; may be < 0 if ifname is given
- * @nlattr: pointer to a pointer of netlink attributes that will contain
- * the results
+ * @ifname: The name of the interface; only use if ifindex <= 0
+ * @ifindex: The interface index; may be <= 0 if ifname is given
+ * @data: Gets a pointer to the raw data from netlink.
+ MUST BE FREED BY CALLER!
+ * @nlattr: Pointer to a pointer of netlink attributes that will contain
+ * the results
* @src_pid: pid used for nl_pid of the local end of the netlink message
* (0 == "use getpid()")
* @dst_pid: pid of destination nl_pid if the kernel
* is not the target of the netlink message but it is to be
* sent to another process (0 if sending to the kernel)
*
- * Get information about an interface given its name or index.
+ * Get information from netlink about an interface given its name or index.
*
* Returns 0 on success, -1 on fatal error.
*/
int
virNetDevLinkDump(const char *ifname, int ifindex,
- struct nlattr **tb,
+ void **nlData, struct nlattr **tb,
uint32_t src_pid, uint32_t dst_pid)
{
int rc = -1;
@@ -1451,7 +1453,9 @@ virNetDevLinkDump(const char *ifname, int ifindex,
rc = 0;
cleanup:
nlmsg_free(nl_msg);
- VIR_FREE(resp);
+ if (rc < 0)
+ VIR_FREE(resp);
+ *nlData = resp;
return rc;
malformed_resp:
@@ -1647,15 +1651,18 @@ virNetDevGetVfConfig(const char *ifname, int vf, virMacAddrPtr mac,
int *vlanid)
{
int rc = -1;
+ void *nlData = NULL;
struct nlattr *tb[IFLA_MAX + 1] = {NULL, };
int ifindex = -1;
- rc = virNetDevLinkDump(ifname, ifindex, tb, 0, 0);
+ rc = virNetDevLinkDump(ifname, ifindex, &nlData, tb, 0, 0);
if (rc < 0)
- return rc;
+ goto cleanup;
rc = virNetDevParseVfConfig(tb, vf, mac, vlanid);
+ cleanup:
+ VIR_FREE(nlData);
return rc;
}
@@ -1798,6 +1805,7 @@ virNetDevRestoreNetConfig(const char *linkdev, int vf, const char *stateDir)
int
virNetDevLinkDump(const char *ifname ATTRIBUTE_UNUSED,
int ifindex ATTRIBUTE_UNUSED,
+ void **nlData ATTRIBUTE_UNUSED,
struct nlattr **tb ATTRIBUTE_UNUSED,
uint32_t src_pid ATTRIBUTE_UNUSED,
uint32_t dst_pid ATTRIBUTE_UNUSED)
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index 2a6e67d..5c463ef 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -166,7 +166,7 @@ int virNetDevGetVirtualFunctions(const char *pfname,
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
int virNetDevLinkDump(const char *ifname, int ifindex,
- struct nlattr **tb,
+ void **nlData, struct nlattr **tb,
uint32_t src_pid, uint32_t dst_pid)
ATTRIBUTE_RETURN_CHECK;
diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c
index 75679b0..6ee20d3 100644
--- a/src/util/virnetdevvportprofile.c
+++ b/src/util/virnetdevvportprofile.c
@@ -787,7 +787,8 @@ virNetDevVPortProfileGetNthParent(const char *ifname, int ifindex, unsigned int
int *parent_ifindex, char *parent_ifname,
unsigned int *nth)
{
- int rc;
+ int rc = -1;
+ void *nlData = NULL;
struct nlattr *tb[IFLA_MAX + 1] = { NULL, };
bool end = false;
size_t i = 0;
@@ -798,7 +799,8 @@ virNetDevVPortProfileGetNthParent(const char *ifname, int ifindex, unsigned int
return -1;
while (!end && i <= nthParent) {
- rc = virNetDevLinkDump(ifname, ifindex, tb, 0, 0);
+ VIR_FREE(nlData);
+ rc = virNetDevLinkDump(ifname, ifindex, &nlData, tb, 0, 0);
if (rc < 0)
break;
@@ -807,7 +809,8 @@ virNetDevVPortProfileGetNthParent(const char *ifname, int ifindex, unsigned int
IFNAMSIZ)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("buffer for root interface name is too small"));
- return -1;
+ rc = -1;
+ goto cleanup;
}
*parent_ifindex = ifindex;
}
@@ -824,6 +827,8 @@ virNetDevVPortProfileGetNthParent(const char *ifname, int ifindex, unsigned int
*nth = i - 1;
+ cleanup:
+ VIR_FREE(nlData);
return rc;
}
@@ -845,6 +850,7 @@ virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
int rc;
int src_pid = 0;
uint32_t dst_pid = 0;
+ void *nlData = NULL;
struct nlattr *tb[IFLA_MAX + 1] = { NULL, };
int repeats = STATUS_POLL_TIMEOUT_USEC / STATUS_POLL_INTERVL_USEC;
uint16_t status = 0;
@@ -877,7 +883,8 @@ virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
}
while (--repeats >= 0) {
- rc = virNetDevLinkDump(NULL, ifindex, tb, src_pid, dst_pid);
+ VIR_FREE(nlData);
+ rc = virNetDevLinkDump(NULL, ifindex, &nlData, tb, src_pid, dst_pid);
if (rc < 0)
goto cleanup;
@@ -909,7 +916,7 @@ virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
}
cleanup:
-
+ VIR_FREE(nlData);
return rc;
}
--
1.9.3
10 years
[libvirt] [PATCH v2] tests: Adding SELINUX_LIBS to fix viridentitytest linker bug.
by Julio Faracco
In a clean build system (Ubuntu 14.04), the viridentitytest failed to compile.
Even if all the SELINUX libraries and depedencies are installed. See the error
message below:
[...]
CC viridentitytest.o
CCLD viridentitytest
/usr/bin/ld: viridentitytest.o: undefined reference to symbol
'security_disable'
//lib/x86_64-linux-gnu/libselinux.so.1: error adding symbols: DSO missing
from command line
collect2: error: ld returned 1 exit status
make: *** [viridentitytest] Error 1
Simply adding the variable SELINUX_LIBS in viridentitytest rules of
Makefile.am to include SELINUX libraries into viridentitytest solved that
compilation issue. A conditional was added to consider when libvirt is using
or not SELINUX.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
tests/Makefile.am | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4c3d4ef..363c902 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -926,11 +926,13 @@ virstoragetest_LDADD = $(LDADDS) \
viridentitytest_SOURCES = \
viridentitytest.c testutils.h testutils.c
-viridentitytest_LDADD = $(LDADDS)
if WITH_SELINUX
+viridentitytest_LDADD = $(LDADDS) $(SELINUX_LIBS)
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
../src/libvirt.la
-endif WITH_SELINUX
+else ! WITH_SELINUX
+viridentitytest_LDADD = $(LDADDS)
+endif ! WITH_SELINUX
viriscsitest_SOURCES = \
viriscsitest.c testutils.h testutils.c
--
1.9.1
10 years, 1 month
[libvirt] [PATCH] qemu: add capability probing for block-stream
by Shanzhi Yu
Since block-stream is not supported on qemu-kvm, so libvirt should
post more accurate error info when do blockpull with qemu-kvm but
not "Command 'block-stream' is not found"
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1140981
Signed-off-by: Shanzhi Yu <shyu(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_driver.c | 13 +++++--------
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 81ada48..5674f4f 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -269,6 +269,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"splash-timeout", /* 175 */
"iothread",
+ "block-stream",
);
@@ -1426,6 +1427,7 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = {
{ "query-spice", QEMU_CAPS_SPICE },
{ "query-kvm", QEMU_CAPS_KVM },
{ "block-commit", QEMU_CAPS_BLOCK_COMMIT },
+ { "block-stream", QEMU_CAPS_BLOCK_STREAM },
{ "query-vnc", QEMU_CAPS_VNC },
{ "drive-mirror", QEMU_CAPS_DRIVE_MIRROR },
{ "blockdev-snapshot-sync", QEMU_CAPS_DISK_SNAPSHOT },
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 0980c00..6701965 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -216,6 +216,7 @@ typedef enum {
QEMU_CAPS_RTC_RESET_REINJECTION = 174, /* rtc-reset-reinjection monitor command */
QEMU_CAPS_SPLASH_TIMEOUT = 175, /* -boot splash-time */
QEMU_CAPS_OBJECT_IOTHREAD = 176, /* -object iothread */
+ QEMU_CAPS_BLOCK_STREAM = 177, /* block-stream */
QEMU_CAPS_LAST, /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 73edda3..b38bc91 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14980,15 +14980,12 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("block jobs not supported with this QEMU binary"));
goto cleanup;
- } else if (base) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("partial block pull not supported with this "
- "QEMU binary"));
- goto cleanup;
- } else if (mode == BLOCK_JOB_PULL && bandwidth) {
+ }
+
+ if (mode == BLOCK_JOB_PULL &&
+ !(virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCK_STREAM))){
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("setting bandwidth at start of block pull not "
- "supported with this QEMU binary"));
+ _("block pull is not supported with this QEMU binary"));
goto cleanup;
}
--
1.8.3.1
10 years, 1 month
[libvirt] [PATCH] vbox: network: make sure driver not be NULL in virRegisterNetworkDriver
by Shanzhi Yu
libvirtd will report below error if does not make sure driver not be NULL
in virRegisterNetworkDriver
$ libvirtd
2014-10-24 09:24:36.443+0000: 28876: info : libvirt version: 1.2.10
2014-10-24 09:24:36.443+0000: 28876: error : virRegisterNetworkDriver:549 : driver in virRegisterNetworkDriver must not be NULL
2014-10-24 09:24:36.443+0000: 28876: error : virDriverLoadModule:99 : Failed module registration vboxNetworkRegister
Signed-off-by: Shanzhi Yu <shyu(a)redhat.com>
---
src/vbox/vbox_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c
index 743a488..ff69069 100644
--- a/src/vbox/vbox_driver.c
+++ b/src/vbox/vbox_driver.c
@@ -152,7 +152,7 @@ int vboxNetworkRegister(void)
if (VBoxCGlueInit(&uVersion) == 0)
networkDriver = vboxGetNetworkDriver(uVersion);
- if (virRegisterNetworkDriver(networkDriver) < 0)
+ if ((networkDriver != NULL) && (virRegisterNetworkDriver(networkDriver) < 0))
return -1;
return 0;
}
--
1.9.3
10 years, 1 month