[libvirt] [PATCH] Properly report failure to create raw storage volume files
by Laine Stump
We were previously checking for a return < 0 from virFileOperation(),
but that function returns a standard errno, which is 0 on success, or
some small positive number on failure. The result was that we wouldn't
report failures to create storage volume files; instead they would
appear to be created, but then would vanish as soon as a pool-refresh
was done (or cause some later error as soon as someone tried to access
the volume).
The other uses of virFileOperation() were already properly checking
for != 0.
---
src/storage/storage_backend.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index aba8937..9792eed 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -362,7 +362,7 @@ virStorageBackendCreateRaw(virConnectPtr conn ATTRIBUTE_UNUSED,
createRawFileOpHook, &hdata,
VIR_FILE_OP_FORCE_PERMS |
(pool->def->type == VIR_STORAGE_POOL_NETFS
- ? VIR_FILE_OP_AS_UID : 0))) < 0) {
+ ? VIR_FILE_OP_AS_UID : 0))) != 0) {
virReportSystemError(createstat,
_("cannot create path '%s'"),
vol->target.path);
--
1.7.1.1
14 years, 4 months
Re: [libvirt] A problem in live migration
by Alex Jia
I am not sure if libvirt has resolved hostname and ip mapping problem, it had better that two
hosts have same domain name, such as "dhcp-1-2-3.nay.redhat.com" and "dhcp-4-5-6.nay.redhat.com".
In addition, I haven't seen your any storage pool information on two hosts, you need to create
a sharing storage such as nfs sharing folder, and your guest is in the storage, of course, you
may also manually mount your nfs folder to target host instead of creating storage pool.
Best Regards,
Alex
----- Original Message -----
From: "姚远" <sihuyy(a)gmail.com>
To: libvir-list(a)redhat.com
Sent: Wednesday, July 21, 2010 3:39:15 PM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi
Subject: [libvirt] A problem in live migration
In virsh, I use command "migrate --live 1 qemu+ssh:// 10.1.10.60/system " to do live migration,but it shows error "internal error hostname on destination resolved to localhost, but migration requires an FQDN". I don't know why, and who do live migration successfully can help me. Thank you!
My source and destination system are all fedora-13-x86_64, and the version of libvirt is 0.8.2
--
libvir-list mailing list
libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
14 years, 4 months
[libvirt] [PATCH] Fix PCI address assignment if no IDE controller is present
by Daniel P. Berrange
The PCI slot 1 must be reserved at all times, since PIIX3 is
always present, even if no IDE device is in use for guest disks
* src/qemu/qemu_conf.c: Always reserve slot 1 for PIIX3
---
src/qemu/qemu_conf.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 23e418b..6ce9c9e 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -2284,6 +2284,10 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
/* PIIX3 (ISA bridge, IDE controller, something else unknown, USB controller)
* hardcoded slot=1, multifunction device
*/
+ if (qemuDomainPCIAddressReserveSlot(addrs, 1) < 0)
+ goto error;
+
+ /* Verify that first IDE controller (if any) is on the PIIX3, fn 1 */
for (i = 0; i < def->ncontrollers ; i++) {
/* First IDE controller lives on the PIIX3 at slot=1, function=1 */
if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE &&
@@ -2303,8 +2307,6 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
def->controllers[i]->info.addr.pci.bus = 0;
def->controllers[i]->info.addr.pci.slot = 1;
def->controllers[i]->info.addr.pci.function = 1;
- if (qemuDomainPCIAddressReserveSlot(addrs, 1) < 0)
- goto error;
}
}
}
--
1.7.1.1
14 years, 4 months
[libvirt] [PATCH] Document the memory balloon device
by Daniel P. Berrange
* formatdomain.html.in: Document <memballoon> element
---
docs/formatdomain.html.in | 47 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 4cca67f..3e80312 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1506,6 +1506,53 @@ qemu-kvm -net nic,model=? /dev/null
</dd>
</dl>
+ <h4><a name="elementsMemBalloon">Memory balloon device</a></h4>
+
+ <p>
+ A virtual memory balloon device is added to all Xen and KVM/QEMU
+ guests. It will be seen as <code>memballoon</code> element.
+ It will be automatically added when appropriate, so there is no
+ need to explicitly add this element in the guest XML unless a
+ specific PCI slot needs to be assigned.
+ <span class="since">Since 0.8.3, Xen, QEMU and KVM only</span>
+ </p>
+
+ <p>
+ Example automatically added device with KVM
+ </p>
+<pre>
+ ...
+ <devices>
+ <memballoon model='virtio'/>
+ </devices>
+ ...</pre>
+
+ <p>
+ Example manually added device with static PCI slot 2 requested
+ </p>
+<pre>
+ ...
+ <devices>
+ <watchdog model='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </devices>
+</domain></pre>
+
+ <dl>
+ <dt><code>model</code></dt>
+ <dd>
+ <p>
+ The required <code>model</code> attribute specifies what type
+ of balloon device is provided. Valid values are specific to
+ the virtualization platform
+ </p>
+ <ul>
+ <li>'virtio' — default with QEMU/KVM</li>
+ <li>'xen' — default with Xen</li>
+ </ul>
+ </dd>
+ </dl>
+
<h2><a name="examples">Example configs</a></h2>
<p>
--
1.7.1.1
14 years, 4 months
[libvirt] [PATCH] Implement support for virtio plan9fs filesystem passthrough in QEMU
by Daniel P. Berrange
Make use of the existing <filesystem> element to support plan9fs
filesystem passthrough in the QEMU driver
<filesystem type='mount'>
<source dir='/export/to/guest'/>
<target dir='/import/from/host'/>
</filesystem>
NB, the target is not actually a directory, it is merely a arbitrary
string tag that is exported to the guest as a hint for where to mount
it.
---
src/qemu/qemu_conf.c | 96 +++++++++++++++++++++++++
src/qemu/qemu_conf.h | 5 ++
tests/qemuxml2argvdata/qemuxml2argv-fs9p.args | 1 +
tests/qemuxml2argvdata/qemuxml2argv-fs9p.xml | 28 +++++++
tests/qemuxml2argvtest.c | 2 +
5 files changed, 132 insertions(+), 0 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p.xml
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 3e35c57..23e418b 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1205,6 +1205,8 @@ static unsigned long long qemudComputeCmdFlags(const char *help,
flags |= QEMUD_CMD_FLAG_NO_KVM_PIT;
if (strstr(help, "-tdf"))
flags |= QEMUD_CMD_FLAG_TDF;
+ if (strstr(help, "-fsdev"))
+ flags |= QEMUD_CMD_FLAG_FSDEV;
/* Keep disabled till we're actually ready to turn on netdev mode
* The plan is todo it in 0.13.0 QEMU, but lets wait & see... */
@@ -1987,6 +1989,10 @@ qemuAssignDeviceAliases(virDomainDefPtr def, unsigned long long qemuCmdFlags)
if (!(qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE))
return 0;
+ for (i = 0; i < def->nfss ; i++) {
+ if (virAsprintf(&def->fss[i]->info.alias, "fs%d", i) < 0)
+ goto no_memory;
+ }
for (i = 0; i < def->nsounds ; i++) {
if (virAsprintf(&def->sounds[i]->info.alias, "sound%d", i) < 0)
goto no_memory;
@@ -2324,6 +2330,15 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
goto error;
}
}
+ for (i = 0; i < def->nfss ; i++) {
+ if (def->fss[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
+ continue;
+
+ /* Only support VirtIO-9p-pci so far. If that changes,
+ * we might need to skip devices here */
+ if (qemuDomainPCIAddressSetNextAddr(addrs, &def->fss[i]->info) < 0)
+ goto error;
+ }
/* Network interfaces */
for (i = 0; i < def->nnets ; i++) {
@@ -2713,6 +2728,64 @@ error:
}
+char *qemuBuildFSStr(virDomainFSDefPtr fs,
+ unsigned long long qemuCmdFlags ATTRIBUTE_UNUSED)
+{
+ virBuffer opt = VIR_BUFFER_INITIALIZER;
+
+ if (fs->type != VIR_DOMAIN_FS_TYPE_MOUNT) {
+ qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("can only passthrough directories"));
+ goto error;
+ }
+
+ virBufferAddLit(&opt, "local,security_model=mapped");
+ virBufferVSprintf(&opt, ",id=%s%s", QEMU_FSDEV_HOST_PREFIX, fs->info.alias);
+ virBufferVSprintf(&opt, ",path=%s", fs->src);
+
+ if (virBufferError(&opt)) {
+ virReportOOMError();
+ goto error;
+ }
+
+ return virBufferContentAndReset(&opt);
+
+error:
+ virBufferFreeAndReset(&opt);
+ return NULL;
+}
+
+
+char *
+qemuBuildFSDevStr(virDomainFSDefPtr fs)
+{
+ virBuffer opt = VIR_BUFFER_INITIALIZER;
+
+ if (fs->type != VIR_DOMAIN_FS_TYPE_MOUNT) {
+ qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("can only passthrough directories"));
+ goto error;
+ }
+
+ virBufferAddLit(&opt, "virtio-9p-pci");
+ virBufferVSprintf(&opt, ",id=%s", fs->info.alias);
+ virBufferVSprintf(&opt, ",fsdev=%s%s", QEMU_FSDEV_HOST_PREFIX, fs->info.alias);
+ virBufferVSprintf(&opt, ",mount_tag=%s", fs->dst);
+ qemuBuildDeviceAddressStr(&opt, &fs->info);
+
+ if (virBufferError(&opt)) {
+ virReportOOMError();
+ goto error;
+ }
+
+ return virBufferContentAndReset(&opt);
+
+error:
+ virBufferFreeAndReset(&opt);
+ return NULL;
+}
+
+
char *
qemuBuildControllerDevStr(virDomainControllerDefPtr def)
{
@@ -4274,6 +4347,29 @@ int qemudBuildCommandLine(virConnectPtr conn,
}
}
+ if (qemuCmdFlags & QEMUD_CMD_FLAG_FSDEV) {
+ for (i = 0 ; i < def->nfss ; i++) {
+ char *optstr;
+ virDomainFSDefPtr fs = def->fss[i];
+
+ ADD_ARG_LIT("-fsdev");
+ if (!(optstr = qemuBuildFSStr(fs, qemuCmdFlags)))
+ goto error;
+ ADD_ARG(optstr);
+
+ ADD_ARG_LIT("-device");
+ if (!(optstr = qemuBuildFSDevStr(fs)))
+ goto error;
+ ADD_ARG(optstr);
+ }
+ } else {
+ if (def->nfss) {
+ qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("filesystem passthrough not supported by this QEMU"));
+ goto error;
+ }
+ }
+
if (!def->nnets) {
/* If we have -device, then we set -nodefault already */
if (!(qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)) {
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index ca4559f..68f10eb 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -91,6 +91,7 @@ enum qemud_cmd_flags {
QEMUD_CMD_FLAG_TDF = (1LL << 35), /* -tdf flag (user-mode pit catchup) */
QEMUD_CMD_FLAG_PCI_CONFIGFD = (1LL << 36), /* pci-assign.configfd */
QEMUD_CMD_FLAG_NODEFCONFIG = (1LL << 37), /* -nodefconfig */
+ QEMUD_CMD_FLAG_FSDEV = (1LL << 38), /* -fstype filesystem passthrough */
};
/* Main driver state */
@@ -175,6 +176,7 @@ typedef qemuDomainPCIAddressSet *qemuDomainPCIAddressSetPtr;
# define QEMU_DRIVE_HOST_PREFIX "drive-"
# define QEMU_VIRTIO_SERIAL_PREFIX "virtio-serial"
+# define QEMU_FSDEV_HOST_PREFIX "fsdev-"
# define qemuReportError(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_QEMU, code, __FILE__, \
@@ -235,9 +237,12 @@ char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk,
char *qemuBuildDriveStr(virDomainDiskDefPtr disk,
int bootable,
unsigned long long qemuCmdFlags);
+char *qemuBuildFSStr(virDomainFSDefPtr fs,
+ unsigned long long qemuCmdFlags);
/* Current, best practice */
char * qemuBuildDriveDevStr(virDomainDiskDefPtr disk);
+char * qemuBuildFSDevStr(virDomainFSDefPtr fs);
/* Current, best practice */
char * qemuBuildControllerDevStr(virDomainControllerDefPtr def);
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fs9p.args b/tests/qemuxml2argvdata/qemuxml2argv-fs9p.args
new file mode 100644
index 0000000..42c26a2
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-fs9p.args
@@ -0,0 +1 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -fsdev local,id=fsdev-fs0,path=/export/to/guest -device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=/import/from/host,bus=pci.0,addr=0x4 -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fs9p.xml b/tests/qemuxml2argvdata/qemuxml2argv-fs9p.xml
new file mode 100644
index 0000000..9072ead
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-fs9p.xml
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <filesystem type='mount'>
+ <source dir='/export/to/guest'/>
+ <target dir='/import/from/host'/>
+ </filesystem>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 24002b8..10d1342 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -357,6 +357,8 @@ mymain(int argc, char **argv)
DO_TEST("sound", 0);
DO_TEST("sound-device", QEMUD_CMD_FLAG_DEVICE |
QEMUD_CMD_FLAG_NODEFCONFIG);
+ DO_TEST("fs9p", QEMUD_CMD_FLAG_DEVICE |
+ QEMUD_CMD_FLAG_NODEFCONFIG | QEMUD_CMD_FLAG_FSDEV);
DO_TEST("hostdev-usb-address", 0);
DO_TEST("hostdev-usb-address-device", QEMUD_CMD_FLAG_DEVICE |
--
1.7.1.1
14 years, 4 months
[libvirt] [PATCH 0/4] Re-arrange PCI device ordering
by Daniel P. Berrange
In an attempt to provide better compatability with older QEMU where
static PCI device ordering wasn't available, we re-arrange our
device address assignment code. We now try to assign addresses in
the same order as QEMU would. This should upset Windows less.
14 years, 4 months
[libvirt] [PATCH] Set a stable & high MAC addr for guest TAP devices on host
by Daniel P. Berrange
A Linux software bridge will assume the MAC address of the enslaved
interface with the numerically lowest MAC addr. When the bridge
changes MAC address there is a period of network blackout, so a
change should be avoided. The kernel gives TAP devices a completely
random MAC address. Occassionally the random TAP device MAC is lower
than that of the physical interface (eth0, eth1etc) that is enslaved,
causing the bridge to change its MAC.
This change sets an explicit MAC address for all TAP devices created
using the configured MAC from the XML, but with the high byte set
to 0xFE. This should ensure TAP device MACs are higher than any
physical interface MAC.
* src/qemu/qemu_conf.c, src/uml/uml_conf.c: Pass in a MAC addr
for the TAP device with high byte set to 0xFE
* src/util/bridge.c, src/util/bridge.h: Set a MAC when creating
the TAP device to override random MAC
---
src/qemu/qemu_conf.c | 11 +++++++++--
src/uml/uml_conf.c | 11 +++++++++--
src/util/bridge.c | 42 ++++++++++++++++++++++++++++++++++++++++++
src/util/bridge.h | 3 ++-
4 files changed, 62 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index ad41457..d721fcc 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1608,6 +1608,7 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
int tapfd = -1;
int vnet_hdr = 0;
int template_ifname = 0;
+ unsigned char tapmac[VIR_MAC_BUFLEN];
if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
int active, fail = 0;
@@ -1675,8 +1676,14 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
net->model && STREQ(net->model, "virtio"))
vnet_hdr = 1;
- if ((err = brAddTap(driver->brctl, brname,
- &net->ifname, vnet_hdr, &tapfd))) {
+ memcpy(tapmac, net->mac, VIR_MAC_BUFLEN);
+ tapmac[0] = 0xFE; /* Discourage bridge from using TAP dev MAC */
+ if ((err = brAddTap(driver->brctl,
+ brname,
+ &net->ifname,
+ tapmac,
+ vnet_hdr,
+ &tapfd))) {
if (errno == ENOTSUP) {
/* In this particular case, give a better diagnostic. */
qemuReportError(VIR_ERR_INTERNAL_ERROR,
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 785d627..ea40efb 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -113,6 +113,7 @@ umlConnectTapDevice(virDomainNetDefPtr net,
int tapfd = -1;
int template_ifname = 0;
int err;
+ unsigned char tapmac[VIR_MAC_BUFLEN];
if ((err = brInit(&brctl))) {
virReportSystemError(err, "%s",
@@ -130,8 +131,14 @@ umlConnectTapDevice(virDomainNetDefPtr net,
template_ifname = 1;
}
- if ((err = brAddTap(brctl, bridge,
- &net->ifname, BR_TAP_PERSIST, &tapfd))) {
+ memcpy(tapmac, net->mac, VIR_MAC_BUFLEN);
+ tapmac[0] = 0xFE; /* Discourage bridge from using TAP dev MAC */
+ if ((err = brAddTap(brctl,
+ bridge,
+ &net->ifname,
+ tapmac,
+ 0,
+ &tapfd))) {
if (errno == ENOTSUP) {
/* In this particular case, give a better diagnostic. */
umlReportError(VIR_ERR_INTERNAL_ERROR,
diff --git a/src/util/bridge.c b/src/util/bridge.c
index b236f80..7d0caae 100644
--- a/src/util/bridge.c
+++ b/src/util/bridge.c
@@ -285,6 +285,38 @@ brDeleteInterface(brControl *ctl ATTRIBUTE_UNUSED,
# endif
/**
+ * ifSetInterfaceMac:
+ * @ctl: bridge control pointer
+ * @ifname: interface name to set MTU for
+ * @macaddr: MAC address (VIR_MAC_BUFLEN in size)
+ *
+ * This function sets the @macaddr for a given interface @ifname. This
+ * gets rid of the kernel's automatically assigned random MAC.
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
+static int ifSetInterfaceMac(brControl *ctl, const char *ifname,
+ const unsigned char *macaddr)
+{
+ struct ifreq ifr;
+
+ if (!ctl || !ifname)
+ return EINVAL;
+
+ memset(&ifr, 0, sizeof(struct ifreq));
+ if (virStrcpyStatic(ifr.ifr_name, ifname) == NULL)
+ return EINVAL;
+
+ /* To fill ifr.ifr_hdaddr.sa_family field */
+ if (ioctl(ctl->fd, SIOCGIFHWADDR, &ifr) != 0)
+ return errno;
+
+ memcpy(ifr.ifr_hwaddr.sa_data, macaddr, VIR_MAC_BUFLEN);
+
+ return ioctl(ctl->fd, SIOCSIFHWADDR, &ifr) == 0 ? 0 : errno;
+}
+
+/**
* ifGetMtu
* @ctl: bridge control pointer
* @ifname: interface name get MTU for
@@ -430,6 +462,7 @@ brProbeVnetHdr(int tapfd)
* @ctl: bridge control pointer
* @bridge: the bridge name
* @ifname: the interface name (or name template)
+ * @macaddr: desired MAC address (VIR_MAC_BUFLEN long)
* @vnet_hdr: whether to try enabling IFF_VNET_HDR
* @tapfd: file descriptor return value for the new tap device
*
@@ -447,6 +480,7 @@ int
brAddTap(brControl *ctl,
const char *bridge,
char **ifname,
+ const unsigned char *macaddr,
int vnet_hdr,
int *tapfd)
{
@@ -478,6 +512,14 @@ brAddTap(brControl *ctl,
if (ioctl(fd, TUNSETIFF, &ifr) < 0)
goto error;
+ /* We need to set the interface MAC before adding it
+ * to the bridge, because the bridge assumes the lowest
+ * MAC of all enslaved interfaces & we don't want it
+ * seeing the kernel allocate random MAC for the TAP
+ * device before we set our static MAC.
+ */
+ if ((errno = ifSetInterfaceMac(ctl, ifr.ifr_name, macaddr)))
+ goto error;
/* We need to set the interface MTU before adding it
* to the bridge, because the bridge will have its
* MTU adjusted automatically when we add the new interface.
diff --git a/src/util/bridge.h b/src/util/bridge.h
index d37d7db..96696ac 100644
--- a/src/util/bridge.h
+++ b/src/util/bridge.h
@@ -68,7 +68,8 @@ enum {
int brAddTap (brControl *ctl,
const char *bridge,
char **ifname,
- int features,
+ const unsigned char *macaddr,
+ int vnet_hdr,
int *tapfd);
int brDeleteTap (brControl *ctl,
--
1.7.1.1
14 years, 4 months
[libvirt] A problem in live migration
by 姚远
In virsh, I use command "migrate --live 1 qemu+ssh://10.1.10.60/system" to
do live migration,but it shows error "internal error hostname on destination
resolved to localhost, but migration requires an FQDN". I don't know why,
and who do live migration successfully can help me. Thank you!
My source and destination system are all fedora-13-x86_64, and the version
of libvirt is 0.8.2
14 years, 4 months
[libvirt] How to replace the management procedure in the virsh
by 姚远
In virsh, I usr "version" and it shows
编译使用的库:libvir 0.8.2
使用的库:libvir 0.8.2
使用的 API: QEMU 0.8.2
运行管理程序: QEMU 0.9.1
I want to replace QEMU 0.9.1 to QEMU 0.12.2, because 0.12.2 adds many new
functions. I download qemu-kvm-0.12.2.tar.gz and install it, but the
management procedure is not replaced.
I know I should modify the profile of libvirt but I don't know where it is
and how to modify it.
14 years, 4 months
[libvirt] Unmarshalling error with migrate command
by Doug Goldstein
Hey guys,
I'm using a server running libvirt 0.8.2 and my desktop running
libvirt 0.8.2. My desktop has virt-manager 0.8.4 and I've got a Linux
VM running on the server. I'm looking to use the new migration support
to migrate the VM to my desktop from the server. Everytime I attempt
the migration I get an error dialog containing the following (I've
actually snagged this out of ~/.virt-manager/virt-manager.log
[Wed, 07 Jul 2010 18:13:23 virt-manager 18880] DEBUG (migrate:456)
Migrating vm=CentOS-5.4-i686-PAE from qemu+ssh://root@codeine/system
to qemu:///system
[Wed, 07 Jul 2010 18:13:23 virt-manager 18880] DEBUG (domain:1351)
Migrating: conn=<libvirt.virConnect instance at 0x2a305f0> flags=7
dname=None uri=qemu://doug-pc/system rate=0[Wed, 07 Jul 2010 18:13:23
virt-manager 18880] DEBUG (error:86) Uncaught Error: unmarshalling
remote_error : Unable to migrate guest:
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/migrate.py", line 457, in
_async_migrate
vm.migrate(dstconn, migrate_uri, rate, live, secure)
File "/usr/share/virt-manager/virtManager/domain.py", line 1352, in migrate
self._backend.migrate(destconn.vmm, flags, newname, interface, rate)
File "/usr/lib64/python2.6/site-packages/libvirt.py", line 479, in migrate
prefer to invoke virDomainMigrateToURI, avoiding the need to
libvirtError: unmarshalling remote_error
If anyone has any ideas, please let me know.
--
Doug Goldstein
14 years, 4 months