[libvirt] [PATCH 0/3] Yet a couple of network cleanups
by Michal Privoznik
I've noticed these while testing the code.
Michal Privoznik (3):
networkStateInitialize: Don't lock network driver
objecteventtest: Check for virNetwork* return values
network_conf: Drop virNetworkObjIsDuplicate
src/conf/network_conf.c | 171 ++++++++++++++++++--------------------
src/conf/network_conf.h | 10 +--
src/libvirt_private.syms | 1 -
src/network/bridge_driver.c | 20 ++---
src/parallels/parallels_network.c | 4 +-
src/test/test_driver.c | 10 ++-
tests/objecteventtest.c | 29 ++++---
7 files changed, 117 insertions(+), 128 deletions(-)
--
2.0.5
9 years, 8 months
[libvirt] [libvirt-designer][PATCH] Changes for code consistency
by Jayashree Deshpande
---
libvirt-designer/libvirt-designer-domain.c | 194 ++++++++++++++++-----------
libvirt-designer/libvirt-designer-domain.h | 41 ++++--
libvirt-designer/libvirt-designer-internal.c | 3 +-
libvirt-designer/libvirt-designer-internal.h | 4 +-
libvirt-designer/libvirt-designer-main.c | 21 +--
libvirt-designer/libvirt-designer-main.h | 7 +-
6 files changed, 168 insertions(+), 102 deletions(-)
diff --git a/libvirt-designer/libvirt-designer-domain.c b/libvirt-designer/libvirt-designer-domain.c
index cefefea..adca733 100644
--- a/libvirt-designer/libvirt-designer-domain.c
+++ b/libvirt-designer/libvirt-designer-domain.c
@@ -66,7 +66,8 @@ gvir_designer_domain_error_quark(void)
return g_quark_from_static_string("gvir-designer-domain");
}
-static gboolean error_is_set(GError **error)
+static gboolean
+error_is_set(GError **error)
{
return ((error != NULL) && (*error != NULL));
}
@@ -84,10 +85,11 @@ enum {
PROP_OSINFO_DB,
};
-static void gvir_designer_domain_get_property(GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+static void
+gvir_designer_domain_get_property(GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
g_return_if_fail(GVIR_DESIGNER_IS_DOMAIN(object));
@@ -121,10 +123,11 @@ static void gvir_designer_domain_get_property(GObject *object,
}
-static void gvir_designer_domain_set_property(GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+static void
+gvir_designer_domain_set_property(GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
g_return_if_fail(GVIR_DESIGNER_IS_DOMAIN(object));
@@ -161,7 +164,8 @@ static void gvir_designer_domain_set_property(GObject *object,
}
-static void gvir_designer_domain_finalize(GObject *object)
+static void
+gvir_designer_domain_finalize(GObject *object)
{
GVirDesignerDomain *conn = GVIR_DESIGNER_DOMAIN(object);
GVirDesignerDomainPrivate *priv = conn->priv;
@@ -181,7 +185,8 @@ static void gvir_designer_domain_finalize(GObject *object)
}
-static void gvir_designer_domain_class_init(GVirDesignerDomainClass *klass)
+static void
+gvir_designer_domain_class_init(GVirDesignerDomainClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
@@ -319,7 +324,8 @@ end:
static GList *
-gvir_designer_domain_get_device_by_type(GVirDesignerDomain *design, GType type)
+gvir_designer_domain_get_device_by_type(GVirDesignerDomain *design,
+ GType type)
{
GList *devices;
GList *it;
@@ -341,7 +347,8 @@ gvir_designer_domain_get_device_by_type(GVirDesignerDomain *design, GType type)
}
-static void gvir_designer_domain_add_clock(GVirDesignerDomain *design)
+static void
+gvir_designer_domain_add_clock(GVirDesignerDomain *design)
{
GVirConfigDomainClock *clock;
GVirConfigDomainTimer *timer;
@@ -441,8 +448,9 @@ gvir_designer_domain_supports_spice_channel(GVirDesignerDomain *design)
}
-static gboolean gvir_designer_domain_add_spice_channel(GVirDesignerDomain *design,
- GError **error)
+static gboolean
+gvir_designer_domain_add_spice_channel(GVirDesignerDomain *design,
+ GError **error)
{
GVirConfigDomainChannel *channel;
GVirConfigDomainChardevSourceSpiceVmc *vmc;
@@ -674,7 +682,8 @@ gvir_designer_domain_add_usb_controllers(GVirDesignerDomain *design)
* Returns: (transfer full): the pointer to the new USB redir channel
*/
GVirConfigDomainRedirdev *
-gvir_designer_domain_add_usb_redir(GVirDesignerDomain *design, GError **error)
+gvir_designer_domain_add_usb_redir(GVirDesignerDomain *design,
+ GError **error)
{
/* FIXME: check if OS/hypervisor support USB
* check if SPICE is being used
@@ -717,7 +726,8 @@ gvir_designer_domain_add_usb_redir(GVirDesignerDomain *design, GError **error)
* Returns: (transfer full): the pointer to the new smartcard device
*/
GVirConfigDomainSmartcard *
-gvir_designer_domain_add_smartcard(GVirDesignerDomain *design, GError **error)
+gvir_designer_domain_add_smartcard(GVirDesignerDomain *design,
+ GError **error)
{
/* FIXME: check if OS/hypervisor support smartcard, might need
* libosinfo improvements
@@ -742,7 +752,8 @@ gvir_designer_domain_add_smartcard(GVirDesignerDomain *design, GError **error)
}
-static void gvir_designer_domain_add_power_management(GVirDesignerDomain *design)
+static void
+gvir_designer_domain_add_power_management(GVirDesignerDomain *design)
{
GVirConfigDomainPowerManagement *pm;
@@ -754,7 +765,8 @@ static void gvir_designer_domain_add_power_management(GVirDesignerDomain *design
g_object_unref(G_OBJECT(pm));
}
-static void gvir_designer_domain_set_lifecycle(GVirDesignerDomain *design)
+static void
+gvir_designer_domain_set_lifecycle(GVirDesignerDomain *design)
{
gvir_config_domain_set_lifecycle(design->priv->config,
GVIR_CONFIG_DOMAIN_LIFECYCLE_ON_POWEROFF,
@@ -767,7 +779,8 @@ static void gvir_designer_domain_set_lifecycle(GVirDesignerDomain *design)
GVIR_CONFIG_DOMAIN_LIFECYCLE_DESTROY);
}
-static void gvir_designer_domain_add_console(GVirDesignerDomain *design)
+static void
+gvir_designer_domain_add_console(GVirDesignerDomain *design)
{
GVirConfigDomainConsole *console;
GVirConfigDomainChardevSourcePty *pty;
@@ -784,7 +797,8 @@ static void gvir_designer_domain_add_console(GVirDesignerDomain *design)
}
-static void gvir_designer_domain_add_input(GVirDesignerDomain *design)
+static void
+gvir_designer_domain_add_input(GVirDesignerDomain *design)
{
GVirConfigDomainInput *input;
@@ -798,7 +812,8 @@ static void gvir_designer_domain_add_input(GVirDesignerDomain *design)
}
-static void gvir_designer_domain_init(GVirDesignerDomain *design)
+static void
+gvir_designer_domain_init(GVirDesignerDomain *design)
{
GVirDesignerDomainPrivate *priv;
g_debug("Init GVirDesignerDomain=%p", design);
@@ -809,10 +824,11 @@ static void gvir_designer_domain_init(GVirDesignerDomain *design)
}
-GVirDesignerDomain *gvir_designer_domain_new(OsinfoDb *db,
- OsinfoOs *os,
- OsinfoPlatform *platform,
- GVirConfigCapabilities *caps)
+GVirDesignerDomain *
+gvir_designer_domain_new(OsinfoDb *db,
+ OsinfoOs *os,
+ OsinfoPlatform *platform,
+ GVirConfigCapabilities *caps)
{
return GVIR_DESIGNER_DOMAIN(g_object_new(GVIR_DESIGNER_TYPE_DOMAIN,
"osinfo-db", db,
@@ -832,7 +848,8 @@ GVirDesignerDomain *gvir_designer_domain_new(OsinfoDb *db,
*
* Returns: (transfer none): the operating system
*/
-OsinfoOs *gvir_designer_domain_get_os(GVirDesignerDomain *design)
+OsinfoOs *
+gvir_designer_domain_get_os(GVirDesignerDomain *design)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), NULL);
@@ -850,7 +867,8 @@ OsinfoOs *gvir_designer_domain_get_os(GVirDesignerDomain *design)
*
* Returns: (transfer none): the virtualization platform
*/
-OsinfoPlatform *gvir_designer_domain_get_platform(GVirDesignerDomain *design)
+OsinfoPlatform *
+gvir_designer_domain_get_platform(GVirDesignerDomain *design)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), NULL);
@@ -868,7 +886,8 @@ OsinfoPlatform *gvir_designer_domain_get_platform(GVirDesignerDomain *design)
*
* Returns: (transfer none): the capabilities
*/
-GVirConfigCapabilities *gvir_designer_domain_get_capabilities(GVirDesignerDomain *design)
+GVirConfigCapabilities *
+gvir_designer_domain_get_capabilities(GVirDesignerDomain *design)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), NULL);
@@ -887,7 +906,8 @@ GVirConfigCapabilities *gvir_designer_domain_get_capabilities(GVirDesignerDomain
*
* Returns: (transfer none): the domain config
*/
-GVirConfigDomain *gvir_designer_domain_get_config(GVirDesignerDomain *design)
+GVirConfigDomain *
+gvir_designer_domain_get_config(GVirDesignerDomain *design)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), NULL);
@@ -1015,7 +1035,8 @@ cleanup:
}
-gboolean gvir_designer_domain_supports_machine(GVirDesignerDomain *design)
+gboolean
+gvir_designer_domain_supports_machine(GVirDesignerDomain *design)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), FALSE);
@@ -1033,9 +1054,10 @@ gboolean gvir_designer_domain_supports_machine(GVirDesignerDomain *design)
}
-gboolean gvir_designer_domain_supports_machine_full(GVirDesignerDomain *design,
- const char *arch,
- GVirConfigDomainOsType ostype)
+gboolean
+gvir_designer_domain_supports_machine_full(GVirDesignerDomain *design,
+ const char *arch,
+ GVirConfigDomainOsType ostype)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), FALSE);
@@ -1050,7 +1072,8 @@ gboolean gvir_designer_domain_supports_machine_full(GVirDesignerDomain *design,
return FALSE;
}
-gboolean gvir_designer_domain_supports_container(GVirDesignerDomain *design)
+gboolean
+gvir_designer_domain_supports_container(GVirDesignerDomain *design)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), FALSE);
@@ -1068,8 +1091,9 @@ gboolean gvir_designer_domain_supports_container(GVirDesignerDomain *design)
return FALSE;
}
-gboolean gvir_designer_domain_supports_container_full(GVirDesignerDomain *design,
- const char *arch)
+gboolean
+gvir_designer_domain_supports_container_full(GVirDesignerDomain *design,
+ const char *arch)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), FALSE);
@@ -1174,8 +1198,9 @@ cleanup:
}
-gboolean gvir_designer_domain_setup_machine(GVirDesignerDomain *design,
- GError **error)
+gboolean
+gvir_designer_domain_setup_machine(GVirDesignerDomain *design,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), FALSE);
@@ -1203,10 +1228,11 @@ cleanup:
}
-gboolean gvir_designer_domain_setup_machine_full(GVirDesignerDomain *design,
- const char *arch,
- GVirConfigDomainOsType ostype,
- GError **error)
+gboolean
+gvir_designer_domain_setup_machine_full(GVirDesignerDomain *design,
+ const char *arch,
+ GVirConfigDomainOsType ostype,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), FALSE);
@@ -1232,8 +1258,9 @@ cleanup:
}
-gboolean gvir_designer_domain_setup_container(GVirDesignerDomain *design,
- GError **error)
+gboolean
+gvir_designer_domain_setup_container(GVirDesignerDomain *design,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), FALSE);
@@ -1262,9 +1289,10 @@ cleanup:
}
-gboolean gvir_designer_domain_setup_container_full(GVirDesignerDomain *design,
- const char *arch,
- GError **error)
+gboolean
+gvir_designer_domain_setup_container_full(GVirDesignerDomain *design,
+ const char *arch,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), FALSE);
@@ -1682,10 +1710,11 @@ error:
* Returns: (transfer full): the pointer to new disk.
* If something fails NULL is returned and @error is set.
*/
-GVirConfigDomainDisk *gvir_designer_domain_add_disk_file(GVirDesignerDomain *design,
- const char *filepath,
- const char *format,
- GError **error)
+GVirConfigDomainDisk *
+gvir_designer_domain_add_disk_file(GVirDesignerDomain *design,
+ const char *filepath,
+ const char *format,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), NULL);
@@ -1713,9 +1742,10 @@ GVirConfigDomainDisk *gvir_designer_domain_add_disk_file(GVirDesignerDomain *des
* Returns: (transfer full): the pointer to the new disk.
* If something fails NULL is returned and @error is set.
*/
-GVirConfigDomainDisk *gvir_designer_domain_add_disk_device(GVirDesignerDomain *design,
- const char *devpath,
- GError **error)
+GVirConfigDomainDisk *
+gvir_designer_domain_add_disk_device(GVirDesignerDomain *design,
+ const char *devpath,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), NULL);
@@ -1743,10 +1773,11 @@ GVirConfigDomainDisk *gvir_designer_domain_add_disk_device(GVirDesignerDomain *d
* Returns: (transfer full): the pointer to new cdrom.
* If something fails NULL is returned and @error is set.
*/
-GVirConfigDomainDisk *gvir_designer_domain_add_cdrom_file(GVirDesignerDomain *design,
- const char *filepath,
- const char *format,
- GError **error)
+GVirConfigDomainDisk *
+gvir_designer_domain_add_cdrom_file(GVirDesignerDomain *design,
+ const char *filepath,
+ const char *format,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), NULL);
@@ -1774,9 +1805,10 @@ GVirConfigDomainDisk *gvir_designer_domain_add_cdrom_file(GVirDesignerDomain *de
* Returns: (transfer full): the pointer to the new cdrom.
* If something fails NULL is returned and @error is set.
*/
-GVirConfigDomainDisk *gvir_designer_domain_add_cdrom_device(GVirDesignerDomain *design,
- const char *devpath,
- GError **error)
+GVirConfigDomainDisk *
+gvir_designer_domain_add_cdrom_device(GVirDesignerDomain *design,
+ const char *devpath,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), NULL);
@@ -1805,10 +1837,11 @@ GVirConfigDomainDisk *gvir_designer_domain_add_cdrom_device(GVirDesignerDomain *
* Returns: (transfer full): the pointer to new floppy.
* If something fails NULL is returned and @error is set.
*/
-GVirConfigDomainDisk *gvir_designer_domain_add_floppy_file(GVirDesignerDomain *design,
- const char *filepath,
- const char *format,
- GError **error)
+GVirConfigDomainDisk *
+gvir_designer_domain_add_floppy_file(GVirDesignerDomain *design,
+ const char *filepath,
+ const char *format,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), NULL);
@@ -1836,9 +1869,10 @@ GVirConfigDomainDisk *gvir_designer_domain_add_floppy_file(GVirDesignerDomain *d
* Returns: (transfer full): the pointer to the new floppy.
* If something fails NULL is returned and @error is set.
*/
-GVirConfigDomainDisk *gvir_designer_domain_add_floppy_device(GVirDesignerDomain *design,
- const char *devpath,
- GError **error)
+GVirConfigDomainDisk *
+gvir_designer_domain_add_floppy_device(GVirDesignerDomain *design,
+ const char *devpath,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), NULL);
@@ -2146,7 +2180,8 @@ end:
* Returns: (transfer full): the pointer to the new video device.
*/
GVirConfigDomainVideo *
-gvir_designer_domain_add_video(GVirDesignerDomain *design, GError **error)
+gvir_designer_domain_add_video(GVirDesignerDomain *design,
+ GError **error)
{
GVirConfigDomainVideo *video;
const gchar *model_str = NULL;
@@ -2221,9 +2256,10 @@ gvir_designer_domain_get_resources(OsinfoResourcesList *res_list,
*
* Returns: (transfer none): TRUE when successfully set, FALSE otherwise.
*/
-gboolean gvir_designer_domain_setup_resources(GVirDesignerDomain *design,
- GVirDesignerDomainResources req,
- GError **error)
+gboolean
+gvir_designer_domain_setup_resources(GVirDesignerDomain *design,
+ GVirDesignerDomainResources req,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), FALSE);
gboolean ret = FALSE;
@@ -2285,9 +2321,10 @@ cleanup:
*
* Returns: (transfer none): TRUE when successfully set, FALSE otherwise.
*/
-gboolean gvir_designer_domain_add_driver(GVirDesignerDomain *design,
- const char *driver_id,
- GError **error)
+gboolean
+gvir_designer_domain_add_driver(GVirDesignerDomain *design,
+ const char *driver_id,
+ GError **error)
{
OsinfoEntity *driver;
OsinfoDeviceDriverList *drivers;
@@ -2330,8 +2367,9 @@ end:
* Returns: (transfer none): TRUE when successfully set, FALSE otherwise.
* @see_also gvir_designer_domain_add_driver()
*/
-gboolean gvir_designer_domain_remove_all_drivers(GVirDesignerDomain *design,
- GError **error)
+gboolean
+gvir_designer_domain_remove_all_drivers(GVirDesignerDomain *design,
+ GError **error)
{
g_return_val_if_fail(GVIR_DESIGNER_IS_DOMAIN(design), FALSE);
g_return_val_if_fail(!error_is_set(error), FALSE);
diff --git a/libvirt-designer/libvirt-designer-domain.h b/libvirt-designer/libvirt-designer-domain.h
index 41aae66..e645f92 100644
--- a/libvirt-designer/libvirt-designer-domain.h
+++ b/libvirt-designer/libvirt-designer-domain.h
@@ -79,22 +79,27 @@ GVirDesignerDomain *gvir_designer_domain_new(OsinfoDb *osinfo_db,
GVirConfigCapabilities *caps);
OsinfoOs *gvir_designer_domain_get_os(GVirDesignerDomain *design);
+
OsinfoPlatform *gvir_designer_domain_get_platform(GVirDesignerDomain *design);
+
GVirConfigCapabilities *gvir_designer_domain_get_capabilities(GVirDesignerDomain *design);
-GVirConfigDomain *gvir_designer_domain_get_config(GVirDesignerDomain *design);
+GVirConfigDomain *gvir_designer_domain_get_config(GVirDesignerDomain *design);
gboolean gvir_designer_domain_supports_machine(GVirDesignerDomain *design);
+
gboolean gvir_designer_domain_supports_machine_full(GVirDesignerDomain *design,
const char *arch,
GVirConfigDomainOsType ostype);
+
gboolean gvir_designer_domain_supports_container(GVirDesignerDomain *design);
+
gboolean gvir_designer_domain_supports_container_full(GVirDesignerDomain *design,
const char *arch);
-
gboolean gvir_designer_domain_setup_machine(GVirDesignerDomain *design,
GError **error);
+
gboolean gvir_designer_domain_setup_machine_full(GVirDesignerDomain *design,
const char *arch,
GVirConfigDomainOsType ostype,
@@ -102,28 +107,34 @@ gboolean gvir_designer_domain_setup_machine_full(GVirDesignerDomain *design,
gboolean gvir_designer_domain_setup_container(GVirDesignerDomain *design,
GError **error);
+
gboolean gvir_designer_domain_setup_container_full(GVirDesignerDomain *design,
const char *arch,
GError **error);
GVirConfigDomainDisk *gvir_designer_domain_add_cdrom_file(GVirDesignerDomain *design,
- const char *filepath,
- const char *format,
- GError **error);
+ const char *filepath,
+ const char *format,
+ GError **error);
+
GVirConfigDomainDisk *gvir_designer_domain_add_cdrom_device(GVirDesignerDomain *design,
- const char *devpath,
- GError **error);
+ const char *devpath,
+ GError **error);
+
GVirConfigDomainDisk *gvir_designer_domain_add_disk_file(GVirDesignerDomain *design,
const char *filepath,
const char *format,
GError **error);
+
GVirConfigDomainDisk *gvir_designer_domain_add_disk_device(GVirDesignerDomain *design,
const char *devpath,
GError **error);
+
GVirConfigDomainDisk *gvir_designer_domain_add_floppy_file(GVirDesignerDomain *design,
const char *filepath,
const char *format,
GError **error);
+
GVirConfigDomainDisk *gvir_designer_domain_add_floppy_device(GVirDesignerDomain *design,
const char *devpath,
GError **error);
@@ -131,18 +142,27 @@ GVirConfigDomainDisk *gvir_designer_domain_add_floppy_device(GVirDesignerDomain
GVirConfigDomainInterface *gvir_designer_domain_add_interface_bridge(GVirDesignerDomain *design,
const char *bridge,
GError **error);
+
GVirConfigDomainInterface *gvir_designer_domain_add_interface_network(GVirDesignerDomain *design,
const char *network,
GError **error);
+
GVirConfigDomainInterface *gvir_designer_domain_add_interface_user(GVirDesignerDomain *design,
GError **error);
GVirConfigDomainGraphics *gvir_designer_domain_add_graphics(GVirDesignerDomain *design,
GVirDesignerDomainGraphics type,
GError **error);
-GVirConfigDomainSmartcard *gvir_designer_domain_add_smartcard(GVirDesignerDomain *design, GError **error);
-GVirConfigDomainSound *gvir_designer_domain_add_sound(GVirDesignerDomain *design, GError **error);
-GVirConfigDomainRedirdev *gvir_designer_domain_add_usb_redir(GVirDesignerDomain *design, GError **error);
+
+GVirConfigDomainSmartcard *gvir_designer_domain_add_smartcard(GVirDesignerDomain *design,
+ GError **error);
+
+GVirConfigDomainSound *gvir_designer_domain_add_sound(GVirDesignerDomain *design,
+ GError **error);
+
+GVirConfigDomainRedirdev *gvir_designer_domain_add_usb_redir(GVirDesignerDomain *design,
+ GError **error);
+
GVirConfigDomainVideo *gvir_designer_domain_add_video(GVirDesignerDomain *design,
GError **error);
@@ -152,6 +172,7 @@ gboolean gvir_designer_domain_setup_resources(GVirDesignerDomain *design,
gboolean gvir_designer_domain_remove_all_drivers(GVirDesignerDomain *design,
GError **error);
+
gboolean gvir_designer_domain_add_driver(GVirDesignerDomain *design,
const char *driver_id,
GError **error);
diff --git a/libvirt-designer/libvirt-designer-internal.c b/libvirt-designer/libvirt-designer-internal.c
index bdfa5d1..89e8d1e 100644
--- a/libvirt-designer/libvirt-designer-internal.c
+++ b/libvirt-designer/libvirt-designer-internal.c
@@ -26,7 +26,8 @@
#include "libvirt-designer/libvirt-designer-internal.h"
G_GNUC_INTERNAL int
-gvir_designer_genum_get_value(GType enum_type, const char *nick,
+gvir_designer_genum_get_value(GType enum_type,
+ const char *nick,
gint default_value)
{
GEnumClass *enum_class;
diff --git a/libvirt-designer/libvirt-designer-internal.h b/libvirt-designer/libvirt-designer-internal.h
index fd3db2c..92c27a6 100644
--- a/libvirt-designer/libvirt-designer-internal.h
+++ b/libvirt-designer/libvirt-designer-internal.h
@@ -24,6 +24,8 @@
#ifndef __LIBVIRT_DESIGNER_INTERNAL_H__
#define __LIBVIRT_DESIGNER_INTERNAL_H__
-int gvir_designer_genum_get_value(GType enum_type, const char *nick, gint default_value);
+int gvir_designer_genum_get_value(GType enum_type,
+ const char *nick,
+ gint default_value);
#endif /* __LIBVIRT_DESIGNER_INTERNAL_H__ */
diff --git a/libvirt-designer/libvirt-designer-main.c b/libvirt-designer/libvirt-designer-main.c
index 07de8c1..0ef1bab 100644
--- a/libvirt-designer/libvirt-designer-main.c
+++ b/libvirt-designer/libvirt-designer-main.c
@@ -37,8 +37,9 @@
* <parameter>argv</parameter> parameter of main(), or %NULL. Any options
* understood by GTK+ are stripped before return.
*/
-void gvir_designer_init(int *argc,
- char ***argv)
+void
+gvir_designer_init(int *argc,
+ char ***argv)
{
GError *err = NULL;
if (!gvir_designer_init_check(argc, argv, &err)) {
@@ -47,10 +48,11 @@ void gvir_designer_init(int *argc,
}
}
-static void gvir_log_handler(const gchar *log_domain G_GNUC_UNUSED,
- GLogLevelFlags log_level G_GNUC_UNUSED,
- const gchar *message,
- gpointer user_data)
+static void
+gvir_log_handler(const gchar *log_domain G_GNUC_UNUSED,
+ GLogLevelFlags log_level G_GNUC_UNUSED,
+ const gchar *message,
+ gpointer user_data)
{
if (user_data)
fprintf(stderr, "%s\n", message);
@@ -64,9 +66,10 @@ static void gvir_log_handler(const gchar *log_domain G_GNUC_UNUSED,
* understood by GTK+ are stripped before return.
* @err: pointer to a #GError to which a message will be posted on error
*/
-gboolean gvir_designer_init_check(int *argc,
- char ***argv,
- GError **err)
+gboolean
+gvir_designer_init_check(int *argc,
+ char ***argv,
+ GError **err)
{
if (!gvir_config_init_check(argc, argv, err))
return FALSE;
diff --git a/libvirt-designer/libvirt-designer-main.h b/libvirt-designer/libvirt-designer-main.h
index 9341754..3e904bc 100644
--- a/libvirt-designer/libvirt-designer-main.h
+++ b/libvirt-designer/libvirt-designer-main.h
@@ -32,10 +32,11 @@
G_BEGIN_DECLS
void gvir_designer_init(int *argc,
- char ***argv);
+ char ***argv);
+
gboolean gvir_designer_init_check(int *argc,
- char ***argv,
- GError **err);
+ char ***argv,
+ GError **err);
G_END_DECLS
--
1.9.1
9 years, 8 months
[libvirt] [PATCH] LXC: make sure netns been enabled when trying to enable userns
by Chen Hanxiao
This patch revert commit:
7dc5dbc879bd0779924b5132a48b731a0bc04a1e
Discussed at:
http://www.redhat.com/archives/libvir-list/2015-March/msg01023.html
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
src/lxc/lxc_container.c | 45 ++++++++++++++++-----------------------------
1 file changed, 16 insertions(+), 29 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index cc20b6d..69a8f2f 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -934,8 +934,6 @@ static int lxcContainerMountBasicFS(bool userns_enabled,
{
size_t i;
int rc = -1;
- char* mnt_src = NULL;
- int mnt_mflags;
VIR_DEBUG("Mounting basic filesystems");
@@ -944,22 +942,17 @@ static int lxcContainerMountBasicFS(bool userns_enabled,
virLXCBasicMountInfo const *mnt = &lxcBasicMounts[i];
/* When enable userns but disable netns, kernel will
- * forbid us doing a new fresh mount for sysfs.
- * So we had to do a bind mount for sysfs instead.
+ * forbid us doing a new fresh mount for sysfs for security reason.
+ * So we should not allow this.
*/
- if (userns_enabled && netns_disabled &&
- STREQ(mnt->src, "sysfs")) {
- if (VIR_STRDUP(mnt_src, "/sys") < 0)
- goto cleanup;
- mnt_mflags = MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY|MS_BIND;
- } else {
- if (VIR_STRDUP(mnt_src, mnt->src) < 0)
- goto cleanup;
- mnt_mflags = mnt->mflags;
+ if (userns_enabled && netns_disabled) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Userns could not be enabled without netns"));
+ goto cleanup;
}
VIR_DEBUG("Processing %s -> %s",
- mnt_src, mnt->dst);
+ mnt->src, mnt->dst);
if (mnt->skipUnmounted) {
char *hostdir;
@@ -976,28 +969,24 @@ static int lxcContainerMountBasicFS(bool userns_enabled,
if (ret == 0) {
VIR_DEBUG("Skipping '%s' which isn't mounted in host",
mnt->dst);
- VIR_FREE(mnt_src);
continue;
}
}
if (mnt->skipUserNS && userns_enabled) {
VIR_DEBUG("Skipping due to user ns enablement");
- VIR_FREE(mnt_src);
continue;
}
/* Skip mounts with missing source without shouting: it may be a
* missing folder in /proc due to the absence of a kernel feature */
- if (STRPREFIX(mnt_src, "/") && !virFileExists(mnt_src)) {
- VIR_DEBUG("Skipping due to missing source: %s", mnt_src);
- VIR_FREE(mnt_src);
+ if (STRPREFIX(mnt->src, "/") && !virFileExists(mnt->src)) {
+ VIR_DEBUG("Skipping due to missing source: %s", mnt->src);
continue;
}
if (mnt->skipNoNetns && netns_disabled) {
VIR_DEBUG("Skipping due to absence of network namespace");
- VIR_FREE(mnt_src);
continue;
}
@@ -1015,35 +1004,33 @@ static int lxcContainerMountBasicFS(bool userns_enabled,
* we mount the filesystem in read-write mode initially, and then do a
* separate read-only bind mount on top of that.
*/
- bindOverReadonly = !!(mnt_mflags & MS_RDONLY);
+ bindOverReadonly = !!(mnt->mflags & MS_RDONLY);
VIR_DEBUG("Mount %s on %s type=%s flags=%x",
- mnt_src, mnt->dst, mnt->type, mnt_mflags & ~MS_RDONLY);
- if (mount(mnt_src, mnt->dst, mnt->type, mnt_mflags & ~MS_RDONLY, NULL) < 0) {
+ mnt->src, mnt->dst, mnt->type, mnt->mflags & ~MS_RDONLY);
+ if (mount(mnt->src, mnt->dst, mnt->type, mnt->mflags & ~MS_RDONLY, NULL) < 0) {
virReportSystemError(errno,
_("Failed to mount %s on %s type %s flags=%x"),
- mnt_src, mnt->dst, NULLSTR(mnt->type),
- mnt_mflags & ~MS_RDONLY);
+ mnt->src, mnt->dst, NULLSTR(mnt->type),
+ mnt->mflags & ~MS_RDONLY);
goto cleanup;
}
if (bindOverReadonly &&
- mount(mnt_src, mnt->dst, NULL,
+ mount(mnt->src, mnt->dst, NULL,
MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) {
virReportSystemError(errno,
_("Failed to re-mount %s on %s flags=%x"),
- mnt_src, mnt->dst,
+ mnt->src, mnt->dst,
MS_BIND|MS_REMOUNT|MS_RDONLY);
goto cleanup;
}
- VIR_FREE(mnt_src);
}
rc = 0;
cleanup:
- VIR_FREE(mnt_src);
VIR_DEBUG("rc=%d", rc);
return rc;
}
--
2.1.0
9 years, 8 months
[libvirt] [PATCH v2] util: don't fail if no PortData is found while getting migrateData
by zhang bo
---
V1 here:
https://www.redhat.com/archives/libvir-list/2015-February/msg00388.html
V2:
Add "--if-exists" option to ovs-vsctl cmd, making ovs-vsctl not raise error if there's no portData
available. Suggested by Martin.
We Tested the patch, it works.
---
Introduced by f6a2f97e
Problem description:
After multiple times of migrating a domain, which has an ovs interface with no portData set,
with non-shared disk, nbd ports got overflowed.
The steps to reproduce the problem:
1 define and start a domain with its network configured as:
<interface type='bridge'>
<source bridge='br0'/>
<virtualport type='openvswitch'>
</virtualport>
<model type='virtio'/>
<driver name='vhost' queues='4'/>
</interface>
2 do not set the network's portData.
3 migrate(ToURI2) it with flag 91(1011011), which means:
VIR_MIGRATE_LIVE
VIR_MIGRATE_PEER2PEER
VIR_MIGRATE_PERSIST_DEST
VIR_MIGRATE_UNDEFINE_SOURCE
VIR_MIGRATE_NON_SHARED_DISK
4 migrate success, but we got an error log in libvirtd.log:
error : virCommandWait:2423 : internal error: Child process (ovs-vsctl --timeout=5 get Interface
vnet1 external_ids:PortData) unexpected exit status 1: ovs-vsctl: no key "PortData" in Interface
record "vnet1" column external_ids
5 migrate it back, migrate it , migrate it back, .......
6 nbd port got overflowed.
The reasons for the problem is :
1 virNetDevOpenvswitchGetMigrateData() takes it as wrong if no portData is available for the ovs
interface of a domain. (We think it's not appropriate, as portData is just OPTIONAL)
2 in func qemuMigrationBakeCookie(), it fails in qemuMigrationCookieAddNetwork(), and returns with -1.
qemuMigrationCookieAddNBD() is not called thereafter, and mig->nbd is still NULL.
3 However, qemuMigrationRun() just *WARN* if qemuMigrationBakeCookie() fails, migration still successes.
cookie is NULL, it's not baked on the src side.
4 On the destination side, it would alloc a port first and then free the nbd port in COOKIE.
But the cookie is NULL due to qemuMigrationCookieAddNetwork() failure at src side. thus the nbd port
is not freed.
In this patch, we add "--if-exists" option to make ovs-vsctl not raise error if there's no portData available.
Further more, because portData may be NULL in the cookie at the dest side, check it before setting portData.
Signed-off-by: Zhou Yimin <zhouyimin(a)huawei.com>
Signed-off-by: Zhang Bo <oscar.zhangbo(a)huawei.com>
---
src/util/virnetdevopenvswitch.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index e5c87bb..722d0dd 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -30,9 +30,12 @@
#include "virerror.h"
#include "virmacaddr.h"
#include "virstring.h"
+#include "virlog.h"
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.netdevopenvswitch");
+
/**
* virNetDevOpenvswitchAddPort:
* @brname: the bridge name
@@ -206,7 +209,7 @@ int virNetDevOpenvswitchGetMigrateData(char **migrate, const char *ifname)
virCommandPtr cmd = NULL;
int ret = -1;
- cmd = virCommandNewArgList(OVSVSCTL, "--timeout=5", "get", "Interface",
+ cmd = virCommandNewArgList(OVSVSCTL, "--timeout=5", "--if-exists", "get", "Interface",
ifname, "external_ids:PortData", NULL);
virCommandSetOutputBuffer(cmd, migrate);
@@ -241,6 +244,12 @@ int virNetDevOpenvswitchSetMigrateData(char *migrate, const char *ifname)
virCommandPtr cmd = NULL;
int ret = -1;
+ if (!migrate) {
+ VIR_DEBUG("No port data for interface %s", ifname);
+ return 0;
+ }
+
cmd = virCommandNewArgList(OVSVSCTL, "--timeout=5", "set",
"Interface", ifname, NULL);
virCommandAddArgFormat(cmd, "external_ids:PortData=%s", migrate);
--
1.7.12.4
9 years, 8 months
[libvirt] [PATCH] qemu: check if domain is really active when do setvcpus with --live
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1204006
Commit e105dc9 fix setting vcpus for offline domain, but forget check
if vm is active when pass VIR_DOMAIN_AFFECT_LIVE flags.
# virsh setvcpus test3 4 --live
error: Failed to create controller cpu for group: No such file or directory
add a check if we pass VIR_DOMAIN_AFFECT_LIVE flags.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/qemu/qemu_driver.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6d9217b..40d2776 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4888,6 +4888,12 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
goto cleanup;
if (flags & VIR_DOMAIN_AFFECT_LIVE && !(flags & VIR_DOMAIN_VCPU_GUEST)) {
+ if (!virDomainObjIsActive(vm)) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain is not running"));
+ goto endjob;
+ }
+
if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp) < 0)
goto endjob;
--
1.8.3.1
9 years, 8 months
[libvirt] [PATCH] tools: fix the wrong check when use virsh setvcpus --maximum
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1204033
We will ignore --maximum option when only use setvcpus with
this option, like this (this error is another issue):
# virsh setvcpus test3 --maximum 10
error: Failed to create controller cpu for group: No such file or directory
this is because we do not set it in flags before we check if there is
a flags set.
Refactor these code and fix the logic.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
tools/virsh-domain.c | 33 ++++++++++++---------------------
1 file changed, 12 insertions(+), 21 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 1d8225c..6ab7b05 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6742,9 +6742,8 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
flags |= VIR_DOMAIN_AFFECT_LIVE;
if (guest)
flags |= VIR_DOMAIN_VCPU_GUEST;
- /* none of the options were specified */
- if (!current && flags == 0)
- flags = -1;
+ if (maximum)
+ flags |= VIR_DOMAIN_VCPU_MAXIMUM;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
@@ -6754,27 +6753,19 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
goto cleanup;
}
- if (flags == -1) {
+ /* none of the options were specified */
+ if (!current && flags == 0) {
if (virDomainSetVcpus(dom, count) != 0)
goto cleanup;
} else {
- /* If the --maximum flag was given, we need to ensure only the
- --config flag is in effect as well */
- if (maximum) {
- vshDebug(ctl, VSH_ERR_DEBUG, "--maximum flag was given\n");
-
- flags |= VIR_DOMAIN_VCPU_MAXIMUM;
-
- /* If neither the --config nor --live flags were given, OR
- if just the --live flag was given, we need to error out
- warning the user that the --maximum flag can only be used
- with the --config flag */
- if (live || !config) {
-
- /* Warn the user about the invalid flag combination */
- vshError(ctl, _("--maximum must be used with --config only"));
- goto cleanup;
- }
+ /* If neither the --config nor --live flags were given, OR
+ if just the --live flag was given, we need to error out
+ warning the user that the --maximum flag can only be used
+ with the --config flag */
+ if (maximum && (live || !config)) {
+ /* Warn the user about the invalid flag combination */
+ vshError(ctl, _("--maximum must be used with --config only"));
+ goto cleanup;
}
/* Apply the virtual cpu changes */
--
1.8.3.1
9 years, 8 months
[libvirt] [libvirt-designer][PATCH 1/2] trivial changes for code consistency
by Jayashree Deshpande
---
libvirt-designer/libvirt-designer-domain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libvirt-designer/libvirt-designer-domain.c b/libvirt-designer/libvirt-designer-domain.c
index cefefea..8703884 100644
--- a/libvirt-designer/libvirt-designer-domain.c
+++ b/libvirt-designer/libvirt-designer-domain.c
@@ -674,7 +674,8 @@ gvir_designer_domain_add_usb_controllers(GVirDesignerDomain *design)
* Returns: (transfer full): the pointer to the new USB redir channel
*/
GVirConfigDomainRedirdev *
-gvir_designer_domain_add_usb_redir(GVirDesignerDomain *design, GError **error)
+gvir_designer_domain_add_usb_redir(GVirDesignerDomain *design,
+ GError **error)
{
/* FIXME: check if OS/hypervisor support USB
* check if SPICE is being used
--
1.9.1
9 years, 8 months
Re: [libvirt] [Qemu-devel] [PATCH RFC for-2.3 1/1] block: New command line option --no-format-probing
by Eric Blake
On 03/20/2015 08:19 AM, Markus Armbruster wrote:
>> If (a working version of) this makes it in 2.3, libvirt WILL use it in
>> the next release. It will take me less than 5 minutes to write up the
>> libvirt patch, as long as the new option is advertised via
>> query-command-line-options (which means that QMP introspection of the
>> new option is a must for v2 :)
The real libvirt requirement is that the new option is accessible via
_some_ QMP command (doesn't have to be query-command-line-options, but
that is the most obvious).
>
> query-command-line-options covers only options using QemuOpts. Fixing
> that defect isn't in the cards for 2.3, which means I'll have to
> implement it with QemuOpts.
Makes sense, and is certainly easier than figuring out an alternative
QMP probing mechanism.
>
> Ways to do that:
>
> * Stick it into an existing QemuOpts option. Is there one that fits?
> --machine doesn't really fit.
Mostly agree; --machine is more for what the guest sees, while this has
no impact on the guest ABI. On the other hand, things like -machine
accel=[tcg|kvm] aren't necessarily guest visible either, so -machine has
tended to be a catch-all for other things. But that doesn't mean it
should continue to be one.
>
> * Create a new QemuOpts option for miscellaneous settings. Would --misc
> format-probing=off be too ugly? Got a better name than --misc?
The only clients using the new option will be machine generated, so I
don't think ugly appearance is a show-stopper. And -misc really does
sound like it is the most amenable to adding other random flags in the
future, so I can live with that name.
Unless anyone else has a better idea, '-misc format-probing=off' has my
vote and works for libvirt; it is only a two-line change to my libvirt
RFC patch:
diff --git i/src/qemu/qemu_capabilities.c w/src/qemu/qemu_capabilities.c
index b452a75..f7a46c1 100644
--- i/src/qemu/qemu_capabilities.c
+++ w/src/qemu/qemu_capabilities.c
@@ -2517,7 +2517,7 @@ static struct virQEMUCapsCommandLineProps
virQEMUCapsCommandLine[] = {
{ "msg", "timestamp", QEMU_CAPS_MSG_TIMESTAMP },
{ "numa", NULL, QEMU_CAPS_NUMA },
{ "drive", "throttling.bps-total-max", QEMU_CAPS_DRIVE_IOTUNE_MAX },
- { "no-format-probing", NULL, QEMU_CAPS_NO_FORMAT_PROBING },
+ { "misc", "format-probing", QEMU_CAPS_NO_FORMAT_PROBING },
};
static int
diff --git i/src/qemu/qemu_command.c w/src/qemu/qemu_command.c
index 1085639..08f6560 100644
--- i/src/qemu/qemu_command.c
+++ w/src/qemu/qemu_command.c
@@ -8674,7 +8674,7 @@ qemuBuildCommandLine(virConnectPtr conn,
}
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_FORMAT_PROBING) &&
!cfg->allowDiskFormatProbing)
- virCommandAddArg(cmd, "-no-format-probing");
+ virCommandAddArgList(cmd, "-misc", "format-probing=off", NULL);
/* Serial graphics adapter */
if (def->os.bios.useserial == VIR_TRISTATE_BOOL_YES) {
>
> Existing miscellaneous non-QemeOpts options could then (in 2.4!)
> become sugar for something in this option group, thus become available
> with -readconfig.
Nice way to plan for future cleanups. I also agree that while this one
option about format-probing is reasonable to get into 2.3, that any
other sugar cleanups are better deferred until after the freeze.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
9 years, 8 months
[libvirt] [RFC PATCH] qemu: enforce no format probing when possible
by Eric Blake
qemu 2.3 added an option, with this documentation:
| Probing is convenient, but probing untrusted raw images is insecure
| (CVE-2008-2004). To avoid it, users should always specify raw format
| explicitly. This isn't trivial, and even sophisticated users have
| gotten it wrong (libvirt CVE-2010-2237, CVE-2010-2238, CVE-2010-2239,
| plus more recent variations of the theme that didn't get CVEs because
| they were caught before they could hurt users).
|
| Disabling probing entirely is a (hamfisted) way to ensure you always
| specify the format.
Use it when libvirt is configured to avoid probing, to ensure we
catch libvirt failures on avoiding probing before such bugs can
escalate into another CVE.
* src/qemu/qemu_capabilities.h (QEMU_CAPS_NO_FORMAT_PROBING): New
capability bit.
* src/qemu/qemu_capabilities.c (virQEMUCapsCommandLine): Set it.
* src/qemu/qemu_command.c (qemuBuildCommandLine): Use it.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
CC: qemu-devel(a)nongnu.org
---
RFC because I need to enhance the libvirt testsuite to prove we set
the option, and because the qemu side has not been committed yet
(and may therefore change the final spelling for the new option).
src/qemu/qemu_capabilities.c | 7 +++++--
src/qemu/qemu_capabilities.h | 3 ++-
src/qemu/qemu_command.c | 3 +++
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index ccf22f0..b452a75 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1,7 +1,7 @@
/*
* qemu_capabilities.c: QEMU capabilities generation
*
- * Copyright (C) 2006-2014 Red Hat, Inc.
+ * Copyright (C) 2006-2015 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -279,6 +279,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"qxl.vgamem_mb",
"qxl-vga.vgamem_mb",
"pc-dimm",
+
+ "no-format-probing", /* 185 */
);
@@ -2514,7 +2516,8 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = {
{ "spice", "disable-agent-file-xfer", QEMU_CAPS_SPICE_FILE_XFER_DISABLE },
{ "msg", "timestamp", QEMU_CAPS_MSG_TIMESTAMP },
{ "numa", NULL, QEMU_CAPS_NUMA },
- { "drive", "throttling.bps-total-max", QEMU_CAPS_DRIVE_IOTUNE_MAX},
+ { "drive", "throttling.bps-total-max", QEMU_CAPS_DRIVE_IOTUNE_MAX },
+ { "no-format-probing", NULL, QEMU_CAPS_NO_FORMAT_PROBING },
};
static int
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index c7b1ac7..2cdcd81 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -1,7 +1,7 @@
/*
* qemu_capabilities.h: QEMU capabilities generation
*
- * Copyright (C) 2006-2014 Red Hat, Inc.
+ * Copyright (C) 2006-2015 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -224,6 +224,7 @@ typedef enum {
QEMU_CAPS_QXL_VGAMEM = 182, /* -device qxl.vgamem_mb */
QEMU_CAPS_QXL_VGA_VGAMEM = 183, /* -device qxl-vga.vgamem_mb */
QEMU_CAPS_DEVICE_PC_DIMM = 184, /* pc-dimm device */
+ QEMU_CAPS_NO_FORMAT_PROBING = 185, /* -no-format-probing */
QEMU_CAPS_LAST, /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 63d43d4..1085639 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8672,6 +8672,9 @@ qemuBuildCommandLine(virConnectPtr conn,
virCommandAddArg(cmd, "-nodefconfig");
virCommandAddArg(cmd, "-nodefaults");
}
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_FORMAT_PROBING) &&
+ !cfg->allowDiskFormatProbing)
+ virCommandAddArg(cmd, "-no-format-probing");
/* Serial graphics adapter */
if (def->os.bios.useserial == VIR_TRISTATE_BOOL_YES) {
--
2.1.0
9 years, 8 months
[libvirt] [libvirt-designer][PATCH] trivial changes for code consistency
by Jayashree Deshpande
---
libvirt-designer/libvirt-designer-domain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libvirt-designer/libvirt-designer-domain.c b/libvirt-designer/libvirt-designer-domain.c
index cefefea..8703884 100644
--- a/libvirt-designer/libvirt-designer-domain.c
+++ b/libvirt-designer/libvirt-designer-domain.c
@@ -674,7 +674,8 @@ gvir_designer_domain_add_usb_controllers(GVirDesignerDomain *design)
* Returns: (transfer full): the pointer to the new USB redir channel
*/
GVirConfigDomainRedirdev *
-gvir_designer_domain_add_usb_redir(GVirDesignerDomain *design, GError **error)
+gvir_designer_domain_add_usb_redir(GVirDesignerDomain *design,
+ GError **error)
{
/* FIXME: check if OS/hypervisor support USB
* check if SPICE is being used
--
1.9.1
9 years, 8 months