[libvirt] [PATCH] libvirt-guests: fix some typos in a comment
by Martin Kletzander
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
Pushed as trivial
tools/libvirt-guests.sh.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
index a158b62..1b17bbe 100644
--- a/tools/libvirt-guests.sh.in
+++ b/tools/libvirt-guests.sh.in
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 2011-2013 Red Hat, Inc.
+# Copyright (C) 2011-2014 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -250,8 +250,8 @@ suspend_guest()
}
# shutdown_guest URI GUEST
-# Start a ACPI shutdown of GUEST on URI. This function return after the quest
-# was successfully shutdown or the timeout defined by $SHUTDOWN_TIMEOUT expires.
+# Start an ACPI shutdown of GUEST on URI. This function returns after the guest
+# was successfully shutdown or the timeout defined by $SHUTDOWN_TIMEOUT expired.
shutdown_guest()
{
uri=$1
--
2.0.2
10 years, 4 months
[libvirt] [PATCH V2 0/6] Some improvements for video model.
by Wang Rui
From: Zeng Junliang <zengjunliang(a)huawei.com>
https://www.redhat.com/archives/libvir-list/2014-June/msg00569.html
diff to v1:
- Rmoving the confusing vram attribute for cirrus and stdvga.
- leave out cirrus for the new vgamem attribute.
- add secondary-vga supports and some other docs and tests.
Zeng Junliang (6):
qemu: Remove vram attribute in some cases
qemu: Introduce vgamem attribute for video model
qemu: Add support for secondary-vga
tests: modify test case related to vgamem attribute
tests: Add test cases for secondary-vga
docs: add description for vgamem attribute and secondary-vga
docs/formatdomain.html.in | 39 ++++---
docs/schemas/domaincommon.rng | 5 +
qemuxml2argv-graphics-vnc-secondary-vga.xml | 39 +++++++
src/conf/domain_conf.c | 71 ++++++++++--
src/conf/domain_conf.h | 4 +-
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 125 ++++++++++++++-------
...qemuhotplug-console-compat-2+console-virtio.xml | 2 +-
.../qemuxml2argv-console-compat-2.xml | 2 +-
.../qemuxml2argv-controller-order.xml | 2 +-
.../qemuxml2argv-graphics-listen-network.xml | 2 +-
.../qemuxml2argv-graphics-listen-network2.xml | 2 +-
.../qemuxml2argv-graphics-sdl-fullscreen.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 2 +-
...emuxml2argv-graphics-spice-agent-file-xfer.args | 5 +-
...qemuxml2argv-graphics-spice-agent-file-xfer.xml | 4 +-
.../qemuxml2argv-graphics-spice-agentmouse.xml | 2 +-
.../qemuxml2argv-graphics-spice-compression.args | 4 +-
.../qemuxml2argv-graphics-spice-compression.xml | 4 +-
.../qemuxml2argv-graphics-spice-listen-network.xml | 4 +-
.../qemuxml2argv-graphics-spice-qxl-vga.args | 4 +-
.../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 +-
.../qemuxml2argv-graphics-spice-sasl.args | 3 +-
.../qemuxml2argv-graphics-spice-sasl.xml | 2 +-
.../qemuxml2argv-graphics-spice-timeout.xml | 2 +-
.../qemuxml2argv-graphics-spice.args | 5 +-
.../qemuxml2argv-graphics-spice.xml | 4 +-
.../qemuxml2argv-graphics-vnc-policy.xml | 2 +-
.../qemuxml2argv-graphics-vnc-sasl.xml | 2 +-
.../qemuxml2argv-graphics-vnc-secondary-vga.args | 7 ++
.../qemuxml2argv-graphics-vnc-secondary-vga.xml | 39 +++++++
.../qemuxml2argv-graphics-vnc-socket.xml | 2 +-
.../qemuxml2argv-graphics-vnc-tls.xml | 2 +-
.../qemuxml2argv-graphics-vnc-websocket.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml | 2 +-
.../qemuxml2argv-net-bandwidth.xml | 2 +-
.../qemuxml2argv-pci-autoadd-addr.xml | 2 +-
.../qemuxml2argv-pci-autoadd-idx.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml | 2 +-
.../qemuxml2argv-pcihole64-q35.args | 3 +-
.../qemuxml2argv-pcihole64-q35.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-q35.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +-
.../qemuxml2argv-serial-spiceport.args | 4 +-
.../qemuxml2argv-serial-spiceport.xml | 2 +-
.../qemuxml2argv-video-device-pciaddr-default.args | 9 +-
.../qemuxml2argv-video-device-pciaddr-default.xml | 6 +-
tests/qemuxml2argvtest.c | 10 +-
.../qemuxml2xmlout-graphics-listen-network2.xml | 2 +-
.../qemuxml2xmlout-graphics-spice-timeout.xml | 2 +-
.../qemuxml2xmlout-pci-autoadd-addr.xml | 2 +-
.../qemuxml2xmlout-pci-autoadd-idx.xml | 2 +-
tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +-
tests/qemuxml2xmltest.c | 1 +
57 files changed, 345 insertions(+), 123 deletions(-)
create mode 100644 qemuxml2argv-graphics-vnc-secondary-vga.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.xml
--
1.7.12.4
10 years, 4 months
[libvirt] [PATCH 0/3] Multiple RNG device support
by Peter Krempa
Qemu and kernel support multiple RNG's, so I revived my old patch to add the support to libvirt.
Peter Krempa (3):
qemu: cgroup: Don't use NULL path on default backed RNGs
virtio-rng: allow multiple RNG devices
test: qemu: Add tests for multiple virtio-rng devices
src/conf/domain_audit.c | 4 +-
src/conf/domain_conf.c | 58 +++++++++++-----------
src/conf/domain_conf.h | 4 +-
src/qemu/qemu_cgroup.c | 27 ++++++----
src/qemu/qemu_command.c | 29 ++++++-----
.../qemuxml2argv-virtio-rng-multiple.args | 9 ++++
.../qemuxml2argv-virtio-rng-multiple.xml | 31 ++++++++++++
tests/qemuxml2argvtest.c | 2 +
8 files changed, 109 insertions(+), 55 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-multiple.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-multiple.xml
--
2.0.0
10 years, 4 months
[libvirt] about ceph+qcow2+qemu(snapshot) support issue ?
by haiquan517@sina.com
Hi ,
Could you pls help me ask one question , now we are testing a fuction , about Ceph+ qcow2+(qemu(snapshot) tec, now we are running this command print this error : virsh snapshot-create-as --domain win08q2 --name snapwin08q2 --description "test ucsm+qcow2"error: operation failed: Error -5 while writing VM
so we want to confirm that the ceph rbd if support qemu qcow2 format oneline snapshot , thanks a lot!
10 years, 4 months
[libvirt] [PATCH] util: virTimeFieldsThenRaw never return negative
by Wang Rui
From: James <james.wangyufei(a)huawei.com>
virTimeFieldsThenRaw will never return negative result, so I delete related
judgement.
Signed-off-by: James <james.wangyufei(a)huawei.com>
---
src/util/virtime.c | 7 ++-----
src/util/virtime.h | 4 ++--
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/util/virtime.c b/src/util/virtime.c
index 2a91ea5..662c161 100644
--- a/src/util/virtime.c
+++ b/src/util/virtime.c
@@ -121,9 +121,8 @@ const unsigned short int __mon_yday[2][13] = {
* Converts the timestamp @when into broken-down field format.
* Time time is always in UTC
*
- * Returns 0 on success, -1 on error with errno set
*/
-int virTimeFieldsThenRaw(unsigned long long when, struct tm *fields)
+void virTimeFieldsThenRaw(unsigned long long when, struct tm *fields)
{
/* This code is taken from GLibC under terms of LGPLv2+ */
long int days, rem, y;
@@ -171,7 +170,6 @@ int virTimeFieldsThenRaw(unsigned long long when, struct tm *fields)
days -= ip[y];
fields->tm_mon = y;
fields->tm_mday = days + 1;
- return 0;
}
@@ -209,8 +207,7 @@ int virTimeStringThenRaw(unsigned long long when, char *buf)
{
struct tm fields;
- if (virTimeFieldsThenRaw(when, &fields) < 0)
- return -1;
+ virTimeFieldsThenRaw(when, &fields);
fields.tm_year += 1900;
fields.tm_mon += 1;
diff --git a/src/util/virtime.h b/src/util/virtime.h
index 25332db..61f36dc 100644
--- a/src/util/virtime.h
+++ b/src/util/virtime.h
@@ -43,12 +43,12 @@ int virTimeMillisNowRaw(unsigned long long *now)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
int virTimeFieldsNowRaw(struct tm *fields)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
-int virTimeFieldsThenRaw(unsigned long long when, struct tm *fields)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
int virTimeStringNowRaw(char *buf)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
int virTimeStringThenRaw(unsigned long long when, char *buf)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+void virTimeFieldsThenRaw(unsigned long long when, struct tm *fields)
+ ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
/* These APIs are *not* async signal safe and return -1,
* raising a libvirt error on failure
--
1.7.12.4
10 years, 4 months
[libvirt] KVM Forum 2014 Call for Participation
by Paolo Bonzini
=================================================================
KVM Forum 2014: Call For Participation
October 14-16, 2014 - Congress Centre Düsseldorf - Düsseldorf, Germany
(All submissions must be received before midnight July 27, 2014)
=================================================================
KVM is an industry leading open source hypervisor that provides an ideal
platform for datacenter virtualization, virtual desktop infrastructure,
and cloud computing. Once again, it's time to bring together the
community of developers and users that define the KVM ecosystem for
our annual technical conference. We will discuss the current state of
affairs and plan for the future of KVM, its surrounding infrastructure,
and management tools. Mark your calendar and join us in advancing KVM.
http://events.linuxfoundation.org/events/kvm-forum/
Once again we are colocated with the Linux Foundation's LinuxCon Europe,
CloudOpen Europe, Embedded Linux Conference (ELC) Europe, and this year, the
Linux Plumbers Conference. KVM Forum attendees will be able to attend
LinuxCon + CloudOpen + ELC for a discounted rate.
http://events.linuxfoundation.org/events/kvm-forum/attend/register
We invite you to lead part of the discussion by submitting a speaking
proposal for KVM Forum 2014.
http://events.linuxfoundation.org/cfp
Suggested topics:
KVM/Kernel
- Scaling and optimizations
- Nested virtualization
- Linux kernel performance improvements
- Resource management (CPU, I/O, memory)
- Hardening and security
- VFIO: SR-IOV, GPU, platform device assignment
- Architecture ports
QEMU
- Management interfaces: QOM and QMP
- New devices, new boards, new architectures
- Scaling and optimizations
- Desktop virtualization and SPICE
- Virtual GPU
- virtio and vhost, including non-Linux or non-virtualized uses
- Hardening and security
- New storage features
- Live migration and fault tolerance
- High availability and continuous backup
- Real-time guest support
- Emulation and TCG
- Firmware: ACPI, UEFI, coreboot, u-Boot, etc.
- Testing
Management and infrastructure
- Managing KVM: Libvirt, OpenStack, oVirt, etc.
- Storage: glusterfs, Ceph, etc.
- Software defined networking: Open vSwitch, OpenDaylight, etc.
- Network Function Virtualization
- Security
- Provisioning
- Performance tuning
===============
SUBMITTING YOUR PROPOSAL
===============
Abstracts due: July 27, 2014
Please submit a short abstract (~150 words) describing your presentation
proposal. Slots vary in length up to 45 minutes. Also include in your
proposal
the proposal type -- one of:
- technical talk
- end-user talk
Submit your proposal here:
http://events.linuxfoundation.org/cfp
Please only use the categories "presentation" and "panel discussion"
You will receive a notification whether or not your presentation proposal
was accepted by Aug 20th.
Speakers will receive a complimentary pass for the event. In the instance
that your submission has multiple presenters, only the primary speaker for a
proposal will receive a complementary event pass. For panel discussions, all
panelists will receive a complimentary event pass.
TECHNICAL TALKS
A good technical talk should not just report on what has happened over
the last year; it should present a concrete problem and how it impacts
the user and/or developer community. Whenever applicable, it should
focus on the work that needs to be done or the difficulties that haven't yet
been solved. Summarizing recent developments is okay but it should
not be more than a small portion of the overall talk.
END-USER TALKS
One of the big challenges as developers is to know what, where and how
people actually use our software. We will reserve a few slots for end
users talking about their deployment challenges and achievements.
If you are using KVM in production you are encouraged submit a speaking
proposal. Simply mark it as an end-user talk. As an end user, this is a
unique opportunity to get your input to developers.
HANDS-ON / BOF SESSIONS
We will reserve some time for people to get together and discuss
strategic decisions as well as other topics that are best solved within
smaller groups. This time can also be used for hands-on hacking
sessions if you have concrete code problems to solve.
These sessions will be announced during the event. If you are interested
in organizing such a session, please add it to the list at
http://www.linux-kvm.org/page/KVM_Forum_2014_BOF
Let people you think might be interested know about it, and encourage
them to add their names to the wiki page as well. Please try to
add your ideas to the list before KVM Forum starts.
PANEL DISCUSSIONS
If you are proposing a panel discussion, please make sure that you list
all of
your potential panelists in your abstract. We will request full biographies
if a panel is accepted.
===============
HOTEL / TRAVEL
===============
The KVM Forum 2014 will be held in Düsseldorf, Germany at
Congress Centre Düsseldorf
http://events.linuxfoundation.org/events/kvm-forum/attend/hotel-and-travel
===============
IMPORTANT DATES
===============
Notification: August 20, 2014
Schedule announced: August 29, 2014
Event dates: October 14-16, 2014
Thank you for your interest in KVM. We're looking forward to your
submissions and seeing you at the KVM Forum 2014 in October!
-your KVM Forum 2014 Program Committee
Please contact us with any questions or comments.
10 years, 4 months
[libvirt] [PATCH] qemu: Remove extraneous space in function prototypes
by John Ferlan
During review of the iSCSI hostdev series, eblake noted that the
prototypes shouldn't have the extranenous space between the "*" and
the function name:
http://www.redhat.com/archives/libvir-list/2014-July/msg01227.html
Since it was more invasive than 1 or 2 lines - I said I'd send a
patch covering this once committed.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
NOTE: There are other instances of this in other trees - I figured
I'd just cover this particular directory. I can do more if desired...
src/qemu/qemu_capabilities.h | 2 +-
src/qemu/qemu_command.h | 136 +++++++++++++++++++++----------------------
src/qemu/qemu_conf.h | 2 +-
3 files changed, 70 insertions(+), 70 deletions(-)
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 4332633..d80daaa 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -310,7 +310,7 @@ bool virQEMUCapsSupportsChardev(virDomainDefPtr def,
bool virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps,
const char *canonical_machine);
-const char * virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps);
+const char *virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps);
int virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
const char *binary,
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index b71e964..95f3fc9 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -58,11 +58,11 @@
typedef struct _qemuBuildCommandLineCallbacks qemuBuildCommandLineCallbacks;
typedef qemuBuildCommandLineCallbacks *qemuBuildCommandLineCallbacksPtr;
struct _qemuBuildCommandLineCallbacks {
- char * (*qemuGetSCSIDeviceSgName) (const char *sysfs_prefix,
- const char *adapter,
- unsigned int bus,
- unsigned int target,
- unsigned int unit);
+ char *(*qemuGetSCSIDeviceSgName) (const char *sysfs_prefix,
+ const char *adapter,
+ unsigned int bus,
+ unsigned int target,
+ unsigned int unit);
};
extern qemuBuildCommandLineCallbacks buildCommandLineCallbacks;
@@ -89,27 +89,27 @@ qemuBuildChrDeviceStr(char **deviceStr,
virQEMUCapsPtr qemuCaps);
/* With vlan == -1, use netdev syntax, else old hostnet */
-char * qemuBuildHostNetStr(virDomainNetDefPtr net,
- virQEMUDriverPtr driver,
- char type_sep,
- int vlan,
- char **tapfd,
- int tapfdSize,
- char **vhostfd,
- int vhostfdSize);
+char *qemuBuildHostNetStr(virDomainNetDefPtr net,
+ virQEMUDriverPtr driver,
+ char type_sep,
+ int vlan,
+ char **tapfd,
+ int tapfdSize,
+ char **vhostfd,
+ int vhostfdSize);
/* Legacy, pre device support */
-char * qemuBuildNicStr(virDomainNetDefPtr net,
- const char *prefix,
- int vlan);
+char *qemuBuildNicStr(virDomainNetDefPtr net,
+ const char *prefix,
+ int vlan);
/* Current, best practice */
-char * qemuBuildNicDevStr(virDomainDefPtr def,
- virDomainNetDefPtr net,
- int vlan,
- int bootindex,
- int vhostfdSize,
- virQEMUCapsPtr qemuCaps);
+char *qemuBuildNicDevStr(virDomainDefPtr def,
+ virDomainNetDefPtr net,
+ int vlan,
+ int bootindex,
+ int vhostfdSize,
+ virQEMUCapsPtr qemuCaps);
char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk,
virQEMUCapsPtr qemuCaps);
@@ -123,68 +123,68 @@ char *qemuBuildFSStr(virDomainFSDefPtr fs,
virQEMUCapsPtr qemuCaps);
/* Current, best practice */
-char * qemuBuildDriveDevStr(virDomainDefPtr def,
- virDomainDiskDefPtr disk,
- int bootindex,
- virQEMUCapsPtr qemuCaps);
-char * qemuBuildFSDevStr(virDomainDefPtr domainDef,
- virDomainFSDefPtr fs,
- virQEMUCapsPtr qemuCaps);
+char *qemuBuildDriveDevStr(virDomainDefPtr def,
+ virDomainDiskDefPtr disk,
+ int bootindex,
+ virQEMUCapsPtr qemuCaps);
+char *qemuBuildFSDevStr(virDomainDefPtr domainDef,
+ virDomainFSDefPtr fs,
+ virQEMUCapsPtr qemuCaps);
/* Current, best practice */
-char * qemuBuildControllerDevStr(virDomainDefPtr domainDef,
- virDomainControllerDefPtr def,
- virQEMUCapsPtr qemuCaps,
- int *nusbcontroller);
+char *qemuBuildControllerDevStr(virDomainDefPtr domainDef,
+ virDomainControllerDefPtr def,
+ virQEMUCapsPtr qemuCaps,
+ int *nusbcontroller);
-char * qemuBuildWatchdogDevStr(virDomainDefPtr domainDef,
- virDomainWatchdogDefPtr dev,
- virQEMUCapsPtr qemuCaps);
+char *qemuBuildWatchdogDevStr(virDomainDefPtr domainDef,
+ virDomainWatchdogDefPtr dev,
+ virQEMUCapsPtr qemuCaps);
-char * qemuBuildMemballoonDevStr(virDomainDefPtr domainDef,
- virDomainMemballoonDefPtr dev,
- virQEMUCapsPtr qemuCaps);
+char *qemuBuildMemballoonDevStr(virDomainDefPtr domainDef,
+ virDomainMemballoonDefPtr dev,
+ virQEMUCapsPtr qemuCaps);
-char * qemuBuildUSBInputDevStr(virDomainDefPtr domainDef,
- virDomainInputDefPtr dev,
- virQEMUCapsPtr qemuCaps);
+char *qemuBuildUSBInputDevStr(virDomainDefPtr domainDef,
+ virDomainInputDefPtr dev,
+ virQEMUCapsPtr qemuCaps);
-char * qemuBuildSoundDevStr(virDomainDefPtr domainDef,
- virDomainSoundDefPtr sound,
- virQEMUCapsPtr qemuCaps);
+char *qemuBuildSoundDevStr(virDomainDefPtr domainDef,
+ virDomainSoundDefPtr sound,
+ virQEMUCapsPtr qemuCaps);
/* Legacy, pre device support */
-char * qemuBuildPCIHostdevPCIDevStr(virDomainHostdevDefPtr dev,
- virQEMUCapsPtr qemuCaps);
+char *qemuBuildPCIHostdevPCIDevStr(virDomainHostdevDefPtr dev,
+ virQEMUCapsPtr qemuCaps);
/* Current, best practice */
-char * qemuBuildPCIHostdevDevStr(virDomainDefPtr def,
- virDomainHostdevDefPtr dev,
- const char *configfd,
- virQEMUCapsPtr qemuCaps);
+char *qemuBuildPCIHostdevDevStr(virDomainDefPtr def,
+ virDomainHostdevDefPtr dev,
+ const char *configfd,
+ virQEMUCapsPtr qemuCaps);
int qemuOpenPCIConfig(virDomainHostdevDefPtr dev);
/* Legacy, pre device support */
-char * qemuBuildUSBHostdevUSBDevStr(virDomainHostdevDefPtr dev);
+char *qemuBuildUSBHostdevUSBDevStr(virDomainHostdevDefPtr dev);
/* Current, best practice */
-char * qemuBuildUSBHostdevDevStr(virDomainDefPtr def,
+char *qemuBuildUSBHostdevDevStr(virDomainDefPtr def,
+ virDomainHostdevDefPtr dev,
+ virQEMUCapsPtr qemuCaps);
+
+char *qemuBuildSCSIHostdevDrvStr(virConnectPtr conn,
+ virDomainHostdevDefPtr dev,
+ virQEMUCapsPtr qemuCaps,
+ qemuBuildCommandLineCallbacksPtr callbacks)
+ ATTRIBUTE_NONNULL(4);
+char *qemuBuildSCSIHostdevDevStr(virDomainDefPtr def,
virDomainHostdevDefPtr dev,
virQEMUCapsPtr qemuCaps);
-char * qemuBuildSCSIHostdevDrvStr(virConnectPtr conn,
- virDomainHostdevDefPtr dev,
- virQEMUCapsPtr qemuCaps,
- qemuBuildCommandLineCallbacksPtr callbacks)
- ATTRIBUTE_NONNULL(4);
-char * qemuBuildSCSIHostdevDevStr(virDomainDefPtr def,
- virDomainHostdevDefPtr dev,
- virQEMUCapsPtr qemuCaps);
-
-char * qemuBuildHubDevStr(virDomainDefPtr def,
- virDomainHubDefPtr dev,
- virQEMUCapsPtr qemuCaps);
-char * qemuBuildRedirdevDevStr(virDomainDefPtr def,
- virDomainRedirdevDefPtr dev,
- virQEMUCapsPtr qemuCaps);
+char *qemuBuildHubDevStr(virDomainDefPtr def,
+ virDomainHubDefPtr dev,
+ virQEMUCapsPtr qemuCaps);
+char *qemuBuildRedirdevDevStr(virDomainDefPtr def,
+ virDomainRedirdevDefPtr dev,
+ virQEMUCapsPtr qemuCaps);
int qemuNetworkIfaceConnect(virDomainDefPtr def,
virConnectPtr conn,
virQEMUDriverPtr driver,
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 78b08e5..1ee5175 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -284,7 +284,7 @@ bool qemuSharedDeviceEntryDomainExists(qemuSharedDeviceEntryPtr entry,
int *index)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-char * qemuGetSharedDeviceKey(const char *disk_path)
+char *qemuGetSharedDeviceKey(const char *disk_path)
ATTRIBUTE_NONNULL(1);
void qemuSharedDeviceEntryFree(void *payload, const void *name)
--
1.9.3
10 years, 4 months
[libvirt] [PATCH] bhyve: cdrom support
by Roman Bogorodskiy
Add support for CDROM devices for bhyve driver using
bhyve(8)'s 'ahci-cd' device type.
As bhyve currently does not support media insertion at runtime,
disallow to start a domain with an empty source path for cdrom
devices.
---
src/bhyve/bhyve_command.c | 43 +++++++++++++++++-----
.../bhyvexml2argv-disk-cdrom.args | 3 ++
.../bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.xml | 22 +++++++++++
tests/bhyvexml2argvtest.c | 1 +
4 files changed, 59 insertions(+), 10 deletions(-)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.xml
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index f1862fe..7862bc8 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -152,13 +152,31 @@ bhyveBuildDiskArgStr(const virDomainDef *def ATTRIBUTE_UNUSED,
virCommandPtr cmd)
{
const char *bus_type;
+ const char *disk_source;
switch (disk->bus) {
case VIR_DOMAIN_DISK_BUS_SATA:
- bus_type = "ahci-hd";
+ switch (disk->device) {
+ case VIR_DOMAIN_DISK_DEVICE_DISK:
+ bus_type = "ahci-hd";
+ break;
+ case VIR_DOMAIN_DISK_DEVICE_CDROM:
+ bus_type = "ahci-cd";
+ break;
+ default:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("unsupported disk device"));
+ return -1;
+ }
break;
case VIR_DOMAIN_DISK_BUS_VIRTIO:
- bus_type = "virtio-blk";
+ if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
+ bus_type = "virtio-blk";
+ } else {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("unsupported disk device"));
+ return -1;
+ }
break;
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -166,22 +184,26 @@ bhyveBuildDiskArgStr(const virDomainDef *def ATTRIBUTE_UNUSED,
return -1;
}
- if (disk->device != VIR_DOMAIN_DISK_DEVICE_DISK) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("unsupported disk device"));
- return -1;
- }
-
if (virDomainDiskGetType(disk) != VIR_STORAGE_TYPE_FILE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("unsupported disk type"));
return -1;
}
+ disk_source = virDomainDiskGetSource(disk);
+
+ if ((disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) &&
+ (disk_source == NULL)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("cdrom device without source path "
+ "not supported"));
+ return -1;
+ }
+
virCommandAddArg(cmd, "-s");
virCommandAddArgFormat(cmd, "%d:0,%s,%s",
disk->info.addr.pci.slot, bus_type,
- virDomainDiskGetSource(disk));
+ disk_source);
return 0;
}
@@ -282,7 +304,8 @@ virBhyveProcessBuildLoadCmd(bhyveConnPtr driver ATTRIBUTE_UNUSED,
disk = def->disks[0];
- if (disk->device != VIR_DOMAIN_DISK_DEVICE_DISK) {
+ if ((disk->device != VIR_DOMAIN_DISK_DEVICE_DISK) &&
+ (disk->device != VIR_DOMAIN_DISK_DEVICE_CDROM)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("unsupported disk device"));
return NULL;
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args
new file mode 100644
index 0000000..eb38969
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args
@@ -0,0 +1,3 @@
+/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
+-s 2:0,ahci-cd,/tmp/cdrom.iso bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.xml
new file mode 100644
index 0000000..d70219c
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.xml
@@ -0,0 +1,22 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <disk type='file' device='cdrom'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/cdrom.iso'/>
+ <target dev='hdc' bus='sata'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <interface type='bridge'>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
index f6f2bc4..408c73a 100644
--- a/tests/bhyvexml2argvtest.c
+++ b/tests/bhyvexml2argvtest.c
@@ -104,6 +104,7 @@ mymain(void)
DO_TEST("base");
DO_TEST("acpiapic");
+ DO_TEST("disk-cdrom");
DO_TEST("disk-virtio");
DO_TEST("macaddr");
DO_TEST("serial");
--
1.9.0
10 years, 4 months
[libvirt] [PATCH] remove range checking for blkiotune weight
by Martin Kletzander
This was changed before:
https://www.redhat.com/archives/libvir-list/2013-October/msg00525.html
but not everywhere in the code.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1100769
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/lxc/lxc_driver.c | 14 --------------
src/qemu/qemu_driver.c | 14 --------------
tools/virsh-domain.c | 2 +-
tools/virsh.pod | 5 +----
4 files changed, 2 insertions(+), 33 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index ecd9053..9e12ecc 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -2559,13 +2559,6 @@ lxcDomainSetBlkioParameters(virDomainPtr dom,
virTypedParameterPtr param = ¶ms[i];
if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
- if (params[i].value.ui > 1000 || params[i].value.ui < 100) {
- virReportError(VIR_ERR_INVALID_ARG, "%s",
- _("out of blkio weight range."));
- ret = -1;
- continue;
- }
-
if (virCgroupSetBlkioWeight(priv->cgroup, params[i].value.ui) < 0)
ret = -1;
} else if (STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) ||
@@ -2660,13 +2653,6 @@ lxcDomainSetBlkioParameters(virDomainPtr dom,
virTypedParameterPtr param = ¶ms[i];
if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
- if (params[i].value.ui > 1000 || params[i].value.ui < 100) {
- virReportError(VIR_ERR_INVALID_ARG, "%s",
- _("out of blkio weight range."));
- ret = -1;
- continue;
- }
-
persistentDef->blkio.weight = params[i].value.ui;
} else if (STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) ||
STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS) ||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 06d3f53..be622af 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7819,13 +7819,6 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
virTypedParameterPtr param = ¶ms[i];
if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
- if (params[i].value.ui > 1000 || params[i].value.ui < 100) {
- virReportError(VIR_ERR_INVALID_ARG, "%s",
- _("out of blkio weight range."));
- ret = -1;
- continue;
- }
-
if (virCgroupSetBlkioWeight(priv->cgroup, params[i].value.ui) < 0)
ret = -1;
} else if (STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) ||
@@ -7920,13 +7913,6 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
virTypedParameterPtr param = ¶ms[i];
if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
- if (params[i].value.ui > 1000 || params[i].value.ui < 100) {
- virReportError(VIR_ERR_INVALID_ARG, "%s",
- _("out of blkio weight range."));
- ret = -1;
- continue;
- }
-
persistentDef->blkio.weight = params[i].value.ui;
} else if (STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) ||
STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS) ||
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 6fcfd9c..ad68aab 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -1255,7 +1255,7 @@ static const vshCmdOptDef opts_blkiotune[] = {
},
{.name = "weight",
.type = VSH_OT_INT,
- .help = N_("IO Weight in range [100, 1000]")
+ .help = N_("IO Weight")
},
{.name = "device-weights",
.type = VSH_OT_STRING,
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 849ae31..f387ab7 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1824,13 +1824,10 @@ Specifying -1 as a value for these limits is interpreted as unlimited.
[[I<--config>] [I<--live>] | [I<--current>]]
Display or set the blkio parameters. QEMU/KVM supports I<--weight>.
-I<--weight> is in range [100, 1000]. After kernel 2.6.39, the value
-could be in the range [10, 1000].
B<device-weights> is a single string listing one or more device/weight
pairs, in the format of /path/to/device,weight,/path/to/device,weight.
-Each weight is in the range [100, 1000], [10, 1000] after kernel 2.6.39,
-or the value 0 to remove that device from per-device listings.
+Specifying 0 for any weight removes that device from per-device listings.
Only the devices listed in the string are modified;
any existing per-device weights for other devices remain unchanged.
--
2.0.2
10 years, 4 months
[libvirt] [PATCH] qemuConnectGetDomainCapabilities: Report error on unknown arch
by Michal Privoznik
If user hasn't provided any @emulatorbin, the qemuCaps are
searched by @arch provided (which in fact can be guessed from the
host). However, there's no guarantee that the qemu binary for
@arch will exist. Therefore qemu capabilities may be nonexistent
too. If that's the case, we should throw an error message prior
jumping onto 'cleanup' label as the helper lookup function
remains silent on no search result.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Notes:
This would qualify to be pushed under trivial rule, but maybe
somebody has a better idea for the error message (or its code).
src/qemu/qemu_driver.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 06d3f53..8e01965 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16990,8 +16990,12 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn,
}
} else {
if (!(qemuCaps = virQEMUCapsCacheLookupByArch(driver->qemuCapsCache,
- arch)))
+ arch))) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("unable to find any emulator to serve '%s' "
+ "architecture"), virArchToString(arch));
goto cleanup;
+ }
emulatorbin = virQEMUCapsGetBinary(qemuCaps);
}
--
1.8.5.5
10 years, 4 months