~ubuntu-branches/ubuntu/raring/libvirt/raring

« back to all changes in this revision

Viewing changes to src/util/virterror.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-11-19 10:41:02 UTC
  • mfrom: (1.2.15) (223.1.2 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20121119104102-l6ewdppikysbzztu
Tags: 1.0.0-0ubuntu2
debian/patches/add-armhf-sysinfo-infomration.patch: Disable
to fix FTBFS on arm.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * virterror.c: implements error handling and reporting code for libvirt
3
3
 *
4
 
 * Copy:  Copyright (C) 2006, 2008-2012 Red Hat, Inc.
5
 
 *
6
 
 * See COPYING.LIB for the License of this software
 
4
 * Copyright (C) 2006, 2008-2012 Red Hat, Inc.
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Lesser General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2.1 of the License, or (at your option) any later version.
 
10
 *
 
11
 * This library is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * Lesser General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public
 
17
 * License along with this library.  If not, see
 
18
 * <http://www.gnu.org/licenses/>.
7
19
 *
8
20
 * Author: Daniel Veillard <veillard@redhat.com>
9
21
 */
99
111
 
100
112
              "URI Utils", /* 45 */
101
113
              "Authentication Utils",
102
 
              "DBus Utils"
 
114
              "DBus Utils",
 
115
              "Parallels Cloud Server",
 
116
              "Device Config",
 
117
 
 
118
              "SSH transport layer", /* 50 */
 
119
              "Lock Space",
103
120
    )
104
121
 
105
122
 
655
672
 
656
673
    /*
657
674
     * Hook up the error or warning to the logging facility
658
 
     * XXXX should we include filename as 'category' instead of domain name ?
659
675
     */
660
676
    priority = virErrorLevelPriority(level);
661
677
    if (virErrorLogPriorityFilter)
662
678
        priority = virErrorLogPriorityFilter(to, priority);
663
 
    virLogMessage(filename, priority,
664
 
                  funcname, linenr,
665
 
                  virErrorLogPriorityFilter ? 0 : 1,
 
679
    virLogMessage(virErrorLogPriorityFilter ? VIR_LOG_FROM_FILE : VIR_LOG_FROM_ERROR,
 
680
                  priority,
 
681
                  filename, linenr, funcname,
666
682
                  "%s", str);
667
683
 
668
684
    errno = save_errno;
1172
1188
            else
1173
1189
                errmsg = _("block copy still active: %s");
1174
1190
            break;
 
1191
        case VIR_ERR_OPERATION_UNSUPPORTED:
 
1192
            if (!info)
 
1193
                errmsg = _("Operation not supported");
 
1194
            else
 
1195
                errmsg = _("Operation not supported: %s");
 
1196
            break;
 
1197
        case VIR_ERR_SSH:
 
1198
            if (info == NULL)
 
1199
                errmsg = _("SSH transport error");
 
1200
            else
 
1201
                errmsg = _("SSH transport error: %s");
 
1202
            break;
 
1203
        case VIR_ERR_AGENT_UNRESPONSIVE:
 
1204
            if (info == NULL)
 
1205
                errmsg = _("Guest agent is not responding");
 
1206
            else
 
1207
                errmsg = _("Guest agent is not responding: %s");
 
1208
            break;
 
1209
        case VIR_ERR_RESOURCE_BUSY:
 
1210
            if (info == NULL)
 
1211
                errmsg = _("resource busy");
 
1212
            else
 
1213
                errmsg = _("resource busy %s");
 
1214
            break;
1175
1215
    }
1176
1216
    return errmsg;
1177
1217
}
1289
1329
 
1290
1330
    virRaiseErrorFull(filename, funcname, linenr,
1291
1331
                      domcode, VIR_ERR_SYSTEM_ERROR, VIR_ERR_ERROR,
1292
 
                      msg, msgDetail, NULL, -1, -1, msg, msgDetail);
 
1332
                      msg, msgDetail, NULL, theerrno, -1, msg, msgDetail);
1293
1333
    errno = save_errno;
1294
1334
}
1295
1335