[libvirt] [PATCH] avoid format-related warnings

Jim Meyering jim at meyering.net
Mon Feb 1 17:33:11 UTC 2010


FYI, more of these.  No need to review.
I'll push shortly.

>From 4cd188d4d5e4ffebdc026dee9179d2a97c02d3f5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Mon, 1 Feb 2010 18:25:23 +0100
Subject: [PATCH] avoid format-related warnings

* src/qemu/qemu_monitor_text.c (qemuMonitorTextGetAllPCIAddresses):
Use %s.
* src/storage/storage_backend_iscsi.c (virStorageBackendCreateIfaceIQN):
Likewise.
* tools/virsh.c (cmdSecretSetValue): Likewise.
---
 src/qemu/qemu_monitor_text.c        |    2 +-
 src/storage/storage_backend_iscsi.c |    4 ++--
 tools/virsh.c                       |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 380bcdc..44111e1 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -1959,7 +1959,7 @@ int qemuMonitorTextGetAllPCIAddresses(qemuMonitorPtr mon,

     if (qemuMonitorCommand(mon, "info pci", &reply) < 0) {
         qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
-                         _("cannot query PCI addresses"));
+                         "%s", _("cannot query PCI addresses"));
         return -1;
     }

diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index 5c657b4..0d3c7b1 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -1,7 +1,7 @@
 /*
  * storage_backend_iscsi.c: storage backend for iSCSI handling
  *
- * Copyright (C) 2007-2008 Red Hat, Inc.
+ * Copyright (C) 2007-2008, 2010 Red Hat, Inc.
  * Copyright (C) 2007-2008 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -259,7 +259,7 @@ virStorageBackendCreateIfaceIQN(virConnectPtr conn,
     char temp_ifacename[32];

     if (virRandomInitialize(time(NULL) ^ getpid()) == -1) {
-        virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
+        virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
                               _("Failed to initialize random generator "
                                 "when creating iscsi interface"));
         goto out;
diff --git a/tools/virsh.c b/tools/virsh.c
index 1fae5e6..01d2038 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -1,7 +1,7 @@
 /*
  * virsh.c: a Xen shell used to exercise the libvirt API
  *
- * Copyright (C) 2005, 2007-2009 Red Hat, Inc.
+ * Copyright (C) 2005, 2007-2010 Red Hat, Inc.
  *
  * See COPYING.LIB for the License of this software
  *
@@ -5482,7 +5482,7 @@ cmdSecretSetValue(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;

     if (!base64_decode_alloc(base64, strlen(base64), &value, &value_size)) {
-        vshError(ctl, _("Invalid base64 data"));
+        vshError(ctl, "%s", _("Invalid base64 data"));
         goto cleanup;
     }
     if (value == NULL) {
--
1.7.0.rc1.149.g0b0b7




More information about the libvir-list mailing list