~ubuntu-branches/ubuntu/oneiric/libvirt/oneiric-updates

« back to all changes in this revision

Viewing changes to src/interface/netcf_driver.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2011-05-11 12:29:51 UTC
  • mfrom: (1.2.10) (3.4.30 sid)
  • Revision ID: package-import@ubuntu.com-20110511122951-ku5fk1tv37o5aymm
Tags: 0.9.1-1ubuntu1
* Resynchronize and merge from Debian unstable (LP: #794378). Remaining
  changes:
  - debian/control:
    * set X-Python-Version to 2.7, as 2.6 is not in oneiric.
    * set ubuntu maintainer
    * Build-Depends:
      - remove [linux-any] from all dependencies
      - remove [!linux-any] deps
      - swap libxen to libxen3, qemu to qemu-kvm, and open-iscsi to
        open-iscsi-utils in Build-Depends
      - remove virtualbox-ose Build-Depends
      - add parted and libapparmor-dev Build-Depends
    * convert Vcs-Git to Xs-Debian-Vcs-Git
    * libvirt-bin Depends: move netcat-openbsd, bridge-utils, dnsmasq-base
      (>= 2.46-1), and iptables from Recommends to Depends
    * libvirt-bin Recommends: move qemu to Suggests
    * libvirt-bin Suggests: add apparmor
    * libvirt0 Recommands: move lvm2 to Suggests
  - keep debian/libvirt-bin.apport
  - keep debian/libvirt-bin.cron.daily
  - debian/libvirt-bin.dirs:
    * add apparmor, cron.daily, and apport dirs
  - debian/libvirt-bin.examples:
    * add debian/libvirt-suspendonreboot
  - debian/libvirt-bin.install:
    * add /etc/apparmor.d files
    * add apport hook
  - debian/libvirt-bin.manpages:
    * add debian/libvirt-migrate-qemu-disks.1
  - debian/libvirt-bin.postinst:
    * replace libvirt groupname with libvirtd
    * add each admin user to libvirtd group
    * call apparmor_parser on usr.sbin.libvirtd and
      usr.lib.libvirt.virt-aa-helper
    * call 'libvirt-migrate-qemu-disks -a' after
      libvirt-bin has started if migrating from
      older than 0.8.3-1ubuntu1
  - debian/libvirt-bin.postrm:
    * replace libvirt groupname with libvirtd
    * remove usr.sbin.libvirtd and
      usr.lib.libvirt.virt-aa-helper
  - keep added files under debian/:
    * libvirt-bin.upstart
    * libvirt-migrate-qemu-disks
    * libvirt-migrate-qemu-disks.1
    * libvirt-suspendonreboot
    * apparmor profiles
  - debian/README.Debian:
    * add 'Apparmor Profile' section
    * add 'Disk migration' section
  - debian/rules:
    * move include of debhelper.mk to top of file so DEB_HOST_ARCH_OS
      is defined.
    * don't build with vbox since virtualbox-ose is in universe
      - remove WITH_VBOX, add explicit --without-vbox
    * add --with-apparmor to DEB_CONFIGURE_EXTRA_FLAGS
    * set DEB_DH_INSTALLINIT_ARGS to '--upstart-only'
    * remove unneeded binary-install/libvirt-bin:: and clean::
      sections (they only deal with sysvinit stuff)
    * add build/libvirt-bin:: section to install
      - apparmor files
      - apport hooks
      - libvirt-migrate-qemu-disks
* debian/patches/series:
  - don't apply Disable-CHECKSUM-rule.patch: our iptables can do this
  - don't apply Debian-specific Debianize-libvirt-guests.patch (sysvinit only)
  - don't apply Disable qemu-disable-network.diff.patch
* debian/patches:
  - drop 9007-fix-daemon-conf-ftbfs.patch (looks like it may be fixed)
  - drop patches applied upstream:
    * 9022-drop-booton-when-kernel-specified.patch
    * 9023-fix-lxc-console-hangup.patch
    * 9024-fix-broken-commandtest.patch
    * 9025-Pass-virSecurityManagerPtr-to-virSecurityDAC-Set-Res.patch
    * 9026-security-avoid-memory-leak.patch
    * 9027-CVE-2011-1146.patch
  - keep patches:
    * 9000-delayed_iff_up_bridge.patch
    * 9001-dont_clobber_existing_bridges.patch
    * 9002-better_default_uri_virsh.patch
    * 9003-better-default-arch.patch
    * 9004-libvirtd-group-name.patch
    * 9005-increase-unix-socket-timeout.patch
    * 9006-default-config-test-case.patch
    * 9011-move-ebtables-script.patch (refreshed)
    * 9014-skip-nodeinfotest.patch (modified to make it apply)
    * 9020-lp545795.patch (modified to make it still apply)
    * 9021-fix-uint64_t.patch
    * 9022-allows-lxc-containers-with-lxcguest.patch (renamed, modified
      to make it still apply, and added DEP-3 tags).
  - new patches:
    * 9023-disable-test-poll.patch - don't run broken test-poll

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#define VIR_FROM_THIS VIR_FROM_INTERFACE
35
35
 
36
36
#define interfaceReportError(code, ...)                               \
37
 
    virReportErrorHelper(NULL, VIR_FROM_THIS, code, __FILE__,         \
 
37
    virReportErrorHelper(VIR_FROM_THIS, code, __FILE__,               \
38
38
                         __FUNCTION__, __LINE__, __VA_ARGS__)
39
39
 
40
40
/* Main driver state */
102
102
        int errcode = ncf_error(ncf, &errmsg, &details);
103
103
        if (errcode != NETCF_NOERROR) {
104
104
            interfaceReportError(netcf_to_vir_err(errcode),
105
 
                                 "couldn't find interface named '%s' (netcf: %s - %s)",
106
 
                                ifinfo->name, errmsg, details ? details : "");
 
105
                                 _("couldn't find interface named '%s' (netcf: %s - %s)"),
 
106
                                 ifinfo->name, errmsg, details ? details : "");
107
107
        } else {
108
108
            interfaceReportError(VIR_ERR_NO_INTERFACE,
109
 
                                 "couldn't find interface named '%s'", ifinfo->name);
 
109
                                 _("couldn't find interface named '%s'"),
 
110
                                 ifinfo->name);
110
111
        }
111
112
    }
112
113
    return iface;
182
183
        const char *errmsg, *details;
183
184
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
184
185
        interfaceReportError(netcf_to_vir_err(errcode),
185
 
                             "%s (netcf: %s - %s)",
186
 
                             _("failed to get number of interfaces on host"),
 
186
                             _("failed to get number of interfaces on host (netcf: %s - %s)"),
187
187
                            errmsg, details ? details : "");
188
188
    }
189
189
 
203
203
        const char *errmsg, *details;
204
204
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
205
205
        interfaceReportError(netcf_to_vir_err(errcode),
206
 
                             "%s (netcf: %s - %s)",
207
 
                             _("failed to list host interfaces"),
 
206
                             _("failed to list host interfaces (netcf: %s - %s)"),
208
207
                            errmsg, details ? details : "");
209
208
    }
210
209
 
224
223
        const char *errmsg, *details;
225
224
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
226
225
        interfaceReportError(netcf_to_vir_err(errcode),
227
 
                             "%s (netcf: %s - %s)",
228
 
                             _("failed to get number of defined interfaces on host"),
 
226
                             _("failed to get number of defined interfaces on host (netcf: %s - %s)"),
229
227
                            errmsg, details ? details : "");
230
228
    }
231
229
 
245
243
        const char *errmsg, *details;
246
244
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
247
245
        interfaceReportError(netcf_to_vir_err(errcode),
248
 
                             "%s (netcf: %s - %s)",
249
 
                             _("failed to list host defined interfaces"),
 
246
                             _("failed to list host defined interfaces (netcf: %s - %s)"),
250
247
                            errmsg, details ? details : "");
251
248
    }
252
249
 
269
266
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
270
267
        if (errcode != NETCF_NOERROR) {
271
268
            interfaceReportError(netcf_to_vir_err(errcode),
272
 
                                 "couldn't find interface named '%s' (netcf: %s - %s)",
 
269
                                 _("couldn't find interface named '%s' (netcf: %s - %s)"),
273
270
                                 name, errmsg, details ? details : "");
274
271
        } else {
275
272
            interfaceReportError(VIR_ERR_NO_INTERFACE,
276
 
                                 "couldn't find interface named '%s'", name);
 
273
                                 _("couldn't find interface named '%s'"), name);
277
274
        }
278
275
        goto cleanup;
279
276
    }
301
298
        const char *errmsg, *details;
302
299
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
303
300
        interfaceReportError(netcf_to_vir_err(errcode),
304
 
                             "couldn't find interface with MAC address '%s' (netcf: %s - %s)",
 
301
                             _("couldn't find interface with MAC address '%s' (netcf: %s - %s)"),
305
302
                             macstr, errmsg, details ? details : "");
306
303
        goto cleanup;
307
304
    }
308
305
    if (niface == 0) {
309
306
        interfaceReportError(VIR_ERR_NO_INTERFACE,
310
 
                             "couldn't find interface with MAC address '%s'",
 
307
                             _("couldn't find interface with MAC address '%s'"),
311
308
                             macstr);
312
309
        goto cleanup;
313
310
    }
351
348
        const char *errmsg, *details;
352
349
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
353
350
        interfaceReportError(netcf_to_vir_err(errcode),
354
 
                             "could not get interface XML description (netcf: %s - %s)",
355
 
                            errmsg, details ? details : "");
 
351
                             _("could not get interface XML description (netcf: %s - %s)"),
 
352
                             errmsg, details ? details : "");
356
353
        goto cleanup;
357
354
    }
358
355
 
405
402
        const char *errmsg, *details;
406
403
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
407
404
        interfaceReportError(netcf_to_vir_err(errcode),
408
 
                             "could not get interface XML description (netcf: %s - %s)",
409
 
                            errmsg, details ? details : "");
 
405
                             _("could not get interface XML description (netcf: %s - %s)"),
 
406
                             errmsg, details ? details : "");
410
407
        goto cleanup;
411
408
    }
412
409
 
438
435
        const char *errmsg, *details;
439
436
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
440
437
        interfaceReportError(netcf_to_vir_err(errcode),
441
 
                             "failed to undefine interface %s (netcf: %s - %s)",
 
438
                             _("failed to undefine interface %s (netcf: %s - %s)"),
442
439
                             ifinfo->name, errmsg, details ? details : "");
443
440
        goto cleanup;
444
441
    }
469
466
        const char *errmsg, *details;
470
467
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
471
468
        interfaceReportError(netcf_to_vir_err(errcode),
472
 
                             "failed to create (start) interface %s (netcf: %s - %s)",
 
469
                             _("failed to create (start) interface %s (netcf: %s - %s)"),
473
470
                             ifinfo->name, errmsg, details ? details : "");
474
471
        goto cleanup;
475
472
    }
500
497
        const char *errmsg, *details;
501
498
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
502
499
        interfaceReportError(netcf_to_vir_err(errcode),
503
 
                             "failed to destroy (stop) interface %s (netcf: %s - %s)",
 
500
                             _("failed to destroy (stop) interface %s (netcf: %s - %s)"),
504
501
                             ifinfo->name, errmsg, details ? details : "");
505
502
        goto cleanup;
506
503
    }
530
527
        const char *errmsg, *details;
531
528
        int errcode = ncf_error(driver->netcf, &errmsg, &details);
532
529
        interfaceReportError(netcf_to_vir_err(errcode),
533
 
                             "failed to get status of interface %s (netcf: %s - %s)",
 
530
                             _("failed to get status of interface %s (netcf: %s - %s)"),
534
531
                             ifinfo->name, errmsg, details ? details : "");
535
532
        goto cleanup;
536
533
    }