Update to libvirt 0.9.7

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=170
This commit is contained in:
James Fehlig 2011-11-10 01:55:47 +00:00 committed by Git OBS Bridge
parent 70bb121b93
commit 83820260d9
12 changed files with 96 additions and 662 deletions

View File

@ -1,244 +0,0 @@
commit c1bc3d892c7388ad5c7c70a298107236717a009a
Author: Jim Fehlig <jfehlig@suse.com>
Date: Tue Sep 27 21:46:08 2011 -0600
Add AHCI support to qemu driver
Tested with multiple AHCI controllers and multiple disks attached
to a controller. E.g.,
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/test/disk0.raw'/>
<target dev='sda' bus='sata'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/test/disk1.raw'/>
<target dev='sdb' bus='sata'/>
<address type='drive' controller='0' bus='0' unit='1'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/test/disk2.raw'/>
<target dev='sdc' bus='sata'/>
<address type='drive' controller='1' bus='0' unit='0'/>
</disk>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
<controller type='sata' index='1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</controller>
Index: libvirt-0.9.6/docs/formatdomain.html.in
===================================================================
--- libvirt-0.9.6.orig/docs/formatdomain.html.in
+++ libvirt-0.9.6/docs/formatdomain.html.in
@@ -972,11 +972,12 @@
as a device ordering hint. The optional <code>bus</code>
attribute specifies the type of disk device to emulate;
possible values are driver specific, with typical values being
- "ide", "scsi", "virtio", "xen" or "usb". If omitted, the bus type is
- inferred from the style of the device name. eg, a device named 'sda'
- will typically be exported using a SCSI bus.
+ "ide", "scsi", "virtio", "xen", "usb" or "sata". If omitted, the bus
+ type is inferred from the style of the device name. eg, a device named
+ 'sda' will typically be exported using a SCSI bus.
<span class="since">Since 0.0.3; <code>bus</code> attribute since 0.4.3;
- "usb" attribute value since after 0.4.4</span></dd>
+ "usb" attribute value since after 0.4.4; "sata" attribute value since
+ 0.9.7</span></dd>
<dt><code>driver</code></dt>
<dd>
The optional driver element allows specifying further details
Index: libvirt-0.9.6/docs/schemas/domaincommon.rng
===================================================================
--- libvirt-0.9.6.orig/docs/schemas/domaincommon.rng
+++ libvirt-0.9.6/docs/schemas/domaincommon.rng
@@ -790,6 +790,7 @@
<value>xen</value>
<value>usb</value>
<value>uml</value>
+ <value>sata</value>
</choice>
</attribute>
</optional>
Index: libvirt-0.9.6/src/conf/domain_conf.c
===================================================================
--- libvirt-0.9.6.orig/src/conf/domain_conf.c
+++ libvirt-0.9.6/src/conf/domain_conf.c
@@ -2156,6 +2156,15 @@ virDomainDiskDefAssignAddress(virCapsPtr
def->info.addr.drive.unit = (idx % 2);
break;
+ case VIR_DOMAIN_DISK_BUS_SATA:
+ /* For SATA we define the default mapping to be 6 units
+ * per bus, 1 bus per controller, many controllers */
+ def->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE;
+ def->info.addr.drive.controller = idx / 6;
+ def->info.addr.drive.bus = 0;
+ def->info.addr.drive.unit = idx % 6;
+ break;
+
case VIR_DOMAIN_DISK_BUS_FDC:
/* For FDC we define the default mapping to be 2 units
* per bus, 1 bus per controller, many controllers */
@@ -8674,6 +8683,11 @@ int virDomainDefAddImplicitControllers(v
VIR_DOMAIN_DISK_BUS_IDE) < 0)
return -1;
+ if (virDomainDefAddDiskControllersForType(def,
+ VIR_DOMAIN_CONTROLLER_TYPE_SATA,
+ VIR_DOMAIN_DISK_BUS_SATA) < 0)
+ return -1;
+
if (virDomainDefMaybeAddVirtioSerialController(def) < 0)
return -1;
Index: libvirt-0.9.6/src/qemu/qemu_capabilities.c
===================================================================
--- libvirt-0.9.6.orig/src/qemu/qemu_capabilities.c
+++ libvirt-0.9.6/src/qemu/qemu_capabilities.c
@@ -136,6 +136,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"pci-ohci",
"usb-redir",
"usb-hub",
+ "ich9-ahci",
);
struct qemu_feature_flags {
@@ -1227,6 +1228,8 @@ qemuCapsParseDeviceStr(const char *str,
qemuCapsSet(flags, QEMU_CAPS_USB_REDIR);
if (strstr(str, "name \"usb-hub\""))
qemuCapsSet(flags, QEMU_CAPS_USB_HUB);
+ if (strstr(str, "name \"ich9-ahci\""))
+ qemuCapsSet(flags, QEMU_CAPS_ICH9_AHCI);
/* Prefer -chardev spicevmc (detected earlier) over -device spicevmc */
if (!qemuCapsGet(flags, QEMU_CAPS_CHARDEV_SPICEVMC) &&
Index: libvirt-0.9.6/src/qemu/qemu_capabilities.h
===================================================================
--- libvirt-0.9.6.orig/src/qemu/qemu_capabilities.h
+++ libvirt-0.9.6/src/qemu/qemu_capabilities.h
@@ -110,6 +110,7 @@ enum qemuCapsFlags {
QEMU_CAPS_PCI_OHCI = 71, /* -device pci-ohci */
QEMU_CAPS_USB_REDIR = 72, /* -device usb-redir */
QEMU_CAPS_USB_HUB = 73, /* -device usb-hub */
+ QEMU_CAPS_ICH9_AHCI = 74, /* -device ich9-ahci */
QEMU_CAPS_LAST, /* this must always be the last item */
};
Index: libvirt-0.9.6/src/qemu/qemu_command.c
===================================================================
--- libvirt-0.9.6.orig/src/qemu/qemu_command.c
+++ libvirt-0.9.6/src/qemu/qemu_command.c
@@ -1694,6 +1694,12 @@ qemuBuildDriveDevStr(virDomainDiskDefPtr
disk->info.addr.drive.bus,
disk->info.addr.drive.unit);
break;
+ case VIR_DOMAIN_DISK_BUS_SATA:
+ virBufferAddLit(&opt, "ide-drive");
+ virBufferAsprintf(&opt, ",bus=ahci%d.%d",
+ disk->info.addr.drive.controller,
+ disk->info.addr.drive.unit);
+ break;
case VIR_DOMAIN_DISK_BUS_VIRTIO:
virBufferAddLit(&opt, "virtio-blk-pci");
qemuBuildIoEventFdStr(&opt, disk->ioeventfd, qemuCaps);
@@ -1894,6 +1900,10 @@ qemuBuildControllerDevStr(virDomainContr
virBufferAsprintf(&buf, "usb-ccid,id=ccid%d", def->idx);
break;
+ case VIR_DOMAIN_CONTROLLER_TYPE_SATA:
+ virBufferAsprintf(&buf, "ahci,id=ahci%d", def->idx);
+ break;
+
case VIR_DOMAIN_CONTROLLER_TYPE_USB:
if (qemuBuildUSBControllerDevStr(def, qemuCaps, &buf) == -1)
goto error;
@@ -3675,14 +3685,22 @@ qemuBuildCommandLine(virConnectPtr conn,
cont->type == VIR_DOMAIN_CONTROLLER_TYPE_FDC)
continue;
- /* QEMU doesn't implement a SATA driver */
+ /* Only recent QEMU implements a SATA (AHCI) controller */
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) {
- qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("SATA is not supported with this QEMU binary"));
- goto error;
- }
+ if (!qemuCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI)) {
+ qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("SATA is not supported with this QEMU binary"));
+ goto error;
+ } else {
+ char *devstr;
+
+ virCommandAddArg(cmd, "-device");
+ if (!(devstr = qemuBuildControllerDevStr(cont, qemuCaps, NULL)))
+ goto error;
- if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
+ virCommandAddArg(cmd, devstr);
+ }
+ } else if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
def->controllers[i]->model == -1 &&
!qemuCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) {
if (usblegacy) {
Index: libvirt-0.9.6/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.args
===================================================================
--- /dev/null
+++ libvirt-0.9.6/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.args
@@ -0,0 +1,6 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults -monitor \
+unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -device ahci,id=ahci0,\
+bus=pci.0,addr=0x3 -drive file=/dev/HostVG/QEMUGuest1,if=none,\
+id=drive-sata0-0-0 -device ide-drive,bus=ahci0.0,drive=drive-sata0-0-0,\
+id=sata0-0-0 -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
Index: libvirt-0.9.6/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.xml
===================================================================
--- /dev/null
+++ libvirt-0.9.6/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.xml
@@ -0,0 +1,25 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219136</memory>
+ <currentMemory>219136</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='sda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' unit='0'/>
+ </disk>
+ <controller type='sata' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
Index: libvirt-0.9.6/tests/qemuxml2argvtest.c
===================================================================
--- libvirt-0.9.6.orig/tests/qemuxml2argvtest.c
+++ libvirt-0.9.6/tests/qemuxml2argvtest.c
@@ -356,6 +356,9 @@ mymain(void)
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("disk-scsi-device-auto", false,
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
+ DO_TEST("disk-sata-device", false,
+ QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE,
+ QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_ICH9_AHCI);
DO_TEST("disk-aio", false,
QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_AIO,
QEMU_CAPS_DRIVE_CACHE_V2, QEMU_CAPS_DRIVE_FORMAT);

View File

@ -2,8 +2,8 @@ Index: src/lxc/lxc_container.c
===================================================================
--- src/lxc/lxc_container.c.orig
+++ src/lxc/lxc_container.c
@@ -1183,6 +1183,9 @@ int lxcContainerStart(virDomainDefPtr de
handshakefd};
@@ -1345,6 +1345,9 @@ int lxcContainerStart(virDomainDefPtr de
ttyPaths, nttyPaths, handshakefd};
/* allocate a stack for the container */
+#ifdef __ia64__
@ -12,7 +12,7 @@ Index: src/lxc/lxc_container.c
if (VIR_ALLOC_N(stack, stacksize) < 0) {
virReportOOMError();
return -1;
@@ -1201,7 +1204,11 @@ int lxcContainerStart(virDomainDefPtr de
@@ -1363,7 +1366,11 @@ int lxcContainerStart(virDomainDefPtr de
cflags |= CLONE_NEWNET;
}
@ -24,15 +24,15 @@ Index: src/lxc/lxc_container.c
VIR_FREE(stack);
VIR_DEBUG("clone() completed, new container PID is %d", pid);
@@ -1228,6 +1235,7 @@ int lxcContainerAvailable(int features)
@@ -1389,6 +1396,7 @@ int lxcContainerAvailable(int features)
int cpid;
char *childStack;
char *stack;
int childStatus;
+ int stacksize = getpagesize() * 4;
if (features & LXC_CONTAINER_FEATURE_USER)
flags |= CLONE_NEWUSER;
@@ -1235,14 +1243,21 @@ int lxcContainerAvailable(int features)
@@ -1396,14 +1404,21 @@ int lxcContainerAvailable(int features)
if (features & LXC_CONTAINER_FEATURE_NET)
flags |= CLONE_NEWNET;
@ -55,4 +55,4 @@ Index: src/lxc/lxc_container.c
+#endif
VIR_FREE(stack);
if (cpid < 0) {
char ebuf[1024];
char ebuf[1024] ATTRIBUTE_UNUSED;

View File

@ -1,277 +0,0 @@
commit f887b0c4913b81c33a7d0a8cce3da09caf88ecbb
Author: Jim Fehlig <jfehlig@novell.com>
Date: Thu Sep 22 20:48:07 2011 -0600
Revert "qemu: Fix shutdown regression with buggy qemu"
This reverts commit f84aedad090da1e05ccc5651815febba013eb3ad.
The commit is not needed since the affected SUSE kvm packages
have the necessary qemu patch
http://lists.nongnu.org/archive/html/qemu-devel/2011-09/msg01757.html
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 850d46e..36f47a9 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -136,7 +136,6 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"pci-ohci",
"usb-redir",
"usb-hub",
- "no-shutdown",
);
struct qemu_feature_flags {
@@ -1009,13 +1008,6 @@ qemuCapsComputeCmdFlags(const char *help,
qemuCapsSet(flags, QEMU_CAPS_VHOST_NET);
}
- /* Do not use -no-shutdown if qemu doesn't support it or SIGTERM handling
- * is most likely buggy when used with -no-shutdown (which applies for qemu
- * 0.14.* and 0.15.*)
- */
- if (strstr(help, "-no-shutdown") && (version < 14000 || version > 15999))
- qemuCapsSet(flags, QEMU_CAPS_NO_SHUTDOWN);
-
/*
* Handling of -incoming arg with varying features
* -incoming tcp (kvm >= 79, qemu >= 0.10.0)
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 74d3ab2..96b7a3b 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -110,7 +110,6 @@ enum qemuCapsFlags {
QEMU_CAPS_PCI_OHCI = 71, /* -device pci-ohci */
QEMU_CAPS_USB_REDIR = 72, /* -device usb-redir */
QEMU_CAPS_USB_HUB = 73, /* -device usb-hub */
- QEMU_CAPS_NO_SHUTDOWN = 74, /* usable -no-shutdown */
QEMU_CAPS_LAST, /* this must always be the last item */
};
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0adc56a..ee4b52b 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3574,7 +3574,7 @@ qemuBuildCommandLine(virConnectPtr conn,
* when QEMU stops. If we use no-shutdown, then we can
* watch for this event and do a soft/warm reboot.
*/
- if (monitor_json && qemuCapsGet(qemuCaps, QEMU_CAPS_NO_SHUTDOWN))
+ if (monitor_json)
virCommandAddArg(cmd, "-no-shutdown");
if (!(def->features & (1 << VIR_DOMAIN_FEATURE_ACPI)))
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0d0bea2..f87af06 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1556,12 +1556,6 @@ static int qemuDomainReboot(virDomainPtr dom, unsigned int flags) {
priv = vm->privateData;
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON)) {
- if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_NO_SHUTDOWN)) {
- qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Reboot is not supported with this QEMU binary"));
- goto cleanup;
- }
-
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 933d556..f0b0879 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -152,8 +152,7 @@ mymain(void)
QEMU_CAPS_KVM,
QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_MEM_PATH,
- QEMU_CAPS_TDF,
- QEMU_CAPS_NO_SHUTDOWN);
+ QEMU_CAPS_TDF);
DO_TEST("kvm-83-rhel56", 9001, 1, 83,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -178,8 +177,7 @@ mymain(void)
QEMU_CAPS_TDF,
QEMU_CAPS_DRIVE_READONLY,
QEMU_CAPS_SMBIOS_TYPE,
- QEMU_CAPS_SPICE,
- QEMU_CAPS_NO_SHUTDOWN);
+ QEMU_CAPS_SPICE);
DO_TEST("qemu-0.10.5", 10005, 0, 0,
QEMU_CAPS_KQEMU,
QEMU_CAPS_VNC_COLON,
@@ -198,8 +196,7 @@ mymain(void)
QEMU_CAPS_SDL,
QEMU_CAPS_RTC_TD_HACK,
QEMU_CAPS_NO_HPET,
- QEMU_CAPS_VGA_NONE,
- QEMU_CAPS_NO_SHUTDOWN);
+ QEMU_CAPS_VGA_NONE);
DO_TEST("qemu-kvm-0.10.5", 10005, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -224,8 +221,7 @@ mymain(void)
QEMU_CAPS_NO_KVM_PIT,
QEMU_CAPS_TDF,
QEMU_CAPS_NESTING,
- QEMU_CAPS_VGA_NONE,
- QEMU_CAPS_NO_SHUTDOWN);
+ QEMU_CAPS_VGA_NONE);
DO_TEST("kvm-86", 10050, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -250,8 +246,7 @@ mymain(void)
QEMU_CAPS_TDF,
QEMU_CAPS_NESTING,
QEMU_CAPS_SMBIOS_TYPE,
- QEMU_CAPS_VGA_NONE,
- QEMU_CAPS_NO_SHUTDOWN);
+ QEMU_CAPS_VGA_NONE);
DO_TEST("qemu-kvm-0.11.0-rc2", 10092, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -281,8 +276,7 @@ mymain(void)
QEMU_CAPS_NESTING,
QEMU_CAPS_NAME_PROCESS,
QEMU_CAPS_SMBIOS_TYPE,
- QEMU_CAPS_VGA_NONE,
- QEMU_CAPS_NO_SHUTDOWN);
+ QEMU_CAPS_VGA_NONE);
DO_TEST("qemu-0.12.1", 12001, 0, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -312,8 +306,7 @@ mymain(void)
QEMU_CAPS_SMBIOS_TYPE,
QEMU_CAPS_VGA_NONE,
QEMU_CAPS_MIGRATE_QEMU_FD,
- QEMU_CAPS_DRIVE_AIO,
- QEMU_CAPS_NO_SHUTDOWN);
+ QEMU_CAPS_DRIVE_AIO);
DO_TEST("qemu-kvm-0.12.1.2-rhel60", 12001, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -357,8 +350,7 @@ mymain(void)
QEMU_CAPS_DEVICE_SPICEVMC,
QEMU_CAPS_PIIX3_USB_UHCI,
QEMU_CAPS_PIIX4_USB_UHCI,
- QEMU_CAPS_USB_HUB,
- QEMU_CAPS_NO_SHUTDOWN);
+ QEMU_CAPS_USB_HUB);
DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -395,8 +387,7 @@ mymain(void)
QEMU_CAPS_SMBIOS_TYPE,
QEMU_CAPS_VGA_NONE,
QEMU_CAPS_MIGRATE_QEMU_FD,
- QEMU_CAPS_DRIVE_AIO,
- QEMU_CAPS_NO_SHUTDOWN);
+ QEMU_CAPS_DRIVE_AIO);
DO_TEST("qemu-kvm-0.13.0", 13000, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -448,8 +439,7 @@ mymain(void)
QEMU_CAPS_PIIX4_USB_UHCI,
QEMU_CAPS_VT82C686B_USB_UHCI,
QEMU_CAPS_PCI_OHCI,
- QEMU_CAPS_USB_HUB,
- QEMU_CAPS_NO_SHUTDOWN);
+ QEMU_CAPS_USB_HUB);
DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -497,8 +487,7 @@ mymain(void)
QEMU_CAPS_VIRTIO_IOEVENTFD,
QEMU_CAPS_PIIX3_USB_UHCI,
QEMU_CAPS_PIIX4_USB_UHCI,
- QEMU_CAPS_USB_HUB,
- QEMU_CAPS_NO_SHUTDOWN);
+ QEMU_CAPS_USB_HUB);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-monitor-json.args b/tests/qemuxml2argvdata/qemuxml2argv-monitor-json.args
index e04cdec..8d8e43e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-monitor-json.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-monitor-json.args
@@ -1,5 +1,5 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults -chardev socket,\
id=charmonitor,path=/tmp/test-monitor,server,nowait -mon chardev=charmonitor,\
-id=monitor,mode=control -no-acpi -boot c -hda /dev/hda1 -usb -device \
+id=monitor,mode=control -no-shutdown -no-acpi -boot c -hda /dev/hda1 -usb -device \
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.args b/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.args
deleted file mode 100644
index 1464d09..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.args
+++ /dev/null
@@ -1,21 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-/usr/bin/qemu \
--S \
--M pc \
--m 214 \
--smp 1 \
--nographic \
--nodefconfig \
--nodefaults \
--chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--no-shutdown \
--no-acpi \
--boot c \
--hda /dev/hda1 \
--usb \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.xml b/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.xml
deleted file mode 100644
index 1901715..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-no-shutdown.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<domain type='qemu'>
- <name>encryptdisk</name>
- <uuid>496898a6-e6ff-f7c8-5dc2-3cf410945ee9</uuid>
- <memory>219100</memory>
- <currentMemory>219100</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='file' device='disk'>
- <driver name='qemu' type='qcow2'/>
- <source file='/dev/hda1'/>
- <target dev='hda'/>
- </disk>
- <memballoon model='virtio'/>
- </devices>
-</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 1dc6a01..fcb20bb 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -578,9 +578,6 @@ mymain(void)
json = true;
DO_TEST("monitor-json", false, QEMU_CAPS_DEVICE,
QEMU_CAPS_CHARDEV, QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_NODEFCONFIG);
- DO_TEST("no-shutdown", false, QEMU_CAPS_DEVICE,
- QEMU_CAPS_CHARDEV, QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_NO_SHUTDOWN);
json = false;
free(driver.stateDir);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:44196cc4445f141b5f7f5f45b16ac476e7a2e0c994248714da6818e277f90495
size 12058512

3
libvirt-0.9.7.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cc541b104a7378ecf00d140a1eb3b582e34eed28faed07ca5936caa98ecb82dd
size 12461024

View File

@ -1,7 +1,7 @@
Index: libvirt-0.9.6/configure.ac
Index: libvirt-0.9.7/configure.ac
===================================================================
--- libvirt-0.9.6.orig/configure.ac
+++ libvirt-0.9.6/configure.ac
--- libvirt-0.9.7.orig/configure.ac
+++ libvirt-0.9.7/configure.ac
@@ -63,6 +63,7 @@ AVAHI_REQUIRED="0.6.0"
POLKIT_REQUIRED="0.6"
PARTED_REQUIRED="1.8.0"
@ -10,7 +10,7 @@ Index: libvirt-0.9.6/configure.ac
UDEV_REQUIRED=145
PCIACCESS_REQUIRED=0.10.0
XMLRPC_REQUIRED=1.14.0
@@ -1593,6 +1594,38 @@ AM_CONDITIONAL([WITH_NETCF], [test "$wit
@@ -1591,6 +1592,38 @@ AM_CONDITIONAL([WITH_NETCF], [test "$wit
AC_SUBST([NETCF_CFLAGS])
AC_SUBST([NETCF_LIBS])
@ -49,7 +49,7 @@ Index: libvirt-0.9.6/configure.ac
AC_ARG_WITH([secrets],
AC_HELP_STRING([--with-secrets], [with local secrets management driver @<:@default=yes@:>@]),[],[with_secrets=yes])
@@ -2517,6 +2550,7 @@ AC_MSG_NOTICE([ Remote: $with_remote])
@@ -2515,6 +2548,7 @@ AC_MSG_NOTICE([ Remote: $with_remote])
AC_MSG_NOTICE([ Network: $with_network])
AC_MSG_NOTICE([Libvirtd: $with_libvirtd])
AC_MSG_NOTICE([ netcf: $with_netcf])
@ -57,7 +57,7 @@ Index: libvirt-0.9.6/configure.ac
AC_MSG_NOTICE([ macvtap: $with_macvtap])
AC_MSG_NOTICE([virtport: $with_virtualport])
AC_MSG_NOTICE([])
@@ -2648,6 +2682,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $
@@ -2646,6 +2680,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $
else
AC_MSG_NOTICE([ netcf: no])
fi
@ -69,11 +69,11 @@ Index: libvirt-0.9.6/configure.ac
if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then
AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS])
else
Index: libvirt-0.9.6/daemon/Makefile.am
Index: libvirt-0.9.7/daemon/Makefile.am
===================================================================
--- libvirt-0.9.6.orig/daemon/Makefile.am
+++ libvirt-0.9.6/daemon/Makefile.am
@@ -141,6 +141,10 @@ endif
--- libvirt-0.9.7.orig/daemon/Makefile.am
+++ libvirt-0.9.7/daemon/Makefile.am
@@ -143,6 +143,10 @@ endif
if WITH_NETCF
libvirtd_LDADD += ../src/libvirt_driver_interface.la
@ -84,10 +84,10 @@ Index: libvirt-0.9.6/daemon/Makefile.am
endif
if WITH_NODE_DEVICES
Index: libvirt-0.9.6/daemon/libvirtd.c
Index: libvirt-0.9.7/daemon/libvirtd.c
===================================================================
--- libvirt-0.9.6.orig/daemon/libvirtd.c
+++ libvirt-0.9.6/daemon/libvirtd.c
--- libvirt-0.9.7.orig/daemon/libvirtd.c
+++ libvirt-0.9.7/daemon/libvirtd.c
@@ -75,6 +75,10 @@
# endif
# ifdef WITH_NETCF
@ -99,7 +99,7 @@ Index: libvirt-0.9.6/daemon/libvirtd.c
# endif
# ifdef WITH_STORAGE_DIR
# include "storage/storage_driver.h"
@@ -393,6 +397,10 @@ static void daemonInitialize(void)
@@ -389,6 +393,10 @@ static void daemonInitialize(void)
# endif
# ifdef WITH_NETCF
interfaceRegister();
@ -110,11 +110,11 @@ Index: libvirt-0.9.6/daemon/libvirtd.c
# endif
# ifdef WITH_STORAGE_DIR
storageRegister();
Index: libvirt-0.9.6/src/Makefile.am
Index: libvirt-0.9.7/src/Makefile.am
===================================================================
--- libvirt-0.9.6.orig/src/Makefile.am
+++ libvirt-0.9.6/src/Makefile.am
@@ -923,6 +923,24 @@ libvirt_driver_interface_la_LIBADD += ..
--- libvirt-0.9.7.orig/src/Makefile.am
+++ libvirt-0.9.7/src/Makefile.am
@@ -941,6 +941,24 @@ libvirt_driver_interface_la_LIBADD += ..
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
endif
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
@ -139,10 +139,10 @@ Index: libvirt-0.9.6/src/Makefile.am
endif
if WITH_SECRETS
Index: libvirt-0.9.6/src/interface/netcf_driver.c
Index: libvirt-0.9.7/src/interface/netcf_driver.c
===================================================================
--- libvirt-0.9.6.orig/src/interface/netcf_driver.c
+++ libvirt-0.9.6/src/interface/netcf_driver.c
--- libvirt-0.9.7.orig/src/interface/netcf_driver.c
+++ libvirt-0.9.7/src/interface/netcf_driver.c
@@ -23,7 +23,13 @@
#include <config.h>
@ -208,11 +208,11 @@ Index: libvirt-0.9.6/src/interface/netcf_driver.c
/* open netcf */
if (ncf_init(&driverState->netcf, NULL) != 0)
{
Index: libvirt-0.9.6/tools/virsh.c
Index: libvirt-0.9.7/tools/virsh.c
===================================================================
--- libvirt-0.9.6.orig/tools/virsh.c
+++ libvirt-0.9.6/tools/virsh.c
@@ -16011,6 +16011,10 @@ vshShowVersion(vshControl *ctl ATTRIBUTE
--- libvirt-0.9.7.orig/tools/virsh.c
+++ libvirt-0.9.7/tools/virsh.c
@@ -16506,6 +16506,10 @@ vshShowVersion(vshControl *ctl ATTRIBUTE
#endif
#ifdef WITH_NETCF
vshPrint(ctl, " Netcf");

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Wed Nov 9 18:52:18 MST 2011 - jfehlig@suse.com
- Update to libvirt 0.9.7
- esx: support vSphere 5.x
- vbox: support for VirtualBox 4.1
- Introduce the virDomainOpenGraphics API
- Add AHCI support to qemu driver
- snapshot: many improvements and 2 new APIs
- api: Add public api for 'reset'
-------------------------------------------------------------------
Tue Oct 18 15:20:11 MDT 2011 - jfehlig@suse.com

View File

@ -44,7 +44,7 @@
%define with_libxl 0%{!?_without_libxl:%{server_drivers}}
%define with_vmware 0%{!?_without_vmware:%{server_drivers}}
# Then the hypervisor drivers that talk a native remote protocol
# Then the hypervisor drivers that talk via a native remote protocol
%define with_phyp 0%{!?_without_phyp:0}
%define with_esx 0%{!?_without_esx:1}
%define with_xenapi 0%{!?_without_xenapi:1}
@ -102,7 +102,8 @@
%define with_numactl 0
%endif
# SLES doesn't contain OpenVZ, VBox, UML, ESX, VMWare, or Citrix XenAPI
# SLES doesn't contain OpenVZ, VBox, UML, ESX, VMWare, Citrix XenAPI,
# or hyper-v
%if 0%{?sles_version}
%define with_openvz 0
%define with_vbox 0
@ -110,6 +111,7 @@
%define with_esx 0
%define with_vmware 0
%define with_xenapi 0
%define with_hyperv 0
%endif
# Enable phyp driver for IBM Power systems
@ -300,13 +302,17 @@ BuildRequires: device-mapper-devel
%if %{with_audit}
BuildRequires: audit-devel
%endif
%if %{with_dtrace}
# we need /usr/sbin/dtrace
BuildRequires: systemtap-sdt-devel
%endif
Name: libvirt
Url: http://libvirt.org/
License: LGPLv2.1+
Group: Development/Libraries/C and C++
AutoReqProv: yes
Version: 0.9.6
Version: 0.9.7
Release: 1
Summary: A C toolkit to interact with the virtualization capabilities of Linux
Conflicts: kvm < 0.14.1
@ -374,15 +380,10 @@ Source1: libvirtd.init
Source2: libvirtd-relocation-server.fw
Source99: baselibs.conf
# Upstream patches
# This patch reverts commit f84aedad, which is not needed since
# the openSUSE kvm package is patched with qemu 'no-shutdown' fix
Patch0: f84aedad-revert.patch
Patch1: c1bc3d89-qemu-add-ahci.patch
# Need to go upstream
Patch100: xen-name-for-devid.patch
Patch101: clone.patch
Patch102: xen-pv-cdrom.patch
Patch103: xend-disk-order.patch
# Our patches
Patch200: libvirtd-defaults.patch
Patch201: use-init-script-redhat.patch
@ -395,7 +396,6 @@ Patch300: libvirt-suse-netcontrol.patch
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Libvirt is a C toolkit to interact with the virtualization
capabilities of Linux. Virtualization of the Linux Operating System means
@ -425,7 +425,6 @@ Recommends: cyrus-sasl-digestmd5
# (client invokes 'nc' against the UNIX socket on the server)
Recommends: netcat-openbsd
%description client
Libvirt is a C toolkit to interact with the virtualization
capabilities of Linux. The libvirt-client package contains shared
@ -449,7 +448,6 @@ Requires: pkg-config
Requires: xen-devel
%endif
%description devel
Libvirt is a C toolkit to interact with the virtualization
capabilities of Linux. The libvirt-devel package contains headers
@ -468,7 +466,6 @@ Summary: A C toolkit to interact with the virtualization capabilities of
Group: Development/Libraries/C and C++
Requires: %{name}-client = %{version}-%{release}
%description doc
Libvirt is a C toolkit to interact with the virtualization
capabilities of Linux. The libvirt-doc package contains documentation
@ -483,7 +480,6 @@ Authors:
%if %{with_python}
%package python
License: LGPLv2.1+
Summary: A C toolkit to interact with the virtualization capabilities of Linux
@ -491,7 +487,6 @@ Group: Development/Libraries/C and C++
Requires: %{name}-client = %{version}-%{release}
%py_requires
%description python
Libvirt is a C toolkit to interact with the virtualization
capabilities of Linux. The libvirt-python package provides python
@ -505,15 +500,11 @@ Authors:
Karel Zak <kzak@redhat.com>
%endif
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch100 -p1
%patch101
%patch102 -p1
%patch103 -p1
%patch200 -p1
%patch201 -p1
%patch202 -p1
@ -524,7 +515,6 @@ Authors:
%patch300 -p1
%endif
%build
%if ! %{with_xen}
%define _without_xen --without-xen
@ -616,6 +606,9 @@ Authors:
%if ! %{with_audit}
%define _without_audit --without-audit
%endif
%if ! %{with_dtrace}
%define _without_dtrace --without-dtrace
%endif
%if ! %{with_network}
%define _without_network --without-network
%endif
@ -662,6 +655,7 @@ export CFLAGS="$RPM_OPT_FLAGS"
%{?_without_macvtap} \
%{?_without_polkit} \
%{?_without_audit} \
%{?_without_dtrace} \
%{?_without_network} \
%{?_without_sasl} \
%{?_without_python} \
@ -675,7 +669,6 @@ export CFLAGS="$RPM_OPT_FLAGS"
ac_cv_path_SHOWMOUNT=/usr/sbin/showmount
make %{?jobs:-j%jobs} DOCS_DIR=%{_docdir}/%{name}-python EXAMPLE_DIR=%{_docdir}/%{name}-python/examples HTML_DIR=%{_docdir}/%{name}
%install
%makeinstall DOCS_DIR=%{_docdir}/%{name}-python EXAMPLE_DIR=%{_docdir}/%{name}-python/examples HTML_DIR=%{_docdir}/%{name}
cp -a AUTHORS ChangeLog COPYING NEWS README TODO $RPM_BUILD_ROOT%{_docdir}/%{name}/
@ -749,16 +742,13 @@ ln -s /etc/init.d/libvirt-guests $RPM_BUILD_ROOT%{_sbindir}/rclibvirt-guests
mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir}
install -m 644 %{S:2} $RPM_BUILD_ROOT/%{_fwdefdir}/libvirtd-relocation-server
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%{_bindir}/getent group libvirt >/dev/null || \
%{_sbindir}/groupadd -r libvirt 2>/dev/null
%post
/sbin/ldconfig
%if %{with_libvirtd}
@ -780,13 +770,11 @@ fi
%endif
%{fillup_only -n libvirt-guests}
%preun
%if %{with_libvirtd}
%stop_on_removal libvirtd
%endif
%postun
/sbin/ldconfig
%if %{with_libvirtd}
@ -794,15 +782,12 @@ fi
%endif
%insserv_cleanup
%post client -p /sbin/ldconfig
%postun client -p /sbin/ldconfig
%if %{with_libvirtd}
%files
%defattr(-, root, root)
%{_sbindir}/libvirtd
@ -824,6 +809,10 @@ fi
%{_sbindir}/rclibvirtd
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
%if %{with_dtrace}
%{_datadir}/systemtap/tapset/libvirt_probes.stp
%{_datadir}/systemtap/tapset/libvirt_functions.stp
%endif
%dir %{_localstatedir}/lib/libvirt/
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
@ -878,7 +867,6 @@ fi
%endif
%config %{_fwdefdir}/libvirtd-relocation-server
%files client -f %{name}.lang
%defattr(-, root, root)
%doc %dir %{_docdir}/%{name}
@ -887,6 +875,7 @@ fi
%doc %{_mandir}/man1/virsh.1*
%doc %{_mandir}/man1/virt-xml-validate.1*
%doc %{_mandir}/man1/virt-pki-validate.1*
%config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf
%{_bindir}/virsh
%{_bindir}/virt-xml-validate
%{_bindir}/virt-pki-validate
@ -918,14 +907,12 @@ fi
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
%endif
%files devel
%defattr(-, root, root)
%{_includedir}/libvirt
%{_libdir}/*.so
%{_libdir}/pkgconfig/libvirt.pc
%files doc
%defattr(-, root, root)
%{_datadir}/gtk-doc/html/libvirt
@ -937,7 +924,6 @@ fi
%if %{with_python}
%files python
%defattr(-, root, root)
%doc %{_docdir}/%{name}-python
@ -946,6 +932,4 @@ fi
%{py_sitedir}/libvirtmod*
%endif
%changelog

View File

@ -1,8 +1,8 @@
Index: libvirt-0.9.4/tools/Makefile.am
Index: libvirt-0.9.7/tools/Makefile.am
===================================================================
--- libvirt-0.9.4.orig/tools/Makefile.am
+++ libvirt-0.9.4/tools/Makefile.am
@@ -152,16 +152,17 @@ uninstall-local: uninstall-init
--- libvirt-0.9.7.orig/tools/Makefile.am
+++ libvirt-0.9.7/tools/Makefile.am
@@ -155,16 +155,17 @@ uninstall-local: uninstall-init
if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init: libvirt-guests.init
@ -26,10 +26,10 @@ Index: libvirt-0.9.4/tools/Makefile.am
BUILT_SOURCES += libvirt-guests.init
Index: libvirt-0.9.4/tools/libvirt-guests.sysconf
Index: libvirt-0.9.7/tools/libvirt-guests.sysconf
===================================================================
--- libvirt-0.9.4.orig/tools/libvirt-guests.sysconf
+++ libvirt-0.9.4/tools/libvirt-guests.sysconf
--- libvirt-0.9.7.orig/tools/libvirt-guests.sysconf
+++ libvirt-0.9.7/tools/libvirt-guests.sysconf
@@ -1,18 +1,28 @@
+## Path: System/Virtualization/libvirt
+
@ -80,10 +80,10 @@ Index: libvirt-0.9.4/tools/libvirt-guests.sysconf
# If non-zero, try to bypass the file system cache when saving and
# restoring guests, even though this may give slower operation for
# some file systems.
Index: libvirt-0.9.4/tools/libvirt-guests.init.sh
Index: libvirt-0.9.7/tools/libvirt-guests.init.sh
===================================================================
--- libvirt-0.9.4.orig/tools/libvirt-guests.init.sh
+++ libvirt-0.9.4/tools/libvirt-guests.init.sh
--- libvirt-0.9.7.orig/tools/libvirt-guests.init.sh
+++ libvirt-0.9.7/tools/libvirt-guests.init.sh
@@ -4,10 +4,10 @@
#
### BEGIN INIT INFO
@ -226,26 +226,30 @@ Index: libvirt-0.9.4/tools/libvirt-guests.init.sh
esac
-exit $RETVAL
+rc_exit
Index: libvirt-0.9.4/daemon/Makefile.am
Index: libvirt-0.9.7/daemon/Makefile.am
===================================================================
--- libvirt-0.9.4.orig/daemon/Makefile.am
+++ libvirt-0.9.4/daemon/Makefile.am
@@ -252,16 +252,12 @@ install-logrotate: $(LOGROTATE_CONFS)
--- libvirt-0.9.7.orig/daemon/Makefile.am
+++ libvirt-0.9.7/daemon/Makefile.am
@@ -236,20 +236,12 @@ install-logrotate: $(LOGROTATE_CONFS)
if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init: libvirtd.init
- mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
- mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d \
- $(DESTDIR)$(sysconfdir)/sysconfig \
- $(DESTDIR)$(sysconfdir)/sysctl.d
- $(INSTALL_SCRIPT) libvirtd.init \
- $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
- mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
+ mkdir -p $(DESTDIR)$(localstatedir)/adm/fillup-templates
$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
- $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
- $(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
- $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
+ $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirtd
uninstall-init:
- rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
- $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
- $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd \
- $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
+ rm -f $(DESTDIR)$(localstatedir)/adm/fillup-templates/sysconfig.libvirtd
BUILT_SOURCES += libvirtd.init

View File

@ -13,10 +13,10 @@ Date: Wed Jan 27 16:11:41 2010 -0700
This approach allows removing a disk when domain is inactive. We
obviously can't search xenstore when the domain is inactive.
Index: libvirt-0.9.6/src/xen/xend_internal.c
Index: libvirt-0.9.7/src/xen/xend_internal.c
===================================================================
--- libvirt-0.9.6.orig/src/xen/xend_internal.c
+++ libvirt-0.9.6/src/xen/xend_internal.c
--- libvirt-0.9.7.orig/src/xen/xend_internal.c
+++ libvirt-0.9.7/src/xen/xend_internal.c
@@ -60,6 +60,7 @@
static int
@ -52,7 +52,7 @@ Index: libvirt-0.9.6/src/xen/xend_internal.c
goto cleanup;
if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
@@ -3915,6 +3916,7 @@ struct xenUnifiedDriver xenDaemonDriver
@@ -3913,6 +3914,7 @@ struct xenUnifiedDriver xenDaemonDriver
*/
static int
virDomainXMLDevID(virDomainPtr domain,
@ -60,7 +60,7 @@ Index: libvirt-0.9.6/src/xen/xend_internal.c
virDomainDeviceDefPtr dev,
char *class,
char *ref,
@@ -3923,8 +3925,12 @@ virDomainXMLDevID(virDomainPtr domain,
@@ -3921,8 +3923,12 @@ virDomainXMLDevID(virDomainPtr domain,
xenUnifiedPrivatePtr priv = domain->conn->privateData;
char *xref;
char *tmp;
@ -73,7 +73,7 @@ Index: libvirt-0.9.6/src/xen/xend_internal.c
if (dev->data.disk->driverName &&
STREQ(dev->data.disk->driverName, "tap"))
strcpy(class, "tap");
@@ -3934,19 +3940,21 @@ virDomainXMLDevID(virDomainPtr domain,
@@ -3932,19 +3938,21 @@ virDomainXMLDevID(virDomainPtr domain,
else
strcpy(class, "vbd");

View File

@ -1,8 +1,8 @@
Index: libvirt-0.9.1/src/xenxs/xen_sxpr.c
Index: libvirt-0.9.7/src/xenxs/xen_sxpr.c
===================================================================
--- libvirt-0.9.1.orig/src/xenxs/xen_sxpr.c
+++ libvirt-0.9.1/src/xenxs/xen_sxpr.c
@@ -324,7 +324,7 @@ error:
--- libvirt-0.9.7.orig/src/xenxs/xen_sxpr.c
+++ libvirt-0.9.7/src/xenxs/xen_sxpr.c
@@ -329,7 +329,7 @@ error:
static int
xenParseSxprDisks(virDomainDefPtr def,
const struct sexpr *root,
@ -11,7 +11,7 @@ Index: libvirt-0.9.1/src/xenxs/xen_sxpr.c
int xendConfigVersion)
{
const struct sexpr *cur, *node;
@@ -371,7 +371,6 @@ xenParseSxprDisks(virDomainDefPtr def,
@@ -380,7 +380,6 @@ xenParseSxprDisks(virDomainDefPtr def,
/* There is a case without the uname to the CD-ROM device */
offset = strchr(dst, ':');
if (!offset ||

View File

@ -1,44 +0,0 @@
Index: libvirt-0.9.1/src/xenxs/xen_sxpr.c
===================================================================
--- libvirt-0.9.1.orig/src/xenxs/xen_sxpr.c
+++ libvirt-0.9.1/src/xenxs/xen_sxpr.c
@@ -342,20 +342,24 @@ xenParseSxprDisks(virDomainDefPtr def,
const char *src = NULL;
const char *dst = NULL;
const char *mode = NULL;
+ int bootable;
/* Again dealing with (vbd...) vs (tap ...) differences */
if (sexpr_lookup(node, "device/vbd")) {
src = sexpr_node(node, "device/vbd/uname");
dst = sexpr_node(node, "device/vbd/dev");
mode = sexpr_node(node, "device/vbd/mode");
+ bootable = sexpr_int(node, "device/vbd/bootable");
} else if (sexpr_lookup(node, "device/tap2")) {
src = sexpr_node(node, "device/tap2/uname");
dst = sexpr_node(node, "device/tap2/dev");
mode = sexpr_node(node, "device/tap2/mode");
+ bootable = sexpr_int(node, "device/tap2/bootable");
} else {
src = sexpr_node(node, "device/tap/uname");
dst = sexpr_node(node, "device/tap/dev");
mode = sexpr_node(node, "device/tap/mode");
+ bootable = sexpr_int(node, "device/tap/bootable");
}
if (VIR_ALLOC(disk) < 0)
@@ -480,7 +484,13 @@ xenParseSxprDisks(virDomainDefPtr def,
if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0)
goto no_memory;
- def->disks[def->ndisks++] = disk;
+ if (bootable == 1 && def->ndisks > 0) {
+ memmove(def->disks + 1, def->disks, sizeof(def->disks) * def->ndisks);
+ def->disks[0] = disk;
+ def->ndisks++;
+ } else
+ def->disks[def->ndisks++] = disk;
+
disk = NULL;
}
}